/**
 * Reviews/Testimonials Styles
 * Exact match to reference design
 *
 * @package Estanar
 */

/* ==========================================================================
   Reviews Section
   ========================================================================== */

.estanar-reviews-section {
    padding: 60px 0 80px;
    background: #6B4DE6;
    overflow: hidden;
}

/* ==========================================================================
   Section Header
   ========================================================================== */

.reviews-section-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 0 20px;
}

.reviews-section-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px 0;
    line-height: 1.1;
}

.reviews-section-subtitle {
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   Carousel Container
   ========================================================================== */

.reviews-carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.reviews-carousel {
    overflow: hidden;
}

.reviews-carousel-track {
    display: flex;
    transition: transform 0.4s ease-out;
}

.reviews-carousel-slide {
    flex: 0 0 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

/* ==========================================================================
   Card Wrapper
   ========================================================================== */

.review-card-wrapper {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Review Card - Rounded Square with Gradient Border
   ========================================================================== */

.review-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px 18px 24px;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    border: 3px solid transparent;
}

/* Card 1 - Coral to Purple gradient border */
.reviews-carousel-slide:nth-child(3n+1) .review-card {
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(to bottom, #F26A5E 0%, #9B5DE5 100%) border-box;
}

/* Card 2 - Purple to Deep Purple gradient border */
.reviews-carousel-slide:nth-child(3n+2) .review-card {
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(to bottom, #9B5DE5 0%, #6B4DE6 100%) border-box;
}

/* Card 3 - Mint to Purple gradient border */
.reviews-carousel-slide:nth-child(3n) .review-card {
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(to bottom, #A8E6CF 0%, #8B7DE6 100%) border-box;
}

/* ==========================================================================
   Rating - Top Right Inside Card
   ========================================================================== */

.review-rating {
    position: absolute;
    top: 22px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.review-rating-number {
    font-size: 14px;
    font-weight: 500;
    color: #9CA3AF;
}

.review-rating-star {
    color: #FBBF24;
    font-size: 15px;
}

/* ==========================================================================
   Review Content
   ========================================================================== */

.review-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding-top: 10px;
}

.review-text {
    font-size: 15px;
    line-height: 1.75;
    color: #1a1a2e;
    margin: 0;
    font-weight: 400;
    text-align: left;
}

/* ==========================================================================
   Author - Outside Card on Purple
   ========================================================================== */

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.review-author-image {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
}

.review-author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.review-author-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.review-author-job {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ==========================================================================
   Carousel Navigation
   ========================================================================== */

.reviews-carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 35px;
}

.reviews-carousel-arrows {
    display: flex;
    gap: 10px;
}

.carousel-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.carousel-arrow svg {
    width: 18px;
    height: 18px;
}

.reviews-carousel-dots {
    display: flex;
    gap: 10px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.carousel-dot.active {
    background: #fff;
}

.carousel-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   No Reviews
   ========================================================================== */

.no-reviews {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

/* ==========================================================================
   Responsive - Mobile First
   ========================================================================== */

@media (min-width: 576px) {
    .reviews-section-title {
        font-size: 32px;
    }

    .review-card {
        padding: 24px 22px 28px;
        min-height: 200px;
    }

    .review-text {
        font-size: 16px;
    }

    .review-author-image {
        width: 48px;
        height: 48px;
    }

    .review-author-name {
        font-size: 15px;
    }

    .review-author-job {
        font-size: 13px;
    }
}

@media (min-width: 768px) {
    .estanar-reviews-section {
        padding: 80px 0 100px;
    }

    .reviews-carousel-slide {
        flex: 0 0 50%;
        padding: 0 14px;
    }

    .reviews-section-title {
        font-size: 38px;
    }

    .reviews-section-subtitle {
        font-size: 17px;
    }

    .review-card {
        padding: 30px 28px 35px;
        min-height: 240px;
        border-radius: 24px;
    }

    .reviews-carousel-nav {
        margin-top: 45px;
    }
}

@media (min-width: 992px) {
    .reviews-carousel-slide {
        flex: 0 0 33.333%;
    }

    .reviews-section-title {
        font-size: 48px;
    }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="rtl"] .review-text {
    text-align: right;
}

[dir="rtl"] .review-rating {
    right: auto;
    left: 22px;
}

[dir="rtl"] .review-author {
    flex-direction: row-reverse;
}

[dir="rtl"] .review-author-info {
    text-align: right;
}

[dir="rtl"] .reviews-carousel-arrows {
    flex-direction: row-reverse;
}

[dir="rtl"] .carousel-arrow svg {
    transform: scaleX(-1);
}

/* ==========================================================================
   Review Submission Modal
   ========================================================================== */

.estanar-review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 0, 71, 0.7);
    backdrop-filter: blur(4px);
}

.review-modal-container {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: reviewModalIn 0.3s ease-out;
}

@keyframes reviewModalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.review-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.review-modal-close:hover {
    background: #e5e7eb;
    color: #333;
}

[dir="rtl"] .review-modal-close {
    right: auto;
    left: 16px;
}

/* Modal Header */
.review-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.review-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EFA621 0%, #f59e0b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 24px;
    color: #fff;
}

.review-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #100047;
    margin: 0 0 6px;
}

.review-modal-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Service Info Banner */
.review-service-info {
    background: #f0f0ff;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #100047;
    font-weight: 500;
}

.review-service-info i {
    color: #EFA621;
}

/* Form Fields */
.review-field {
    margin-bottom: 18px;
}

.review-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.review-label .required {
    color: #ef4444;
}

.review-input,
.review-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.review-input:focus,
.review-textarea:focus {
    border-color: #2246FF;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 70, 255, 0.1);
}

.review-textarea {
    resize: vertical;
    min-height: 100px;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

[dir="rtl"] .char-count {
    text-align: left;
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    gap: 6px;
}

[dir="rtl"] .star-rating-input {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.star-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
}

.star-btn:hover,
.star-btn.hover {
    color: #fbbf24;
    transform: scale(1.15);
}

.star-btn.active {
    color: #f59e0b;
}

/* Form Actions */
.review-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.review-submit-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2246FF;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.review-submit-btn:hover {
    background: #1a38d4;
}

.review-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.review-cancel-btn {
    padding: 12px 20px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.review-cancel-btn:hover {
    background: #e5e7eb;
}

/* Review Note */
.review-note {
    margin-top: 16px;
    font-size: 12px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.review-note i {
    color: #d1d5db;
}

/* Success State */
.review-success {
    text-align: center;
    padding: 20px 0;
}

.review-success-icon {
    font-size: 60px;
    color: #22c55e;
    margin-bottom: 16px;
}

.review-success h3 {
    font-size: 20px;
    font-weight: 700;
    color: #100047;
    margin: 0 0 8px;
}

.review-success p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 24px;
}

.review-done-btn {
    padding: 12px 36px;
    background: #2246FF;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================================================
   Leave a Review Button (Appointments Tab)
   ========================================================================== */

.btn-leave-review {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: #EFA621;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    margin-left: 10px;
}

.btn-leave-review:hover {
    background: #d4941d;
    transform: translateY(-1px);
}

.btn-leave-review i {
    font-size: 12px;
}

[dir="rtl"] .btn-leave-review {
    margin-left: 0;
    margin-right: 10px;
}

.review-status.reviewed {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #22c55e;
    font-size: 13px;
    font-weight: 600;
    margin-left: 10px;
}

[dir="rtl"] .review-status.reviewed {
    margin-left: 0;
    margin-right: 10px;
}

/* Write a Review Button (Reviews Tab) */
.btn-write-review {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 24px;
    font-size: 14px;
    border-radius: 10px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 576px) {
    .review-modal-container {
        width: 95%;
        padding: 24px 20px;
    }

    .review-modal-title {
        font-size: 18px;
    }

    .star-btn {
        font-size: 28px;
    }

    .review-form-actions {
        flex-direction: column;
    }

    .btn-leave-review {
        margin-left: 0;
        margin-top: 8px;
    }
}
