/* ==========================================================
   Student Success Stories / Video Reviews section
   Used by includes/student-reviews.php (course detail pages)
   and reviews.php ("View All Reviews").
   ========================================================== */

.student-reviews-section,
.reviews-page-section {
    --sr-orange: #ff6b00;
    --sr-blue: #0b3d91;
    --sr-radius: 18px;
    padding: 90px 0;
}

.sr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 991px) {
    .sr-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .sr-grid { grid-template-columns: 1fr; }
}

/* ---------- Carousel (shown automatically when > 6 reviews) ---------- */
.sr-carousel-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sr-carousel {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 4px 16px;
    flex: 1;
    scrollbar-width: thin;
}

.sr-carousel .sr-card {
    flex: 0 0 calc(33.333% - 20px);
    scroll-snap-align: start;
}

@media (max-width: 991px) {
    .sr-carousel .sr-card { flex-basis: calc(50% - 15px); }
}

@media (max-width: 575px) {
    .sr-carousel .sr-card { flex-basis: 88%; }
}

.sr-arrow {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 0, 0.3);
    background: var(--bg-surface);
    color: var(--sr-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.sr-arrow:hover {
    background: var(--sr-orange);
    color: #fff;
    border-color: var(--sr-orange);
}

@media (max-width: 575px) {
    .sr-arrow { display: none; }
}

/* ---------- Card ---------- */
.sr-card {
    background: var(--bg-surface);
    border-radius: var(--sr-radius);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: 0 10px 30px -18px rgba(10, 31, 68, 0.25);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sr-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(255, 107, 0, 0.35);
}

.sr-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    cursor: pointer;
}

.sr-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.sr-card:hover .sr-card-thumb img {
    transform: scale(1.08);
}

.sr-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(255, 107, 0, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 10px 25px -8px rgba(255, 107, 0, 0.7);
    transition: var(--transition);
}

.sr-card-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 31, 68, 0.55), rgba(10, 31, 68, 0));
    opacity: 0;
    transition: var(--transition);
}

.sr-card:hover .sr-card-thumb::after {
    opacity: 1;
}

.sr-card:hover .sr-play-btn {
    transform: translate(-50%, -50%) scale(1.15);
    background: var(--sr-orange);
}

.sr-card-body {
    padding: 22px 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sr-card-body h4 {
    color: var(--sr-blue);
    font-size: 19px;
    margin: 0;
}

:root[data-theme="dark"] .sr-card-body h4 { color: #7fa8f2; }

.sr-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13.5px;
    color: var(--text-muted);
}

.sr-card-meta i {
    color: var(--sr-orange);
    margin-right: 4px;
}

.sr-stars {
    color: #ffb400;
    font-size: 14px;
    letter-spacing: 2px;
}

.sr-review-text {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.sr-watch-btn {
    margin-top: 8px;
    align-self: flex-start;
    border-color: var(--sr-orange);
    color: var(--sr-orange);
}

.sr-watch-btn:hover {
    background: var(--sr-orange);
    color: #fff;
}

.sr-viewall {
    text-align: center;
    margin-top: 50px;
}

/* ---------- Modal / Lightbox ---------- */
.sr-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(6, 14, 34, 0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sr-modal.open {
    display: flex;
}

.sr-modal-content {
    position: relative;
    width: 100%;
    max-width: 860px;
    background: #000;
    border-radius: var(--sr-radius);
    overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

.sr-modal-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.sr-modal-media iframe,
.sr-modal-media video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.sr-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: var(--transition);
}

.sr-modal-close:hover {
    background: var(--sr-orange);
}

body.sr-modal-lock {
    overflow: hidden;
}

/* ---------- reviews.php full listing ---------- */
.reviews-page-hero {
    padding: 70px 0 20px;
    text-align: center;
}
