/* =================================================================
   PREMIUM RESPONSIVE TESTIMONIALS SECTION
   Flash-Card Stack Layout with Glassmorphism & Spring Animations
   ================================================================= */

/* ─────────────────────────────────────────────────────────────────
   SECTION STYLING & BACKGROUND
   ───────────────────────────────────────────────────────────────── */

.testimonials-section {
    position: relative;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f1f8 50%, #f8f9fa 100%);
    overflow: hidden;
    min-height: 600px;
}

.testimonials-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.testimonials-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* Section Container */
.testimonials-section .container {
    position: relative;
    z-index: 2;
}

/* ─────────────────────────────────────────────────────────────────
   SECTION HEADER
   ───────────────────────────────────────────────────────────────── */

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 400;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────
   TESTIMONIALS STACK WRAPPER
   ───────────────────────────────────────────────────────────────── */

.testimonials-stack-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 5;
}

.testimonials-stack-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 450px;
    perspective: 1200px;
}

/* ─────────────────────────────────────────────────────────────────
   TESTIMONIALS STACK - STACKED CARDS LAYOUT
   ───────────────────────────────────────────────────────────────── */

.testimonials-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Individual Testimonial Card in Stack */
.testimonial-card-stack {
    position: absolute;
    width: 100%;
    max-width: 400px;
    height: 380px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 
        0 20px 60px rgba(52, 152, 219, 0.14),
        0 0 40px rgba(255, 193, 7, 0.09),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -1px 1px rgba(0, 0, 0, 0.02);
    cursor: grab;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    transform: 
        translateY(35px) 
        scale(0.82) 
        rotateX(18deg) 
        rotateZ(var(--tilt, 0deg));
    z-index: 1;
}

/* Active Card (Front) - Fully Visible */
.testimonial-card-stack.active {
    opacity: 1;
    pointer-events: auto;
    transform: 
        translateY(0) 
        scale(1) 
        rotateX(0deg) 
        rotateZ(var(--tilt, 0deg));
    z-index: 10;
    box-shadow: 
        0 30px 70px rgba(52, 152, 219, 0.16),
        0 0 50px rgba(255, 193, 7, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.9),
        inset 0 -1px 1px rgba(0, 0, 0, 0.02);
}

/* Second Card (Visible Behind) */
.testimonial-card-stack.next {
    opacity: 0.65;
    pointer-events: none;
    transform: 
        translateY(22px) 
        scale(0.91) 
        rotateX(10deg) 
        rotateZ(var(--tilt, 0deg));
    z-index: 9;
    filter: blur(2.5px) brightness(0.98);
}

/* Third Card (Visible Behind) */
.testimonial-card-stack.next:nth-child(n+3) {
    opacity: 0.35;
    transform: 
        translateY(44px) 
        scale(0.82) 
        rotateX(16deg) 
        rotateZ(var(--tilt, 0deg));
    z-index: 8;
    filter: blur(5px) brightness(0.96);
}

/* Exit Animation - Card Sliding Out */
.testimonial-card-stack.exit-left {
    animation: slideOutLeft 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.testimonial-card-stack.exit-right {
    animation: slideOutRight 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Enter Animation - Card Sliding In */
.testimonial-card-stack.enter {
    animation: slideIn 0.12s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ─────────────────────────────────────────────────────────────────
   CARD CONTENT STYLING
   ───────────────────────────────────────────────────────────────── */

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.6rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Student Avatar */
.student-avatar {
    display: none;
}

/* Student Name */
.student-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0 0;
    letter-spacing: -0.4px;
}

/* Star Rating */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    font-size: 1.25rem;
    animation: ratingPulse 2s ease-in-out infinite;
}

.star-rating i {
    color: #ffc107;
    text-shadow: 
        0 2px 6px rgba(255, 193, 7, 0.3),
        0 0 8px rgba(255, 193, 7, 0.15);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.star-rating i:hover {
    transform: scale(1.15);
}

.star-rating i.fa-star-half-alt {
    color: #ffc107;
}

/* Review Text */
.review-text {
    font-size: 1rem;
    line-height: 1.75;
    color: #555;
    font-style: italic;
    font-weight: 400;
    flex-grow: 1;
    display: flex;
    align-items: center;
    padding: 0.3rem 0;
    letter-spacing: 0.3px;
}

/* ─────────────────────────────────────────────────────────────────
   TESTIMONIALS CONTROLS
   ───────────────────────────────────────────────────────────────── */

.testimonials-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

/* Navigation Buttons */
.testimonial-navbar-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.18) 0%, rgba(255, 193, 7, 0.18) 100%);
    border: 2px solid rgba(52, 152, 219, 0.35);
    color: #3498db;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 25px rgba(52, 152, 219, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.testimonial-navbar-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3) 0%, rgba(255, 193, 7, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.testimonial-navbar-btn i {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.testimonial-navbar-btn:hover {
    transform: scale(1.12);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.28) 0%, rgba(255, 193, 7, 0.28) 100%);
    border-color: rgba(52, 152, 219, 0.6);
    box-shadow: 
        0 12px 40px rgba(52, 152, 219, 0.25),
        0 0 25px rgba(255, 193, 7, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: #2980b9;
}

.testimonial-navbar-btn:hover::before {
    opacity: 1;
}

.testimonial-navbar-btn:hover i {
    transform: scale(1.1);
}

.testimonial-navbar-btn:active {
    transform: scale(0.92);
    box-shadow: 
        0 6px 15px rgba(52, 152, 219, 0.15),
        inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Pagination Dots */
.testimonials-pagination {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    max-width: 280px;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.22);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.dot:hover {
    background: rgba(52, 152, 219, 0.45);
    transform: scale(1.25);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.dot.active {
    background: linear-gradient(135deg, #3498db 0%, #ffc107 100%);
    transform: scale(1.4);
    box-shadow: 
        0 6px 20px rgba(52, 152, 219, 0.35),
        0 0 15px rgba(255, 193, 7, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ─────────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────────── */

@keyframes slideOutLeft {
    0% {
        opacity: 1;
        transform: translateX(0) rotateZ(0deg) scale(1);
        filter: blur(0px) brightness(1);
    }
    40% {
        opacity: 0.7;
        transform: translateX(-150px) rotateZ(-8deg) scale(0.97);
        filter: blur(3px) brightness(0.98);
    }
    70% {
        opacity: 0.3;
        transform: translateX(-300px) rotateZ(-12deg) scale(0.9);
        filter: blur(8px) brightness(0.95);
    }
    100% {
        opacity: 0;
        transform: translateX(-450px) rotateZ(-18deg) scale(0.75);
        filter: blur(12px) brightness(0.9);
    }
}

@keyframes slideOutRight {
    0% {
        opacity: 1;
        transform: translateX(0) rotateZ(0deg) scale(1);
        filter: blur(0px) brightness(1);
    }
    40% {
        opacity: 0.7;
        transform: translateX(150px) rotateZ(8deg) scale(0.97);
        filter: blur(3px) brightness(0.98);
    }
    70% {
        opacity: 0.3;
        transform: translateX(300px) rotateZ(12deg) scale(0.9);
        filter: blur(8px) brightness(0.95);
    }
    100% {
        opacity: 0;
        transform: translateX(450px) rotateZ(18deg) scale(0.75);
        filter: blur(12px) brightness(0.9);
    }
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.8) rotateX(20deg);
        filter: blur(5px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(5px) scale(1.02) rotateX(2deg);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}

@keyframes avatarFloat {
    0%, 100% {
        transform: translateY(0px) scale(1);
        filter: drop-shadow(0 10px 30px rgba(52, 152, 219, 0.3));
    }
    50% {
        transform: translateY(-8px) scale(1.02);
        filter: drop-shadow(0 15px 40px rgba(52, 152, 219, 0.4));
    }
}

@keyframes ratingPulse {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 2px 6px rgba(255, 193, 7, 0.3));
    }
    50% {
        opacity: 0.9;
        filter: drop-shadow(0 4px 12px rgba(255, 193, 7, 0.5));
    }
}

/* ─────────────────────────────────────────────────────────────────
   DRAG/SWIPE FEEDBACK
   ───────────────────────────────────────────────────────────────── */

.testimonial-card-stack.dragging {
    cursor: grabbing;
    box-shadow: 
        0 30px 70px rgba(52, 152, 219, 0.2),
        0 0 50px rgba(255, 193, 7, 0.15);
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN
   ───────────────────────────────────────────────────────────────── */

/* Large Desktop (1200px and above) */
@media (min-width: 1200px) {
    .testimonials-section {
        padding: 6rem 2rem;
    }

    .testimonials-stack-container {
        max-width: 520px;
        height: 470px;
    }

    .testimonial-card-stack {
        max-width: 440px;
        height: 410px;
        padding: 2.8rem;
        border-radius: 32px;
    }
}

/* Medium Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .testimonials-section {
        padding: 5.5rem 2rem;
    }

    .testimonials-stack-container {
        max-width: 480px;
        height: 450px;
    }

    .testimonial-card-stack {
        max-width: 420px;
        height: 390px;
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    .testimonials-section {
        padding: 4rem 1.5rem;
        min-height: 500px;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .testimonials-stack-container {
        max-width: 380px;
        height: 400px;
    }

    .testimonial-card-stack {
        max-width: 320px;
        height: 340px;
        padding: 2rem;
        border-radius: 20px;
    }

    .card-content {
        gap: 0.8rem;
    }

    .student-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }

    .student-name {
        font-size: 1.2rem;
    }

    .review-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .testimonial-navbar-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .dot {
        width: 8px;
        height: 8px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .testimonials-section {
        padding: 3rem 1rem;
        min-height: 450px;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }

    .section-subtitle {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .testimonials-stack-wrapper {
        gap: 1.5rem;
    }

    .testimonials-stack-container {
        max-width: 100%;
        height: 380px;
        max-width: 320px;
    }

    .testimonial-card-stack {
        max-width: 280px;
        height: 350px;
        padding: 1.8rem;
        border-radius: 18px;
        font-size: 0.95rem;
    }

    .card-content {
        gap: 0.6rem;
    }

    .student-avatar {
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }

    .student-name {
        font-size: 1.1rem;
    }

    .review-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .star-rating {
        font-size: 1rem;
        gap: 0.3rem;
    }

    .testimonials-controls {
        gap: 1rem;
    }

    .testimonial-navbar-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .dot {
        width: 8px;
        height: 8px;
    }

    .testimonials-pagination {
        max-width: 200px;
        gap: 0.5rem;
    }
}

/* Extra Small Mobile (under 352px) */
@media (max-width: 352px) {
    .testimonials-stack-container {
        max-width: 280px;
    }

    .testimonial-card-stack {
        max-width: 240px;
        height: 330px;
        padding: 1.5rem;
        border-radius: 16px;
    }

    .student-avatar {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .student-name {
        font-size: 1rem;
    }

    .review-text {
        font-size: 0.85rem;
    }
}

/* ─────────────────────────────────────────────────────────────────
   ACCESSIBILITY & PRINT
   ───────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .testimonial-card-stack,
    .testimonial-navbar-btn,
    .dot,
    .student-avatar {
        transition: none;
        animation: none;
    }
}

@media print {
    .testimonials-controls {
        display: none;
    }

    .testimonial-card-stack {
        position: relative;
        opacity: 1 !important;
        transform: none !important;
        page-break-inside: avoid;
    }
}

/* ─────────────────────────────────────────────────────────────────
   DARK MODE SUPPORT
   ───────────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    .testimonials-section {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a3e 50%, #1a1a1a 100%);
    }

    .section-title {
        color: #f0f0f0;
    }

    .section-subtitle {
        color: #bbb;
    }

    .testimonial-card-stack {
        background: rgba(40, 40, 50, 0.8);
        border-color: rgba(52, 152, 219, 0.2);
        box-shadow: 
            0 15px 50px rgba(0, 0, 0, 0.4),
            0 0 30px rgba(52, 152, 219, 0.08);
    }

    .student-name {
        color: #f0f0f0;
    }

    .review-text {
        color: #ccc;
    }

    .testimonial-navbar-btn {
        background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(255, 193, 7, 0.2) 100%);
        border-color: rgba(52, 152, 219, 0.4);
    }

    .dot {
        background: rgba(52, 152, 219, 0.3);
    }
}
