/* ==========================================================================
   STUDENT REVIEWS & SUCCESS STORIES - CLEAN & DYNAMIC (UNIFIED CARDS)
   ========================================================================== */

.reviews-section {
    position: relative;
    padding: 55px 20px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-color);
}

.reviews-inner-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Section Header */
.reviews-header {
    text-align: center;
    margin-bottom: 22px;
}

.reviews-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--brand-blue);
    font-size: 13px;
    font-weight: 700;
    border-radius: 9999px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.reviews-header .section-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.reviews-header .section-title span {
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.reviews-header .section-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 18px;
    line-height: 1.5;
}

/* Horizontal Nav Bar: All Stories, Featured Story, Share Your Story in ONE Line */
.reviews-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.filter-tab {
    padding: 9px 20px;
    border-radius: 9999px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.filter-tab.active {
    background: var(--brand-blue);
    color: #ffffff;
    border-color: var(--brand-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.write-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.write-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* Horizontal Scroll Container */
.reviews-scroll-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.reviews-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 10px 4px 22px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.reviews-slider::-webkit-scrollbar {
    height: 6px;
}

.reviews-slider::-webkit-scrollbar-track {
    background: var(--bg-surface-alt);
    border-radius: 10px;
}

.reviews-slider::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

.reviews-slider::-webkit-scrollbar-thumb:hover {
    background: var(--brand-blue);
}

/* Scroll Arrows */
.scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    color: var(--text-heading);
    box-shadow: 0 4px 16px var(--shadow-color-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
}

.scroll-arrow:hover {
    background: var(--brand-blue);
    color: #ffffff;
    border-color: var(--brand-blue);
    transform: translateY(-50%) scale(1.08);
}

.scroll-arrow.prev-arrow {
    left: -14px;
}

.scroll-arrow.next-arrow {
    right: -14px;
}

@media screen and (max-width: 768px) {
    .scroll-arrow {
        display: none;
    }

    .reviews-header .section-title {
        font-size: 26px;
        line-height: 1.3;
    }

    .reviews-header .section-subtitle {
        font-size: 14px;
        padding: 0 16px;
    }
}

/* Unified Story Card */
.review-card {
    flex: 0 0 350px;
    width: 350px;
    max-width: 350px;
    min-width: 300px;
    scroll-snap-align: start;
    background: var(--bg-surface);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow-color);
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
    box-sizing: border-box;
}

.review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px var(--shadow-color-strong);
    border-color: rgba(37, 99, 235, 0.35);
}

.review-card.featured-card {
    border: 1.5px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.14), 0 4px 20px var(--shadow-color);
}

.review-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.badge-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-surface-alt);
    color: var(--brand-blue);
    border: 1px solid var(--border-color);
}

.featured-card .badge-tag {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
}

@media (prefers-color-scheme: dark) {
    .featured-card .badge-tag {
        color: #fbbf24;
    }
}

.review-rating-stars {
    display: flex;
    gap: 3px;
    color: #f59e0b;
    font-size: 13px;
}

.review-quote-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.4;
    margin-bottom: 12px;
}

.review-card-body {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-body);
    margin-bottom: 16px;
    flex: 1;
}

.review-card-body p {
    margin: 0;
}

/* Author Row */
.review-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    gap: 8px;
    flex-wrap: wrap;
}

.review-student-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.student-mini-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.student-mini-avatar.avatar-rahul {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
}

.student-mini-avatar.avatar-priya {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.student-mini-avatar.avatar-aman {
    background: linear-gradient(135deg, #10b981, #059669);
}

.student-mini-avatar.avatar-sneha {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.student-mini-avatar.avatar-ankit {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.student-mini-avatar.avatar-riya {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
}

.student-info h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.verified-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 600;
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
    padding: 2px 7px;
    border-radius: 9999px;
}

.student-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* Actions Row: Likes, Comments, Share */
.card-actions-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-action-btn:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.review-action-btn.like-btn.liked {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.review-action-btn.like-btn.liked i {
    color: #ef4444;
    animation: heartPop 0.4s ease;
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.35);
    }

    100% {
        transform: scale(1);
    }
}

/* Collapsible Comments Drawer */
.review-comments-drawer {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}

.review-comments-drawer.open {
    display: block;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 4px;
}

.comment-item {
    padding: 8px 10px;
    background: var(--bg-surface-alt);
    border-radius: 8px;
    font-size: 12px;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    font-weight: 700;
    color: var(--text-heading);
}

.comment-time {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
}

.comment-text {
    color: var(--text-body);
}

.add-comment-box {
    display: flex;
    gap: 6px;
}

.comment-text-input {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-heading);
    outline: none;
}

.comment-send-btn {
    padding: 6px 12px;
    background: var(--brand-blue);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

/* Modal */
.review-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 21, 38, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.review-modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.review-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-alt);
    cursor: pointer;
    font-size: 16px;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 14px 0;
}

.modal-form-group.full-width {
    grid-column: span 2;
}

.modal-form-group input,
.modal-form-group textarea,
.modal-form-group select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-heading);
    outline: none;
    box-sizing: border-box;
}

.modal-submit-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

/* Toast */
.review-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text-heading);
    color: var(--bg-surface);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10001;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.review-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Smartphone: Reviews Header, Headings & Card Responsive Refinement */
@media screen and (max-width: 640px) {
    .reviews-section {
        padding: 32px 14px;
    }

    .reviews-header {
        margin-bottom: 16px;
        padding: 0 6px;
    }

    .reviews-badge {
        font-size: 11px;
        font-weight: 700;
        padding: 4px 12px;
        margin-bottom: 8px;
        gap: 6px;
        letter-spacing: 0.3px;
    }

    .reviews-header .section-title {
        font-size: 22px;
        line-height: 1.25;
        font-weight: 800;
        letter-spacing: -0.3px;
        margin-bottom: 6px;
        word-break: break-word;
    }

    .reviews-header .section-subtitle {
        font-size: 12.5px;
        line-height: 1.45;
        max-width: 100%;
        margin: 0 auto 14px;
        padding: 0 4px;
    }

    .reviews-nav-bar {
        gap: 8px;
        margin-bottom: 16px;
    }

    .filter-tab {
        padding: 6px 14px;
        font-size: 12px;
    }

    .write-review-btn {
        padding: 6px 16px;
        font-size: 12px;
        gap: 6px;
    }

    .reviews-slider {
        gap: 12px;
        padding: 6px 2px 14px;
    }

    .review-card {
        /* Reduced by ~1/4 from full width (88vw-90vw) down to 70vw-72vw / ~250px */
        flex: 0 0 72vw;
        width: 72vw;
        max-width: 260px;
        min-width: 220px;
        border-radius: 13px;
        padding: 12px 13px; /* 1/4 reduction in padding */
        box-shadow: 0 3px 12px var(--shadow-color);
    }

    .review-card-top {
        margin-bottom: 6px;
    }

    .badge-tag {
        font-size: 9.5px;
        padding: 2px 6px;
        letter-spacing: 0.2px;
        border-radius: 4px;
    }

    .review-rating-stars {
        font-size: 10.5px;
        gap: 1.5px;
    }

    .review-quote-title {
        font-size: 12.5px;
        font-weight: 700;
        line-height: 1.35;
        margin-bottom: 5px;
        min-height: 34px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        overflow: hidden;
    }

    .review-card-body {
        font-size: 11px;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    .review-card-body p {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        line-clamp: 4;
        overflow: hidden;
    }

    .review-card-footer {
        padding-top: 7px;
        gap: 5px;
    }

    .review-student-meta {
        gap: 6px;
    }

    .student-mini-avatar {
        width: 27px;
        height: 27px;
        font-size: 10px;
    }

    .student-info h4 {
        font-size: 11.5px;
        font-weight: 700;
        margin-bottom: 0;
        gap: 3px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    .verified-pill {
        font-size: 8.5px;
        padding: 1px 4.5px;
    }

    .student-info p {
        font-size: 9.5px;
        line-height: 1.2;
    }

    .card-actions-row {
        gap: 4px;
    }

    .review-action-btn {
        padding: 3.5px 6px;
        font-size: 10px;
        border-radius: 5px;
        gap: 3px;
    }

    .review-action-btn .action-count {
        font-size: 9.5px;
    }

    .comment-item {
        padding: 5px 8px;
        font-size: 10.5px;
    }

    .comment-meta {
        font-size: 10px;
    }

    .comment-time {
        font-size: 8.5px;
    }

    .comment-text-input {
        padding: 4px 8px;
        font-size: 10.5px;
    }

    .comment-send-btn {
        padding: 4px 8px;
        font-size: 10.5px;
    }

    .review-modal-box {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .review-modal-box h3 {
        font-size: 17px;
        font-weight: 700;
        color: var(--text-heading);
        margin: 0 0 6px;
        line-height: 1.3;
    }

    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .modal-form-group.full-width {
        grid-column: span 1;
    }
}

/* Extra small screens (compact phones <= 480px) */
@media screen and (max-width: 480px) {
    .reviews-section {
        padding: 26px 10px;
    }

    .reviews-badge {
        font-size: 10.5px;
        padding: 3px 10px;
        margin-bottom: 6px;
    }

    .reviews-header .section-title {
        font-size: 20px;
        line-height: 1.25;
        letter-spacing: -0.2px;
        margin-bottom: 5px;
    }

    .reviews-header .section-subtitle {
        font-size: 11.5px;
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .reviews-nav-bar {
        gap: 6px;
        margin-bottom: 14px;
    }

    .filter-tab {
        padding: 5px 11px;
        font-size: 11px;
    }

    .write-review-btn {
        padding: 5px 13px;
        font-size: 11px;
        gap: 5px;
    }

    .review-card {
        flex: 0 0 76vw;
        width: 76vw;
        max-width: 250px;
    }

    .review-modal-box h3 {
        font-size: 16px;
    }
}