/* ===================================
   TESTIMONIALS SECTION
   Screenshot-based interactive gallery
   =================================== */

/* Section Wrapper */
.testimonials {
    padding: 120px 40px;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.testimonials .section-title {
    font-family: 'Golos Bold', Georgia, 'Times New Roman', serif;
    text-align: center;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--text-heading);
    /* Use token instead of gradient */
    background: none;
    -webkit-text-fill-color: initial;
    text-shadow: none;
}

.testimonials .section-subtitle {
    font-family: 'Golos Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 60px;
    line-height: 1.6;
}

/* Filter Controls */
.testimonial-filters {
    max-width: 1200px;
    margin: 0 auto 60px;
}

.filter-goals {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.filter-btn {
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    /* Subtle border */
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: 'Golos Regular', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-heading);
    /* Keep contrast on active */
    box-shadow: 0 4px 16px rgba(84, 110, 122, 0.3);
    transform: translateY(-2px);
}

.filter-btn.active:active {
    transform: translateY(0);
}

.filter-icon {
    font-size: 18px;
}

.match-count {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.match-count strong {
    color: var(--accent-primary);
    font-weight: 700;
}

/* Testimonials Grid */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    transition: min-height 0.3s ease;
}

/* Testimonial Card */
/* Enhanced Testimonial Card Visuals */
.testimonial-card {
    /* Use a rich, dark glass surface */
    background: rgba(15, 23, 42, 0.6);
    /* Darker slate */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    border-radius: 24px;
    /* More rounded */
    padding: 30px;

    /* Smooth transition for all interactive properties */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* User requested soft shadow */
    box-shadow: 0 20px 40px rgba(28, 43, 75, 0.05);

    /* Prepare for 3D effect */
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Premium Hover State */
.testimonial-card:hover {
    /* Slightly lighter background interaction */
    background: rgba(30, 41, 59, 0.7);

    /* Electric Blue Glow Border */
    border-color: rgba(59, 130, 246, 0.5);
    /* var(--accent-primary) */

    /* Significant Lift */
    transform: translateY(-8px) scale(1.02);

    /* Deep, colored glowing shadow */
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(59, 130, 246, 0.2);
    /* Inner glow essence */
}

.testimonial-card.hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    pointer-events: none;
    visibility: hidden;
    margin: 0;
    padding: 0;
    border: none;
    min-height: 0;
    height: 0;
    width: 0;
    /* Ensure width is also 0 if display none fails for some reason */
    flex: 0 0 0;
    /* Collapse flex basis */
    overflow: hidden;
}

.testimonials-grid {
    position: relative;
    min-height: 300px;
}

.testimonials-grid.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-template-columns: 1fr;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-heading);
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.student-info h3 {
    font-family: 'Golos Bold', Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.student-meta {
    font-family: 'Golos Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    line-height: 1.6;
}

.match-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 20px;
    color: #4ade80;
    font-size: 12px;
    font-weight: 600;
}

/* Screenshot Preview (iPhone Frame Mockup) */
.screenshot-preview {
    position: relative;
    border-radius: 24px;
    border: 8px solid #1C2B4B;
    background: #1C2B4B;
    overflow: hidden;
    margin-bottom: 20px;
    cursor: pointer;
}

.screenshot-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 12px;
    background: #1C2B4B;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 10;
}

.screenshot-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.screenshot-preview:hover img {
    transform: scale(1.05);
}

.screenshot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 8px;
}

.screenshot-preview:hover .screenshot-overlay {
    opacity: 1;
}

.screenshot-overlay i {
    font-size: 32px;
    color: #fff;
}

.screenshot-overlay p {
    color: #fff;
    font-size: 14px;
    margin: 0;
}

/* Transformation Summary */
.transformation-summary {
    margin-bottom: 20px;
}

.score-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.score-before {
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
}

.progress-arrow {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-arrow span {
    color: rgba(102, 126, 234, 0.5);
    font-size: 18px;
}

.score-after {
    font-size: 32px;
    font-weight: 700;
    color: #4ade80;
}

.outcome-text {
    font-family: 'Golos Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

/* View Full Button */
.view-full-btn {
    width: 100%;
    padding: 14px;
    background: rgba(84, 110, 122, 0.1);
    border: 1px solid rgba(84, 110, 122, 0.3);
    border-radius: 10px;
    color: var(--accent-primary);
    font-family: 'Golos Regular', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.view-full-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    /* Controlled by JS, but good default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    /* Prevent clicks when fading out */
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-modal.active .lightbox-content img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-counter {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .testimonials {
        padding: 80px 20px;
    }

    .testimonials .section-title {
        font-size: 36px;
    }

    .testimonials .section-subtitle {
        font-size: 16px;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filter-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .testimonials-empty-state {
        padding: 60px 20px;
    }

    .empty-state-icon {
        font-size: 48px;
        margin-bottom: 20px;
    }

    .empty-state-title {
        font-size: 24px;
    }

    .empty-state-text {
        font-size: 14px;
    }
}

/* Empty State */
.testimonials-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.6;
}

.empty-state-title {
    font-family: 'Golos Bold', Georgia, 'Times New Roman', serif;
    font-size: 28px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
}

.empty-state-text {
    font-family: 'Golos Regular', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    max-width: 500px;
    line-height: 1.6;
    margin: 0;
}

/* Animation for filtering */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.testimonial-card:not(.hidden) {
    animation: fadeSlideIn 0.3s ease forwards;
}

/* Scroll Animation Classes */
.assemble-item {
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

.assemble-item.scale-in {
    transform: scale(0.9) translateY(30px);
}

.assemble-item.assembled {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Horizontal Scroll Layout for Testimonials */
.testimonials-grid {
    display: flex;
    flex-wrap: nowrap;
    /* Explicitly prevent wrapping */
    overflow-x: auto;
    gap: 24px;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    width: 100%;
    margin-left: 0;
    /* Ensure no margin offset */
}

.testimonials-grid::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.testimonial-card {
    flex: 0 0 calc(33.333% - 16px);
    /* 3 items visible minus gap */
    scroll-snap-align: center;
    /* Center snap feels better on mobile usually, but start is fine. Let's try center for better focus */
    width: auto;
    /* Reset any fixed width */
    max-width: none;
}

@media (max-width: 1024px) {
    .testimonial-card {
        flex: 0 0 calc(50% - 12px);
        /* 2 items on tablet */
    }
}

@media (max-width: 768px) {
    .testimonial-card {
        flex: 0 0 85%;
        /* 1 item with peek on mobile */
        scroll-snap-align: center;
    }
}

/* Scroll Navigation Buttons */
.testimonials-carousel-container {
    position: relative;
    width: 100%;
}

.scroll-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.scroll-nav:hover {
    background: var(--accent-primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    border-color: var(--accent-primary);
    color: var(--text-heading);
}

.scroll-nav.prev {
    left: -25px;
}

.scroll-nav.next {
    right: -25px;
}

@media (max-width: 768px) {
    .scroll-nav {
        display: none;
    }
}