/* פופאפ ביקורות - עיצוב נקי ומודרני */
.tp-reviews-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tp-reviews-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tp-reviews-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tp-reviews-popup-overlay.active .tp-reviews-popup {
    transform: translate(-50%, -50%) scale(1);
}

.tp-reviews-popup-header {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.tp-reviews-popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.tp-reviews-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    color: #666;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tp-reviews-popup-close:hover {
    background: #f8f9fa;
    border-color: #ccc;
    transform: rotate(90deg);
    color: #333;
}

.tp-reviews-popup-content {
    padding: 0;
    max-height: calc(85vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* עיצוב גלילה מותאם */
.tp-reviews-popup-content::-webkit-scrollbar {
    width: 6px;
}

.tp-reviews-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.tp-reviews-popup-content::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #ddd, #bbb);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.tp-reviews-popup-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #ccc, #aaa);
}

/* Firefox */
.tp-reviews-popup-content {
    scrollbar-width: thin;
    scrollbar-color: #ddd #f1f1f1;
}

.tp-reviews-popup-inner {
    padding: 25px;
}

/* עיצוב ביקורות בתוך הפופאפ */
.tp-reviews-popup .woocommerce-Reviews-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 15px;
    display: none;
}

.tp-reviews-popup .commentlist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tp-reviews-popup .review {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tp-reviews-popup .review:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tp-reviews-popup .comment_container {
    display: flex;
    gap: 15px;
}

.tp-reviews-popup .avatar {
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    display: none;
}

.tp-reviews-popup .comment-text {
    flex: 1;
}

.tp-reviews-popup .star-rating {
    margin-bottom: 10px;
}

.tp-reviews-popup .meta {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.tp-reviews-popup .woocommerce-review__author {
    color: #2c3e50;
    font-weight: 600;
}

.tp-reviews-popup .description {
    line-height: 1.6;
    color: #444;
}

/* טופס הוספת ביקורת */
.tp-reviews-popup #review_form_wrapper {
    background: #ffffff;
    border-top: 2px solid #e9ecef;
    margin-top: 30px;
    padding-top: 25px;
}

.tp-reviews-popup .comment-reply-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: #2c3e50;
    text-align: center;
}

.tp-reviews-popup .comment-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* עיצוב responsive למובייל */
@media (max-width: 768px) {
    .tp-reviews-popup {
        width: 100%;
        height: 100vh;
        max-height: none;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translateY(100%);
    }
    
    .tp-reviews-popup-overlay.active .tp-reviews-popup {
        transform: translateY(0);
    }
    
    .tp-reviews-popup-header {
        padding: 15px 20px;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .tp-reviews-popup-title {
        font-size: 20px;
        padding-right: 50px;
    }
    
    .tp-reviews-popup-close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .tp-reviews-popup-content {
        max-height: calc(100vh - 80px);
        padding-bottom: 20px;
    }
    
    .tp-reviews-popup-inner {
        padding: 20px 15px;
    }
    
    .tp-reviews-popup .comment_container {
        flex-direction: column;
        gap: 10px;
    }
    
    .tp-reviews-popup .avatar {
        align-self: flex-start;
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .tp-reviews-popup-inner {
        padding: 15px 10px;
    }
    
    .tp-reviews-popup .review {
        padding: 15px;
        margin-bottom: 15px;
    }
}

/* אנימציות נוספות */
.tp-reviews-popup .review {
    opacity: 0;
    animation: slideInUp 0.4s ease forwards;
}

.tp-reviews-popup .review:nth-child(1) { animation-delay: 0.1s; }
.tp-reviews-popup .review:nth-child(2) { animation-delay: 0.15s; }
.tp-reviews-popup .review:nth-child(3) { animation-delay: 0.2s; }
.tp-reviews-popup .review:nth-child(4) { animation-delay: 0.25s; }
.tp-reviews-popup .review:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* מניעת גלילה של הגוף כשהפופאפ פתוח */
body.tp-popup-open {
    overflow: hidden;
}

/* כפתור הוסף ביקורת */
.tp-reviews-add-review-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.2);
    white-space: nowrap;
    display: none; /* מוסתר בהתחלה עד שנוודא שיש טופס */
}

.tp-reviews-add-review-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #007cba 100%);
    transform: translateY(-50%) translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.tp-reviews-add-review-btn:active {
    transform: translateY(-50%) translateY(0px);
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.2);
}

/* התאמת הכותרת לפנות מקום לכפתור */
.tp-reviews-popup-title {
    padding: 0 120px 0 120px; /* פנייה משני הצדדים */
}

/* עיצוב responsive למובייל */
@media (max-width: 768px) {
    .tp-reviews-add-review-btn {
        position: static;
        transform: none;
        margin-top: 10px;
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 25px;
        width: 100%;
        max-width: 200px;
        margin: 10px auto 0 auto;
        display: block;
    }
    
    .tp-reviews-popup-title {
        font-size: 18px;
        padding: 0 50px 0 0; /* רק מימין לכפתור הסגירה */
        margin-bottom: 0;
    }
    
    .tp-reviews-popup-header {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .tp-reviews-add-review-btn {
        font-size: 13px;
        padding: 8px 16px;
        max-width: 160px;
    }
    
    .tp-reviews-popup-title {
        font-size: 16px;
    }
}