/* =========================================================
   NEXTWAVE — ALL SERVICES
   Card layout + Details Modal
   v9.0 — feedback slider (read-only), review form on
   write-review.html
========================================================= */


/* =========================================================
   01. ROOT VARIABLES
========================================================= */

:root {
    --primary: #0F766E;
    --primary-dark: #115E59;
    --primary-light: #14B8A6;
    --primary-soft: #CCFBF1;

    --navy: #0F172A;
    --text: #334155;
    --muted: #64748B;
    --light-text: #94A3B8;

    --background: #F8FAFC;
    --surface: #FFFFFF;
    --surface-soft: #F1F5F9;

    --border: #E2E8F0;
    --border-light: #F1F5F9;

    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --amber: #F59E0B;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 28px;

    --transition: 0.25s ease;
    --header-height: 76px;

    font-family: "Inter", Arial, sans-serif;
}


/* =========================================================
   02. DARK MODE
========================================================= */

body.dark-mode {
    --background: #0B1120;
    --surface: #111827;
    --surface-soft: #1E293B;
    --navy: #F8FAFC;
    --text: #CBD5E1;
    --muted: #94A3B8;
    --light-text: #64748B;
    --border: #263244;
    --border-light: #1E293B;
    --primary-soft: rgba(20, 184, 166, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.20);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.38);
}


/* =========================================================
   03. RESET
========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: "Inter", Arial, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}
body.modal-open { overflow: hidden; }

button, input { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }


/* =========================================================
   04. PAGE LOADER
========================================================= */

.page-loader {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; background: var(--background);
    opacity: 1; visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loader p { color: var(--muted); font-size: 14px; font-weight: 600; }

.loader-logo {
    width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #FFFFFF; font-size: 25px;
    box-shadow: 0 12px 30px rgba(15, 118, 110, 0.25);
}
.loader-spinner {
    width: 42px; height: 42px;
    border: 4px solid var(--primary-soft);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loaderSpin 0.8s linear infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }


/* =========================================================
   05. HEADER
========================================================= */

.courses-header {
    position: sticky; top: 0; z-index: 1000;
    width: 100%; min-height: var(--header-height);
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; padding: 12px 5%;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
body.dark-mode .courses-header { background: rgba(17, 24, 39, 0.94); }

.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.back-button {
    width: 42px; height: 42px; flex: 0 0 42px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text); background: var(--surface-soft);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.back-button:hover {
    color: #FFFFFF; background: var(--primary);
    border-color: var(--primary); transform: translateX(-2px);
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-icon {
    width: 43px; height: 43px; flex: 0 0 43px;
    display: flex; align-items: center; justify-content: center;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-md);
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.20);
}
.brand-icon i { font-size: 19px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { color: var(--navy); font-size: 18px; font-weight: 800; line-height: 1.1; }
.brand-text span { margin-top: 3px; color: var(--light-text); font-size: 10px; font-weight: 500; white-space: nowrap; }

.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }

.course-search {
    width: min(280px, 25vw); height: 42px;
    display: flex; align-items: center; gap: 9px;
    padding: 0 13px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.course-search:focus-within {
    background: var(--surface);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.course-search > i { flex: 0 0 auto; color: var(--muted); font-size: 14px; }
.course-search input {
    width: 100%; min-width: 0; border: 0; outline: 0;
    background: transparent; color: var(--text); font-size: 13px;
}
.course-search input::placeholder { color: var(--light-text); }


/* =========================================================
   06. MAIN + HERO
========================================================= */

.courses-main { width: 100%; }

.courses-hero {
    position: relative; min-height: 300px;
    display: flex; align-items: center;
    overflow: hidden; padding: 55px 5%;
    background: linear-gradient(135deg, #0F766E 0%, #115E59 48%, #0F172A 100%);
}
.courses-hero::before {
    content: ""; position: absolute;
    width: 320px; height: 320px; right: -100px; top: -150px;
    background: rgba(20, 184, 166, 0.16); border-radius: 50%;
}
.courses-hero::after {
    content: ""; position: absolute;
    width: 220px; height: 220px; left: -90px; bottom: -130px;
    background: rgba(255, 255, 255, 0.06); border-radius: 50%;
}

.hero-content {
    position: relative; z-index: 2;
    width: 100%; max-width: 760px;
    margin: 0 auto; text-align: center;
}
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    margin-bottom: 17px; padding: 7px 13px;
    color: #CCFBF1; background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
}
.hero-content h1 {
    color: #FFFFFF;
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 800; line-height: 1.12; letter-spacing: -1.5px;
}
.hero-content h1 span { display: block; color: #5EEAD4; }
.hero-content p {
    max-width: 580px; margin: 17px auto 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(14px, 2vw, 16px); line-height: 1.7;
}


/* =========================================================
   07. SERVICES SECTION
========================================================= */

.courses-section {
    width: 100%; max-width: 1400px;
    margin: 0 auto; padding: 55px 5% 70px;
}

.section-heading {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; margin-bottom: 28px;
}
.section-heading > div:first-child > span {
    display: block; margin-bottom: 5px;
    color: var(--primary);
    font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
}
.section-heading h2 {
    color: var(--navy);
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 800; line-height: 1.2;
}
.course-count {
    display: flex; align-items: baseline; gap: 6px;
    color: var(--muted); white-space: nowrap;
}
.course-count strong { color: var(--primary); font-size: 25px; font-weight: 800; }
.course-count span { font-size: 13px; font-weight: 600; }


/* =========================================================
   08. GRID
========================================================= */

.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}


/* =========================================================
   09. CARD
========================================================= */

.all-course-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e8eeed;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
}

.all-course-card:hover {
    transform: translateY(-4px);
    border-color: #d7e8e5;
    box-shadow: 0 20px 40px -18px rgba(15, 23, 42, 0.18);
}


/* =========================================================
   10. IMAGE
========================================================= */

.course-card-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #eef2f1;
    flex-shrink: 0;
}
.course-card-image img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.5s ease;
}
.all-course-card:hover .course-card-image img { transform: scale(1.05); }


/* =========================================================
   11. BADGE — top-left dark navy
========================================================= */

.course-badge {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 2;
    display: inline-flex; align-items: center;
    height: 30px;
    padding: 0 14px;
    color: #ffffff;
    background: #0f2a3a;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}


/* =========================================================
   12. WISHLIST — top-right white circle
========================================================= */

.course-wishlist {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 2;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    color: #0f766e;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
    transition: transform 0.2s ease, color 0.2s ease;
    cursor: pointer;
}
.course-wishlist:hover {
    transform: scale(1.08);
    color: #115e59;
}
.course-wishlist.active { color: #e11d48; }
.course-wishlist i { font-size: 16px; line-height: 1; }


/* =========================================================
   13. BODY
========================================================= */

.all-course-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 22px 22px;
}


/* =========================================================
   14. PROVIDER
========================================================= */

.course-provider {
    display: block;
    margin-bottom: 8px;
    color: #0f766e;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}


/* =========================================================
   15. TITLE
========================================================= */

.course-title {
    margin: 0 0 10px;
    color: #0f172a;
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.015em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* =========================================================
   16. DESCRIPTION
========================================================= */

.course-description {
    margin: 0 0 16px;
    color: #64748b;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}


/* =========================================================
   17. RATING
========================================================= */

.course-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
}
.rating-stars {
    display: inline-flex;
    gap: 2px;
    color: #d4d9d8;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0;
}
.rating-stars span { display: inline-block; }
.rating-stars .filled { color: #f59e0b; }

.rating-number {
    margin-left: 6px;
    color: #0f172a;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
}
.rating-count {
    color: #94a3b8;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
}


/* =========================================================
   18. META — listings · days row
========================================================= */

.course-meta {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 16px 0;
    margin-bottom: 16px;
    border-top: 1px solid #eef2f1;
    border-bottom: 1px solid #eef2f1;
}
.course-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
}
.course-meta-item i {
    color: #0f766e;
    font-size: 14px;
}


/* =========================================================
   19. FOOTER
========================================================= */

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: auto;
}
.course-price {
    color: #0f172a;
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}


/* =========================================================
   20. VIEW BUTTON
========================================================= */

.view-course-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    color: #ffffff;
    background: #0f766e;
    border: none;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.view-course-button:hover {
    background: #115e59;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -8px rgba(15, 118, 110, 0.55);
}
.view-course-button i { font-size: 11px; }


/* =========================================================
   21. STATES
========================================================= */

.courses-loading,
.no-courses,
.no-results {
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
}
.courses-loading[hidden],
.no-courses[hidden],
.no-results[hidden] { display: none; }

.loading-spinner {
    width: 48px; height: 48px;
    margin: 0 auto 18px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loaderSpin 0.8s linear infinite;
}

.no-courses-icon,
.no-results-icon {
    width: 70px; height: 70px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 17px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
    font-size: 24px;
}
.no-courses h3,
.no-results h3 {
    color: var(--navy);
    font-size: 19px;
    font-weight: 800;
}
.no-courses p,
.no-results p { margin-top: 7px; font-size: 13px; }


/* =========================================================
   22. DETAILS MODAL — main
========================================================= */

.details-modal {
    position: fixed;
    inset: 0;
    z-index: 5500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.details-modal[hidden] { display: none; }

.details-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.details-modal__content {
    position: relative;
    background: #fff;
    border-radius: 22px;
    width: 100%;
    max-width: 720px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .45);
    animation: detailsIn .3s ease;
}
@keyframes detailsIn {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* CLOSE */
.details-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #0F172A;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .15);
    transition: transform .2s ease;
}
.details-modal__close:hover { transform: rotate(8deg); }

/* HERO */
.details-modal__hero {
    position: relative;
    height: 220px;
    overflow: hidden;
    border-radius: 22px 22px 0 0;
    background: #eef2f1;
}
.details-modal__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.details-modal__hero-badge {
    position: absolute;
    left: 20px;
    bottom: 18px;
    z-index: 2;
    padding: 7px 14px;
    border-radius: 8px;
    background: #0F172A;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* BODY */
.details-modal__body { padding: 24px 26px 26px; }

.details-modal__title {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
    margin: 0 0 10px;
}

.details-modal__desc {
    color: #64748B;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 22px;
}

/* META GRID */
.details-modal__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.details-modal__meta-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    padding: 14px;
    background: #F1F5F9;
    border-radius: 12px;
}

.details-modal__meta-card i {
    grid-row: span 2;
    color: #0F766E;
    font-size: 17px;
}

.details-modal__meta-card span {
    font-size: 11px;
    color: #64748B;
    font-weight: 600;
}

.details-modal__meta-card strong {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
}

/* =========================================================
   22b. FEEDBACK — READ-ONLY HORIZONTAL SLIDER
========================================================= */

.details-modal__feedback {
    padding-top: 22px;
    border-top: 1px solid #EEF2F1;
    margin-bottom: 24px;
}

.details-modal__feedback-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.details-modal__eyebrow {
    display: block;
    color: #0F766E;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    margin-bottom: 4px;
}

.details-modal__feedback-head h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #0F172A;
    margin: 0;
}

.details-modal__avg {
    padding: 10px 16px;
    border-radius: 10px;
    background: #CCFBF1;
    text-align: center;
    min-width: 78px;
}

.details-modal__avg strong {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #0F766E;
    line-height: 1;
    margin-bottom: 2px;
}

.details-modal__avg-stars {
    color: #F59E0B;
    font-size: 11px;
    letter-spacing: 1px;
}

/* SINGLE-ROW HORIZONTAL SLIDER */
.details-modal__feedback-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 14px;

    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;

    padding: 4px 4px 14px;
    margin: 0 -4px;

    scrollbar-width: thin;
}

.details-modal__feedback-list::-webkit-scrollbar {
    height: 6px;
}
.details-modal__feedback-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 999px;
}
.details-modal__feedback-list::-webkit-scrollbar-track {
    background: transparent;
}

/* Feedback card — fixed width, stays on one row */
.details-modal__fb-card {
    flex: 0 0 auto;
    width: 280px;
    max-width: 80vw;
    scroll-snap-align: start;

    padding: 16px 18px;
    background: #F1F5F9;
    border-radius: 12px;
}

.details-modal__fb-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.details-modal__fb-user {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.details-modal__fb-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0F766E;
    color: #fff;
    border-radius: 50%;
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 14px;
}

.details-modal__fb-name {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 2px;
}

.details-modal__fb-date {
    font-size: 11px;
    color: #94A3B8;
}

.details-modal__fb-stars {
    display: flex;
    gap: 2px;
    font-size: 13px;
    color: #F59E0B;
    margin-top: 3px;
}

.details-modal__fb-rating {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #0F766E;
}

.details-modal__fb-comment {
    font-size: 13px;
    color: #475569;
    line-height: 1.55;
    margin: 0;
}

.details-modal__no-feedback {
    text-align: center;
    padding: 24px 16px;
    border: 1px dashed #CBD5E1;
    border-radius: 12px;
    color: #94A3B8;
    font-size: 13px;
}
.details-modal__no-feedback[hidden] { display: none; }
.details-modal__no-feedback i { font-size: 22px; display: block; margin-bottom: 6px; }

/* NOTE: The old review form styles
   (.details-modal__add-feedback,
    .details-modal__stars,
    .details-modal__submit-fb,
    .details-modal__fb-status)
   have been REMOVED. The review form
   lives on write-review.html. */


/* =========================================================
   22c. BUY BAR
========================================================= */

.details-modal__buy-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #CCFBF1, #F1F5F9);
    border: 1px solid #CCFBF1;
    border-radius: 14px;
}

.details-modal__price span {
    display: block;
    font-size: 11px;
    color: #64748B;
    font-weight: 600;
    margin-bottom: 4px;
}

.details-modal__price strong {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #115E59;
    line-height: 1;
}

.details-modal__buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 22px;
    border: none;
    border-radius: 10px;
    background: #0F766E;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease;
}
.details-modal__buy-btn:hover {
    background: #115E59;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -8px rgba(15, 118, 110, .55);
}
.details-modal__buy-btn i { font-size: 13px; }


/* =========================================================
   23. LOGIN REQUIRED MODAL
========================================================= */

.login-required-modal {
    position: fixed; inset: 0; z-index: 6000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
.login-required-modal[hidden] { display: none; }

.login-required-box {
    position: relative;
    width: 100%; max-width: 430px;
    padding: 34px; text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}
.login-required-icon {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 17px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 50%;
    font-size: 23px;
}
.login-required-box h2 { color: var(--navy); font-size: 23px; font-weight: 800; }
.login-required-box p { margin-top: 9px; color: var(--muted); font-size: 13px; line-height: 1.7; }

.login-required-actions {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-top: 24px;
}
.secondary-button,
.primary-button {
    min-height: 44px; padding: 0 16px;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 12px; font-weight: 800;
    transition: all var(--transition);
}
.secondary-button {
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
}
.secondary-button:hover { background: var(--border); transform: translateY(-1px); }
.primary-button {
    color: #FFFFFF;
    background: var(--primary);
    border: 1px solid var(--primary);
}
.primary-button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}


/* =========================================================
   24. TOAST
========================================================= */

.toast {
    position: fixed; left: 50%; bottom: 25px; z-index: 10000;
    max-width: calc(100% - 30px);
    display: flex; align-items: center; gap: 9px;
    padding: 12px 17px;
    color: #FFFFFF;
    background: var(--navy);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 12px; font-weight: 600;
    opacity: 0; visibility: hidden;
    transform: translate(-50%, 15px);
    transition: all 0.25s ease;
    pointer-events: none;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }


/* =========================================================
   25. ORDER MODAL
========================================================= */

.order-modal {
    position: fixed; inset: 0; z-index: 5000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: orderFadeIn .2s ease;
}
.order-modal[hidden] { display: none; }

.order-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
@keyframes orderFadeIn { from { opacity: 0; } to { opacity: 1; } }

.order-modal__content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 100%; max-width: 460px;
    max-height: 92vh; overflow-y: auto;
    padding: 24px 24px 26px;
    box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .4);
    animation: orderSlideUp .3s ease;
}
@keyframes orderSlideUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.order-modal__header {
    position: relative;
    display: flex; gap: 14px; align-items: flex-start;
    padding-right: 36px; margin-bottom: 22px;
}
.order-modal__img-wrap {
    width: 72px; height: 72px; flex: 0 0 72px;
    border-radius: 14px; overflow: hidden;
    background: #F1F5F9;
}
.order-modal__img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-modal__head-text { flex: 1; min-width: 0; }

.order-modal__title {
    font-family: 'Poppins', sans-serif;
    font-size: 18px; font-weight: 800;
    color: #0F172A; line-height: 1.3; margin: 0 0 6px;
}
.order-modal__desc {
    font-size: 13px; color: #64748B; line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3; line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.order-modal__close {
    position: absolute; top: 0; right: 0;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid #E2E8F0;
    background: #fff; color: #0F172A;
    font-size: 15px; cursor: pointer;
    transition: all .2s ease;
}
.order-modal__close:hover { background: #F1F5F9; transform: rotate(5deg); }

.order-modal__label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-size: 14px; font-weight: 700;
    color: #0F172A; margin-bottom: 12px;
}

.qty-control {
    display: flex; align-items: center;
    border: 1.5px solid #E2E8F0;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 12px;
}
.qty-control__btn {
    width: 56px; height: 54px;
    border: none; background: transparent;
    font-size: 22px; font-weight: 700;
    color: #0F766E;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background .15s ease;
}
.qty-control__btn:hover  { background: #F8FAFC; }
.qty-control__btn:active { background: #E6F5F1; }

.qty-control__input {
    flex: 1; border: none; outline: none;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 22px; font-weight: 800;
    color: #0F172A; background: transparent;
    height: 54px;
    -moz-appearance: textfield;
}
.qty-control__input::-webkit-outer-spin-button,
.qty-control__input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}

.qty-presets { display: flex; gap: 8px; margin-bottom: 20px; }
.qty-preset {
    flex: 1; padding: 10px 12px;
    border-radius: 100px;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 700; font-size: 13px;
    color: #64748B; cursor: pointer;
    transition: all .15s ease;
}
.qty-preset:hover {
    border-color: #14B8A6;
    color: #0F766E;
    background: #F0FDFA;
}
.qty-preset.active {
    background: #0F766E;
    color: #fff;
    border-color: #0F766E;
}

.order-summary {
    background: #F8FAFC;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 20px;
}
.order-summary__row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0;
    font-size: 14px; color: #64748B;
}
.order-summary__row strong {
    color: #0F172A; font-weight: 700;
    font-family: 'Poppins', sans-serif;
}
.order-summary__row--total {
    border-top: 1px dashed #CBD5E1;
    margin-top: 8px; padding-top: 14px;
    font-size: 15px;
}
.order-summary__row--total strong {
    color: #0F766E;
    font-size: 22px; font-weight: 800;
}

.order-modal__cta {
    width: 100%;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px;
    background: #0F766E; color: #fff;
    padding: 16px 24px;
    border-radius: 14px;
    font-family: 'Poppins', sans-serif;
    font-size: 15px; font-weight: 800;
    border: none; cursor: pointer;
    transition: background .2s ease, transform .15s ease;
}
.order-modal__cta:hover { background: #115E59; transform: translateY(-1px); }
.order-modal__cta svg { width: 16px; height: 16px; }


/* =========================================================
   26. RESPONSIVE — TABLET
========================================================= */

@media (max-width: 1050px) {
    .courses-header { padding: 12px 3%; }
    .courses-section { padding-left: 3%; padding-right: 3%; }
    .courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .course-search { width: 220px; }
}

@media (max-width: 850px) {
    .courses-header { gap: 12px; }
    .header-right { gap: 7px; }
    .course-search { width: 190px; }
    .hero-content h1 { font-size: 38px; }
    .details-modal__content { max-width: 640px; }
}


/* =========================================================
   27. RESPONSIVE — MOBILE
========================================================= */

@media (max-width: 700px) {
    :root { --header-height: auto; }

    .courses-header {
        position: relative;
        min-height: auto;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 12px;
        padding: 11px 16px;
    }
    .brand-text span { display: none; }
    .brand-text strong { font-size: 17px; }
    .brand-icon { width: 40px; height: 40px; flex-basis: 40px; }
    .back-button { width: 39px; height: 39px; flex-basis: 39px; }
    .header-right { min-width: auto; }

    .course-search {
        position: absolute;
        left: 16px; right: 16px;
        top: 68px; width: auto; height: 42px;
        background: var(--surface);
        z-index: 5;
    }
    .courses-header { padding-bottom: 65px; }

    .courses-hero { min-height: 265px; padding: 45px 18px; }
    .hero-content h1 { font-size: 34px; letter-spacing: -1px; }
    .hero-content p { font-size: 13px; }

    .courses-section { padding: 40px 16px 55px; }
    .section-heading { align-items: center; margin-bottom: 22px; }
    .courses-grid { grid-template-columns: 1fr; gap: 18px; }
    .course-card-image { height: 200px; }
    .all-course-body { padding: 18px; }

    /* Details modal — mobile bottom sheet */
    .details-modal { padding: 0; align-items: flex-end; }
    .details-modal__content {
        border-radius: 22px 22px 0 0;
        max-width: none;
        max-height: 94vh;
    }
    .details-modal__hero { height: 180px; }
    .details-modal__title { font-size: 22px; }
    .details-modal__meta { grid-template-columns: 1fr; }
    .details-modal__buy-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .details-modal__buy-btn { width: 100%; justify-content: center; }

    /* Feedback slider on mobile — slightly narrower cards */
    .details-modal__fb-card {
        width: 250px;
    }
}


/* =========================================================
   28. RESPONSIVE — SMALL MOBILE
========================================================= */

@media (max-width: 550px) {
    .brand { gap: 8px; }
    .brand-icon { width: 38px; height: 38px; flex-basis: 38px; border-radius: var(--radius-sm); }
    .brand-text strong { font-size: 16px; }
    .hero-content h1 { font-size: 30px; }
    .hero-content h1 span { display: inline; }
    .hero-badge { font-size: 10px; }
    .section-heading h2 { font-size: 25px; }
    .course-card-image { height: 190px; }
    .view-course-button { flex: 1; }
    .details-modal__title { font-size: 20px; }
    .details-modal__body { padding: 20px 18px 22px; }
}

@media (max-width: 400px) {
    .courses-header { padding-left: 11px; padding-right: 11px; }
    .brand-text strong { font-size: 15px; }
    .brand-icon { display: none; }
    .course-search { left: 11px; right: 11px; }
    .courses-header { padding-bottom: 64px; }
    .courses-hero { padding: 40px 14px; }
    .hero-content h1 { font-size: 27px; }
    .courses-section { padding-left: 12px; padding-right: 12px; }
    .all-course-body { padding: 16px; }
    .course-card-footer { flex-direction: column; align-items: stretch; }
    .view-course-button { width: 100%; }
}


/* =========================================================
   29. ACCESSIBILITY + REDUCED MOTION
========================================================= */

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(20, 184, 166, 0.35);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}