/* ===================================================================
   STYLESHEET: Arbia HR Training - Complete Web Application
   VERSION   : 1.0
   AUTHOR    : Senior Full-Stack Developer
   =================================================================== */

/* ===== CSS CUSTOM PROPERTIES (DESIGN TOKENS) ===== */
:root {
    --color-primary:         #2F39A9;
    --color-primary-light:   #2E6FA0;
    --color-secondary:       #49A4BB;
    --color-secondary-dark:  #2E6FA0;
    --color-accent:          #15D8B3;
    --color-accent-dark:     #0fb899;
    --color-bg:              #f0f8ff;
    --color-white:           #ffffff;
    --color-text:            #1a1f4e;
    --color-text-light:      #4a5568;
    --color-border:          #c8d8e8;
    --color-border-light:    #e2ecf5;

    /* Semantic */
    --color-success:       #27ae60;
    --color-error:         #e74c3c;
    --color-warning:       #f39c12;
    --color-info:          #3498db;

    /* Typography */
    --font-primary: 'Cairo', 'IBM Plex Sans Arabic', 'Tajawal', -apple-system, sans-serif;
    --font-heading: 'Cairo', 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Layout */
    --container-max: 1400px;
    --header-height: 84px;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, button, input, select, textarea {
    font-family: var(--font-primary);
}

html {
    scroll-behavior: smooth;
    font-size: 19px;
    overflow-x: clip;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 1rem;
    color: var(--color-text);
    background: linear-gradient(160deg, #e8eeff 0%, #eef6ff 35%, #f5faff 70%, #f0f8ff 100%);
    line-height: 1.75;
    overflow-x: clip;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-secondary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.3;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

h1, h2 { font-weight: 800; }
h3, h4 { font-weight: 700; }
h5, h6 { font-weight: 600; }

h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); }
h3 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h4 { font-size: clamp(1.25rem, 2.2vw, 1.65rem); }

p {
    margin-bottom: var(--space-md);
    font-size: 1.12rem;
}

/* ===== CONTAINER ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Full-bleed container - breaks out of .container for full-width sections */
.container-full {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 0 var(--space-lg);
    max-width: none;
}

.section, section {
    padding-block: 4rem;
}

/* Theme classes removed — themes now control .panel-inner backgrounds */

/* ===== HEADER / NAVIGATION ===== */
.site-header {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(47,57,169,0.08);
    position: sticky;
    top: 0;
    z-index: 1100;
    border-bottom: 3px solid #2F39A9;
    margin-bottom: -48px;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.site-header.scrolled {
    box-shadow: 0 6px 20px rgba(10,20,30,0.12);
    border-bottom-color: var(--color-border-light);
}

.utility-bar {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border-light);
}

.utility-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 8px 0;
    gap: 16px;
}

.utility-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.utility-actions .util-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 0.9rem;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-light);
    transition: all 0.2s ease;
}

.utility-actions .util-link:hover,
.utility-actions .util-link.active {
    color: var(--color-primary);
    background-color: var(--color-bg);
}

.main-nav-bar {
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid transparent;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 6px 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: 12px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.logo-img {
    height: 48px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
}

.logo-icon {
    font-size: 1.75rem;
    color: var(--color-secondary);
}

.logo-text {
    font-family: var(--font-heading);
}

.nav-toggle {
    display: none;
    background: none;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: var(--space-sm) var(--space-md);
    font-size: 1.25rem;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-toggle:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
}

.nav-utility-clone {
    display: none !important;
}

@media (max-width: 1315px) {
    .utility-actions .util-link,
    .utility-actions .btn-yellow,
    .utility-actions .util-cart,
    .utility-actions .util-user-wrap,
    .utility-actions .util-lang {
        display: none !important;
    }
    .nav-utility-clone {
        display: flex !important;
    }
    .nav-utility-clone a {
        width: 100%;
    }
    .main-nav-bar .nav-container {
        justify-content: stretch;
        padding: 0;
    }
}

.main-nav .nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.main-nav .nav-list li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.7rem 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-light);
    transition: all 0.2s ease;
}

.main-nav .nav-list li a:hover,
.main-nav .nav-list li a.active {
    color: var(--color-primary);
    background-color: rgba(47, 57, 169, 0.07);
    border-radius: 8px;
}

.main-nav .nav-list li a.active {
    color: var(--color-primary);
    font-weight: 700;
    background: rgba(47, 57, 169, 0.1);
}

.nav-user-link {
    background-color: var(--color-bg);
    border-radius: var(--border-radius) !important;
    font-weight: 600 !important;
    color: var(--color-primary) !important;
}

.nav-logout-link {
    color: var(--color-error) !important;
}

/* ===== NAV DROPDOWNS (XAMPP version) ===== */
.nav-paths-item {
    position: relative;
}

.nav-paths-toggle {
    cursor: pointer;
}

.nav-paths-toggle .fa-chevron-down {
    transition: transform 0.2s ease;
}

.nav-paths-item:hover .nav-paths-toggle .fa-chevron-down {
    transform: rotate(180deg);
}

/* ===== NAV DROPDOWNS ===== */
.nav-paths-item {
    position: relative;
}

.paths-dropdown {
    display: none;
    position: fixed;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 260px;
    padding: var(--space-sm);
    z-index: 9999;
    max-height: 70vh;
    overflow-y: auto;
}

.paths-dropdown a {
    display: flex !important;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md) !important;
    border-radius: var(--border-radius);
    color: var(--color-text-light) !important;
    font-size: 0.95rem !important;
    transition: all 0.15s ease;
}

.paths-dropdown a:hover {
    background: var(--color-bg);
    color: var(--color-primary) !important;
}

.paths-dropdown a i {
    font-size: 0.7rem;
    color: var(--color-secondary);
}

/* ===== UPDATED: Task 2 - Open dropdown state (tap/click toggle) ===== */
.nav-paths-toggle.active .fa-chevron-down {
    transform: rotate(180deg);
}

.nav-paths-item .paths-dropdown.open {
    display: block !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    min-width: 280px;
}

/* Mobile: dropdowns stack inside the open hamburger menu */
.main-nav.nav-open .paths-dropdown.open {
    position: static !important;
    box-shadow: none;
    border: none;
    border-right: 3px solid var(--color-secondary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 4px 8px 10px;
    padding: var(--space-xs);
    max-height: none;
    overflow: visible;
}

/* ===== USER DROPDOWN ===== */
.user-dropdown {
    display: none;
    position: fixed;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    padding: var(--space-sm);
    min-width: 200px;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: flex !important;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md) !important;
    border-radius: var(--border-radius);
    color: var(--color-text-light) !important;
    font-size: 0.95rem !important;
    transition: all 0.15s ease;
}

.user-dropdown a:hover {
    background: var(--color-bg);
    color: var(--color-primary) !important;
}

.user-dropdown a i {
    width: 18px;
    color: var(--color-secondary);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: var(--space-xs) 0;
}

.dropdown-logout {
    color: var(--color-error) !important;
}

.dropdown-logout i {
    color: var(--color-error) !important;
}

/* ===== YELLOW RESERVE BUTTON ===== */
.btn-yellow {
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: var(--color-white) !important;
    border: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.btn-yellow:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(241, 39, 17, 0.35);
    color: var(--color-white) !important;
}

/* ===== CART BADGE ===== */
.nav-cart-link {
    position: relative;
    padding: 0.4rem 0.6rem !important;
    font-size: 1.1rem;
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

body.rtl-lang .cart-badge {
    right: auto;
    left: -4px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1 0 auto;
    min-height: 320px;
    padding: 0;
}

/* Pages whose content starts immediately under the sticky header (profile,
   dashboard) compensate the header's -48px overlap - the same value the site
   uses everywhere (.section-header, .programs-showcase). */
.main-content.header-offset {
    padding-top: 48px;
}

/* ===== ALERTS / FLASH MESSAGES ===== */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-lg);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert::before {
    content: '';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.alert-success::before {
    content: '\f00c';
}

.alert-error::before {
    content: '\f06a';
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #15D8B3 0%, #0fb899 100%);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.85rem 1.8rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(21, 216, 179, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0fb899 0%, #0da08a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(21, 216, 179, 0.45);
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-border);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: var(--color-accent);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background-color: var(--color-error);
    color: var(--color-white);
}

.btn-danger:hover {
    background-color: #c0392b;
    color: var(--color-white);
}

/* ===== WHATSAPP FLOATING WIDGET ===== */
.whatsapp-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    direction: ltr;
}

body.rtl-lang .whatsapp-widget {
    left: auto;
    right: 24px;
}

.whatsapp-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #0bb07a, #0f9d58);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 10px 25px rgba(6, 140, 60, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(6, 140, 60, 0.35);
}

.whatsapp-popup {
    position: absolute;
    bottom: 78px;
    left: 0;
    width: min(320px, calc(100vw - 32px));
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(20, 43, 70, 0.15);
    padding: 16px;
    display: none;
}

body.rtl-lang .whatsapp-popup {
    left: auto;
    right: 0;
}

.whatsapp-widget.open .whatsapp-popup {
    display: block;
}

.whatsapp-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-primary);
    font-weight: 700;
}

.whatsapp-popup-body p {
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.whatsapp-popup-body .form-group {
    margin-bottom: 10px;
}

.whatsapp-popup-body .form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
}

.whatsapp-popup-body .btn-primary {
    width: 100%;
    justify-content: center;
}

/* ===== HERO SLIDER - now in assets/css/hero.css ===== */

/* Gold CTA Button */
.btn-gold {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 34px;
    background: #E6A817;
    color: #111 !important;
    border: 2px solid #E6A817;
    border-radius: 4px;
    font-family: var(--font-primary);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.btn-gold:hover {
    background: #f8c24d;
    color: #111 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(230,168,23,0.35);
}

/* Secondary link */
.hero-link-secondary {
    color: #fff;
    font-size: 0.875rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.hero-link-secondary:hover {
    opacity: 1;
    color: #fff;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
}

/* ===== PROGRAMS SHOWCASE (Misk-style) ===== */
.programs-showcase {
    background: linear-gradient(135deg, #1e2a8a 0%, #2F39A9 40%, #2E6FA0 80%, #49A4BB 100%);
    padding: 48px 0 36px;
    overflow: hidden;
    position: relative;
}

/* Organic cloud-shaped bottom edge (flows directly below the section): the band
   overlaps the section's bottom edge by 2px (margin-top), so sub-pixel rounding
   can never expose a hairline gap, and it is clipped to the cloud silhouette
   (clip-path from the same-document SVG). app.js copies the section's computed
   gradient as a CSS background sized to the section's box and offset so the
   band's top lands exactly on the section's seam row (syncShowcaseBlobGradient):
   the seam is Chromium-exact with no color math. The static gradient below is
   only the no-JS fallback. */
.showcase-blob-edge {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(44px, 5vw, 70px);
    margin-top: -2px;
    z-index: 1;
    pointer-events: none;
    /* Layer 1 (top, exact): the section's gradient painted at the section's
       own box, shifted so the band's top shows the section's bottom rows
       (seam-exact by construction). Layer 2 (below): the band's own diagonal
       fill, which carries the organic lobes underneath. app.js rewrites both
       layers live via syncShowcaseBlobGradient. */
    background-image: linear-gradient(135deg, #1e2a8a 0%, #2F39A9 40%, #2E6FA0 80%, #49A4BB 100%), linear-gradient(135deg, #1e2a8a 0%, #2F39A9 40%, #2E6FA0 80%, #49A4BB 100%);
    background-size: 1440px 686px, auto;
    background-position: 0 -680px, 0 0;
    background-repeat: no-repeat, no-repeat;
    clip-path: url('#showcaseBlobClip');
}
.showcase-blob-clip {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.programs-showcase::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(21,216,179,0.15) 0%, transparent 55%),
                radial-gradient(ellipse at 10% 80%, rgba(255,255,255,0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.programs-showcase > * {
    position: relative;
    z-index: 1;
}

html[dir="rtl"] .programs-showcase {
    direction: rtl;
}

.programs-showcase .container {
    max-width: 1460px;
    margin: 0 auto;
    padding: 0 18px;
}

/* ===== THEME PANEL BACKGROUNDS (uniform blue-teal for every category) ===== */
.theme-sky .panel-inner,
.theme-red .panel-inner,
.theme-green .panel-inner {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

/* Header */
.showcase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}

.showcase-title {
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: var(--font-heading);
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
    letter-spacing: -0.01em;
}

.text-green-dark {
    color: #fff;
}

.btn-green-solid {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #15D8B3 0%, #0fb899 100%);
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    box-shadow: 0 6px 20px rgba(21, 216, 179, 0.35);
}

.btn-green-solid:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(21, 216, 179, 0.45);
    color: #fff;
}

/* Tabs: one horizontal scrollable row on every breakpoint, 2 edge arrow buttons */
.showcase-tabs-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding-top: 8px;
}

.tab-scroll-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.14);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.25s ease, opacity 0.25s ease;
}

.tab-scroll-btn:hover {
    background: rgba(255,255,255,0.28);
}

.tab-scroll-btn:disabled {
    opacity: 0.35;
    cursor: default;
    background: rgba(255,255,255,0.08);
}

.showcase-tabs {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    justify-content: flex-start;
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.showcase-tabs::-webkit-scrollbar {
    display: none;
}

.showcase-tab {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-family: var(--font-heading);
    font-size: clamp(0.9rem, 1.25vw, 1.3rem);
    font-weight: 600;
    color: rgba(255,255,255,0.82);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    text-align: center;
    flex: 0 0 auto;
    min-width: 0;
}

.showcase-tab:hover {
    color: #fff;
    background: rgba(255,255,255,0.18);
}

.showcase-tab.active {
    background: rgba(21, 216, 179, 0.25);
    color: #fff;
    font-weight: 700;
    border-bottom: 3px solid #15D8B3;
}

.theme-sky .showcase-tab.active,
.theme-red .showcase-tab.active,
.theme-green .showcase-tab.active {
    color: var(--color-primary);
}

/* Panels */
.showcase-panels {
    position: relative;
}

.showcase-panel {
    display: none;
    animation: panelFadeIn 0.45s ease;
}

.showcase-panel.active {
    display: block;
}

.showcase-panel[hidden] {
    display: none !important;
}

@keyframes panelFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Panel Inner (two-column) */
.panel-inner {
    display: flex;
    gap: 24px;
    border-radius: 18px;
    padding: 26px 22px 22px 0;
    height: clamp(345px, 42vh, 400px);
    min-height: 320px;
    overflow: visible; /* flip back face overlays downward, never clipped here */
    transition: background 0.6s ease;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    align-items: stretch;
}

/* Text Column (right in RTL) */
.panel-text-col {
    flex: 0 0 26%;
    max-width: 26%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    color: #fff;
    text-align: right;
    padding-left: 8px;
}

.panel-title {
    font-size: clamp(1.9rem, 2.6vw, 3.4rem);
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.panel-desc {
    font-size: 15px;
    color: rgba(255,255,255,0.9);
    line-height: 1.55;
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 4.65em;
    min-height: 4.65em;
    max-height: 4.65em;
}

.btn-outline-white {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.9);
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    align-self: flex-end;
    font-family: var(--font-primary);
    cursor: pointer;
    margin-top: 8px;
}

.btn-outline-white:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* Cards Column (left in RTL) */
.panel-cards-col {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: visible; /* let the grown flip back face overlay below the card row */
}

.panel-cards-title {
    display: none;
}

.panel-cards-grid {
    display: flex;
    gap: 18px;
    align-items: stretch;
    overflow-x: auto;
    /* y-overflow stays auto (required with overflow-x). The large padding-bottom
       is a paint reserve INSIDE the box so a grown flip back face overlays the
       area below the row (without pushing the nav) instead of being clipped. */
    padding-bottom: 190px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.panel-cards-grid::-webkit-scrollbar {
    display: none;
}

.panel-cards-grid .panel-card-flip {
    flex: 0 0 420px;
    min-width: 0;
    max-width: 100%;
    scroll-snap-align: start;
}

@media (max-width: 1200px) {
    .panel-cards-grid .panel-card-flip {
        flex: 0 0 420px;
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .panel-cards-grid .panel-card-flip {
        flex: 0 0 calc(66.666% - 12px);
        min-width: 0;
        max-width: 100%;
    }
}

/* Card - image fill, equal fixed height for text-only and photo cards */
.panel-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    display: block;
    text-decoration: none;
    width: 100%;
    flex-shrink: 0;
    height: 240px;
    min-height: 240px;
    background: #000;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
    cursor: pointer;
}

.panel-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(47, 57, 169, 0.18);
}

.panel-card-img {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(135deg, #2F39A9 0%, #2E6FA0 100%);
}

.panel-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14,20,32,0.08) 0%, rgba(14,20,32,0.18) 35%, rgba(14,20,32,0.72) 100%);
    z-index: 1;
}

/* UPDATED: Task 4 - optional course photo inside showcase panel card */
.panel-card-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
    transition: transform 0.3s ease;
    display: block;
}

.panel-card:hover .panel-card-photo {
    transform: scale(1.05);
}

.programs-showcase .panel-card-name {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    margin: 0;
    color: #fff;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    height: 53px;      /* exactly 2 lines: 19px x 1.4 = 26.6px/line x 2 - fixed area for all cards */
    min-height: 53px;
    max-height: 53px;
    box-sizing: border-box;
}

.programs-showcase .panel-card-overlay {
    background: linear-gradient(180deg, rgba(14,20,32,0.12) 0%, rgba(14,20,32,0.22) 38%, rgba(14,20,32,0.76) 100%);
}

.programs-showcase .status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    right: auto;
    z-index: 2;
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 18px;
}

.panel-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    background: #fff;
    direction: rtl;
    text-align: right;
}

.panel-card-body .panel-card-name {
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    position: static;
    z-index: auto;
}

.panel-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #6b7280;
    direction: rtl;
    text-align: right;
}

.panel-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-card-meta i {
    color: var(--color-secondary);
    width: 16px;
}

.panel-card-body .btn {
    margin-top: auto;
    align-self: flex-start;
}

.badge-status {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #fff;
    color: #222;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.status-badge--open {
    background-color: #16a34a;
    color: #fff;
}

.status-badge--closed {
    background-color: #dc2626;
    color: #fff;
}

.status-badge--pending {
    background-color: #f59e0b;
    color: #fff;
}

.badge-cat {
    position: absolute;
    bottom: 50px;
    right: 16px;
    background: #e8335a;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    max-width: calc(100% - 32px);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.panel-card-name {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Panel Navigation */
.panel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    position: relative;
}

.panel-arrows {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 0;
}

.arr-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    line-height: 1;
    padding: 0;
}

.arr-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}

.panel-dots {
    display: flex;
    gap: 10px;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    padding: 8px 16px;
    border-radius: 20px;
}

.theme-sky .panel-dots,
.theme-red .panel-dots,
.theme-green .panel-dots {
    background: rgba(70,111,143,0.15); /* UPDATED: Task 1 - lightened; uniform for all categories */
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
}

.dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* Tabs: single tidy row on every breakpoint; only font/padding change on tablet */
@media (max-width: 1200px) {
    .showcase-tab {
        padding: 12px 18px;
        font-size: 15px;
    }
}

/* Responsive */
@media (max-width: 991px) {
    .panel-inner {
        flex-direction: column;
        padding: 26px 16px 0;
        align-items: stretch;
        height: auto; /* column layout: let the box size to its content */
        min-height: 0;
    }
    .panel-title {
        min-height: 2.4em; /* uniform reserve for a 2-line title across categories */
    }
    .panel-text-col {
        flex: none;
        max-width: 100%;
    }
    .panel-cards-col {
        margin-top: 22px;
        padding-bottom: 16px;
        margin-left: -16px;
        padding-left: 16px;
        overflow: visible;
    }
    /* On the stacked (≤991px) layout the card row builds its own vertical room,
       so the back face keeps the default 240px + a soft clamp instead of growing. */
    .panel-cards-grid {
        padding-bottom: 6px;
    }
    .panel-card-flip .panel-card-back,
    .panel-card-flip.flipped .panel-card-back {
        height: 240px !important;
    }
    .panel-card-back-desc {
        display: -webkit-box;
        -webkit-line-clamp: 7;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .panel-title {
        font-size: 32px;
    }
    .programs-showcase .container {
        padding: 0 16px;
    }
}

@media (max-width: 576px) {
    .showcase-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    .showcase-title {
        font-size: 28px;
        text-align: center;
    }
    .btn-green-solid {
        text-align: center;
        justify-content: center;
    }
    .showcase-tabs {
        gap: 20px;
    }
    .showcase-tab {
        font-size: 16px;
    }
    .panel-inner {
        padding: 22px 12px 0;
    }
    .panel-title {
        font-size: 26px;
    }
    .panel-cards-col {
        margin-top: 18px;
        margin-left: -12px;
        padding-left: 12px;
    }
    .panel-cards-grid .panel-card-flip {
        flex: 1 0 calc(86% - 12px);
        min-width: 0;
        max-width: 100%;
    }
    .panel-card-img {
        height: 100%;
    }
    .panel-nav {
        flex-direction: column;
        gap: 12px;
    }
    .panel-arrows {
        position: static;
    }
}

/* ===== SECTION HEADERS ===== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding-top: 48px; /* يعوّض overlap الهيدر الثابت (-48px) - نفس القيمة المستخدمة في .programs-showcase */
}

.section-header h2 {
    position: relative;
    display: inline-block;
    padding-bottom: var(--space-md);
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--color-secondary);
    border-radius: 2px;
}

.section-header p {
    color: var(--color-text-light);
    max-width: 600px;
    margin: var(--space-md) auto 0;
}

/* ===== COURSE DETAIL TABS ===== */
.course-tabs-section {
    margin-top: var(--space-2xl);
}

.trainers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: start;
}

.trainer-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trainer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.trainer-card-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-height: 180px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.trainer-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.trainer-card-image-placeholder {
    color: var(--color-white);
    font-size: 2.2rem;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trainer-card-body {
    padding: 18px;
}

.trainer-card-body h4 {
    margin-bottom: 8px;
    color: var(--color-primary);
    font-size: 1.15rem;
}

.trainer-card-body p {
    margin-bottom: 10px;
    color: var(--color-text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

.trainer-feedback-section {
    margin-top: 10px;
}

.trainer-feedback-btn {
    margin-bottom: 8px;
}

.course-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.course-faq-item {
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    background: var(--color-white);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.course-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: transparent;
    border: none;
    text-align: right;
    font-weight: 700;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 1rem;
}

.course-faq-question i {
    color: var(--color-primary);
    transition: transform 0.2s ease;
}

.course-faq-answer {
    display: none;
    padding: 0 18px 18px;
    color: var(--color-text-light);
    line-height: 1.8;
}

.course-faq-item.open .course-faq-answer {
    display: block;
}

.course-faq-item.open .course-faq-question i {
    transform: rotate(180deg);
}

.course-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--space-lg);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
}

.course-tab-btn {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    color: var(--color-primary);
    padding: 0.7rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.course-tab-btn.active {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.course-tab-pane {
    display: none;
    white-space: pre-line;
}

.course-tab-pane.active {
    display: block;
}

.course-tab-pane[hidden] {
    display: none !important;
}

/* ===== COURSE CARDS GRID ===== */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: var(--space-2xl);
}

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

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

.featured-programs-section {
    padding: 60px 0 20px;
}

.featured-programs-section .section-header {
    text-align: right;
    margin-bottom: 28px;
    padding: 0 4px;
}

.featured-programs-section .section-header h2 {
    font-size: clamp(2rem, 2.8vw, 3rem);
    color: var(--color-primary);
    margin: 0 0 10px;
    font-weight: 800;
    line-height: 1.3;
}

.featured-programs-section .section-header p {
    color: rgba(17, 24, 39, 0.7);
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
}

.featured-programs-section .courses-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 20px;
}

.featured-programs-section .course-card {
    background: var(--color-white);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.featured-programs-section .course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(47, 57, 169, 0.15);
    border-color: rgba(21, 216, 179, 0.35);
}

.featured-programs-section .program-card__image {
    aspect-ratio: 16 / 11;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(135deg, rgba(47, 57, 169, 0.12), rgba(46, 111, 160, 0.08));
}

.featured-programs-section .program-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-programs-section .course-card-image {
    aspect-ratio: 16 / 11;
    border-radius: 18px 18px 0 0;
}

.featured-programs-section .course-card-body {
    padding: 18px 18px 16px;
    gap: 10px;
}

.featured-programs-section .program-card__title {
    font-size: 1.05rem;
    line-height: 1.5;
    font-weight: 800;
    margin: 0;
    color: var(--color-primary);
}

.featured-programs-section .course-card-body h3 {
    margin: 0;
}

.featured-programs-section .course-card-body p {
    color: rgba(17, 24, 39, 0.72);
    font-size: 0.9rem;
    line-height: 1.75;
    margin: 0;
}

.featured-programs-section .course-card-meta {
    margin-top: 2px;
    gap: 6px;
    font-size: 0.83rem;
    color: rgba(17, 24, 39, 0.68);
}

.course-card-trainer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 10px;
}

.course-card-trainer__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 2px solid var(--color-border-light);
}

.course-card-trainer__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.course-card-trainer__avatar i {
    font-size: 1.15rem;
    color: var(--color-secondary);
}

.course-card-trainer__name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.featured-programs-section .course-card-footer {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.featured-programs-section .course-card-footer .btn {
    background: linear-gradient(135deg, #2F39A9, #2E6FA0);
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(47, 57, 169, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-programs-section .course-card-footer .btn:hover {
    background: linear-gradient(135deg, #15D8B3, #0fb899);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(21, 216, 179, 0.35);
}

@media (max-width: 1200px) {
    .featured-programs-section .courses-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .featured-programs-section .courses-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== FEATURED PROGRAMS - subtle living background =====
   Blurred floating bubbles distributed over the WHOLE section. The bubble layer
   (.featured-programs-bubbles) is a dedicated wrapper sized with inset:0, so it
   always spans the section's full height dynamically — if the grid grows (more
   course cards) the layer stretches with it and every bubble keeps its
   proportional position (top/left are percentages). Pale blue/teal tints, low
   opacity, strictly behind the content (z-index 0 vs content z-index 1).
   transform+opacity only, so the compositor handles the float cheaply on
   desktop; static on mobile (same convention as the CTA sections). */
.featured-programs-section {
    position: relative;
    overflow: hidden;
}

.featured-programs-section .featured-programs-bubbles {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

.featured-programs-bubbles span {
    position: absolute;
    top: var(--bt);
    left: var(--bl);
    width: var(--bs);
    height: var(--bs);
    margin-top: calc(var(--bs) / -2);
    margin-left: calc(var(--bs) / -2);
    border-radius: 50%;
    filter: blur(3px);
    will-change: transform;
    animation: featuredFloat var(--bd) ease-in-out infinite;
    animation-delay: var(--bdl);
}

.featured-programs-bubbles span.b--indigo {
    background: radial-gradient(circle at 35% 35%, rgba(47, 57, 169, 0.10), rgba(47, 57, 169, 0.03) 60%, transparent 72%);
}

.featured-programs-bubbles span.b--teal {
    background: radial-gradient(circle at 60% 40%, rgba(21, 216, 179, 0.12), rgba(21, 216, 179, 0.04) 55%, transparent 70%);
}

.featured-programs-section > * {
    position: relative;
    z-index: 1;
}

@keyframes featuredFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-16px) scale(1.05);
    }
}

/* Accessibility: kill the endless float for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
    .featured-programs-bubbles span {
        animation: none;
    }
}

/* Continuous float stays desktop-only (same convention as the CTA sections).
   On phones the blurred circles are kept but frozen. */
@media (max-width: 768px) {
    .featured-programs-bubbles span {
        animation: none;
    }
}

/* ===== PAGE BUBBLES - shared full-viewport living background =====
   Same bubble geometry, tints and keyframe as .featured-programs-bubbles,
   but scoped to .bg-bubbles so any page can opt in by setting $pageBubbles
   in PHP (header.php injects the layer as the first child of <main>).
   Because <main> gets .has-bg-bubbles (position:relative), the layer's
   inset:0 spans the whole main area - from just under the header to just
   above the footer - regardless of page length. `.bg-bubbles ~ *` lifts the
   following .container (and everything inside it) onto z-index:1 so the
   bubbles strictly stay behind the content. overflow:hidden clips edge
   bubbles so they can never cause horizontal page scroll. */
.main-content.has-bg-bubbles {
    position: relative;
}

.bg-bubbles {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-bubbles ~ * {
    position: relative;
    z-index: 1;
}

.bg-bubbles span {
    position: absolute;
    top: var(--bt);
    left: var(--bl);
    width: var(--bs);
    height: var(--bs);
    margin-top: calc(var(--bs) / -2);
    margin-left: calc(var(--bs) / -2);
    border-radius: 50%;
    filter: blur(3px);
    will-change: transform;
    animation: featuredFloat var(--bd) ease-in-out infinite;
    animation-delay: var(--bdl);
}

.bg-bubbles span.b--indigo {
    background: radial-gradient(circle at 35% 35%, rgba(47, 57, 169, 0.10), rgba(47, 57, 169, 0.03) 60%, transparent 72%);
}

.bg-bubbles span.b--teal {
    background: radial-gradient(circle at 60% 40%, rgba(21, 216, 179, 0.12), rgba(21, 216, 179, 0.04) 55%, transparent 70%);
}

/* Accessibility: kill the endless float for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
    .bg-bubbles span {
        animation: none;
    }
}

/* Continuous float stays desktop-only; frozen on phones (battery/CPU). */
@media (max-width: 768px) {
    .bg-bubbles span {
        animation: none;
    }
}

.course-card {
    background: var(--color-white);
    border: 1px solid rgba(47, 57, 169, 0.1);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(47, 57, 169, 0.06);
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(47, 57, 169, 0.15);
    border-color: rgba(21, 216, 179, 0.3);
}

.program-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}
.program-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-details__hero-image {
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    max-height: 450px;
    margin: 0 auto var(--space-lg);
    background-color: #f4f4f4;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-details__hero-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.course-card-image {
    aspect-ratio: 16 / 9;
    height: auto;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.course-card-image i {
    font-size: 3rem;
    color: rgba(255,255,255,0.3);
}

.course-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.course-card-category {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background-color: var(--color-secondary);
    color: var(--color-white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.course-card-body {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-card-body h3 {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: var(--space-sm);
    font-weight: 700;
}

.program-card__title {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 700;
}

.course-card-body h3 a {
    color: var(--color-primary);
}

.course-card-body h3 a:hover {
    color: var(--color-secondary);
}

.course-card-body p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    flex: 1;
    margin-bottom: var(--space-md);
}

.course-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    margin-bottom: var(--space-md);
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.program-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.course-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.course-card-meta i {
    color: var(--color-secondary);
    width: 16px;
}

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

/* ===== UPDATED: Task 4 - Trainers page: circular photo (120px) + LinkedIn ===== */
.trainers-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.trainers-page-grid .trainer-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.trainers-page-grid .trainer-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(47, 57, 169, 0.15);
    border-color: rgba(21, 216, 179, 0.3);
}

.trainer-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 24px 16px 8px;
}

.trainer-photo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.trainer-avatar {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border: 3px solid var(--color-border-light);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trainer-avatar i {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.95);
}

.trainer-body {
    padding: var(--space-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.trainer-body h3 {
    font-size: 1.15rem;
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.trainer-specialization {
    color: var(--color-success);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.trainer-specialization i {
    font-size: 0.85rem;
}

.trainer-bio {
    color: var(--color-text-light);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

.trainer-linkedin {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-white);
    background: #0a66c2;
    padding: 6px 14px;
    border-radius: 50px;
    transition: background 0.25s ease;
}

.trainer-linkedin:hover {
    background: #004182;
    color: var(--color-white);
}

/* Trainers grid: 2 columns on tablets, 1 on phones */
@media (max-width: 768px) {
    .trainers-page-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .trainers-page-grid {
        grid-template-columns: 1fr;
    }
}

.course-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
}

.course-price small {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--color-text-light);
}

/* ===== STATS SECTION (Misk-style: big number + small label) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: 48px 0;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.stat-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 24px 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-item i {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
    opacity: 0.7;
}

.stat-item h3 {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--color-primary);
    line-height: 1.1;
    font-family: var(--font-heading);
}

.stat-item p {
    color: var(--color-text-light);
    font-size: 14px;
    margin-bottom: 0;
    font-weight: 400;
}

/* ===== FORMS ===== */
.form-container {
    max-width: 520px;
    margin: 0 auto;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-sm);
}

.form-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.form-title i {
    font-size: 2.5rem;
    color: var(--color-secondary);
    margin-bottom: var(--space-sm);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    font-size: 0.9rem;
    color: var(--color-primary);
}

.form-group label .required {
    color: var(--color-error);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--color-text);
    background-color: var(--color-white);
    transition: border-color 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.form-control.error {
    border-color: var(--color-error);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: var(--color-error);
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.form-error.visible {
    display: block;
}

.form-footer {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.form-footer a {
    font-weight: 600;
}

/* ===== AUTH PAGES (login / register / forgot) — split-screen card ===== */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 0;
    max-width: 1020px;
    /* 48px of margin-top compensates the sticky header's -48px overlap, so the
       shell floats ~48px below it; margin-bottom keeps the same gap to footer. */
    margin: 96px auto 48px;
    border-radius: 24px;
    overflow: hidden;
    background: var(--color-white);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.auth-brand {
    position: relative;
    padding: var(--space-3xl) var(--space-2xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    background:
        radial-gradient(circle at 20% 15%, rgba(21, 216, 179, 0.35) 0, rgba(21, 216, 179, 0) 34%),
        radial-gradient(circle at 85% 85%, rgba(21, 216, 179, 0.22) 0, rgba(21, 216, 179, 0) 40%),
        linear-gradient(160deg, #1a2280 0%, #2F39A9 55%, #1e5a8a 100%);
    overflow: hidden;
    text-align: left;
}

/* subtle geometric pattern on the brand panel */
.auth-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 46px 46px;
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(21, 216, 179, 0.35) 0, rgba(21, 216, 179, 0) 70%);
}

.auth-brand-inner {
    position: relative;
    z-index: 2;
    max-width: 380px;
}

.auth-brand .auth-brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.auth-brand .auth-brand-logo img {
    height: 54px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

.auth-brand .auth-brand-logo span {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.auth-brand h3 {
    color: #fff;
    font-size: 1.7rem;
    line-height: 1.35;
    margin-bottom: var(--space-md);
}

.auth-brand p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.9;
    margin-bottom: var(--space-xlg, 2rem);
}

.auth-brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.auth-brand-list li {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.98rem;
    font-weight: 500;
    color: #fff;
}

.auth-brand-list li i {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(21, 216, 179, 0.18);
    color: var(--color-accent);
    font-size: 1rem;
}

.auth-card {
    padding: var(--space-3xl) var(--space-2xl);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--color-white);
}

/* The form-container inside the split card becomes a plain layout (no nested box) */
.auth-card .form-container {
    max-width: none;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 560px;
        /* Same header -48px compensation; on small screens keep the visible
           top/bottom gaps tight (~20px) so vertical space is not wasted. */
        margin: 68px auto 20px;
    }

    .auth-brand {
        display: none;
    }

    .auth-card {
        padding: var(--space-2xl) var(--space-lg);
    }
}

.contact-form-card .form-title i {
    display: block;
    text-align: center;
}

.admin-main .admin-page-shell {
    max-width: 980px;
    margin: 0 auto;
}

.admin-main .admin-form-shell {
    max-width: 980px;
}

.admin-main .admin-section-card,
.admin-main .table-container,
.admin-main .form-container {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.admin-main .admin-section-card {
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
}

.admin-main .admin-section-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-sm);
}

.admin-main .admin-section-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
}

.admin-main .admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

.admin-main .admin-inline-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: stretch;
    flex-wrap: wrap;
}

.admin-main .admin-inline-actions .form-control {
    flex: 1 1 240px;
}

.admin-main .admin-upload-inline {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-main .lang-switcher {
    display: flex;
    gap: 0;
    margin-bottom: var(--space-lg);
    border-bottom: 2px solid var(--color-border-light);
}

.admin-main .lang-tab {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border: 1px solid var(--color-border-light);
    border-bottom: none;
    background: #f7f9fc;
    color: var(--color-text-light);
    padding: 0.7rem 1.25rem;
    font-weight: 700;
}

.admin-main .lang-tab.active {
    background: #ffffff;
    color: var(--color-primary);
    box-shadow: inset 0 -2px 0 var(--color-accent);
}

.admin-main .editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.6rem;
    background: #f8fafc;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-bottom: -1px;
}

.admin-main .editor-btn {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-white);
    color: var(--color-primary);
    padding: 0.35rem 0.55rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.admin-main .editor-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.admin-main .preview-image {
    max-width: 200px;
    border-radius: 10px;
    border: 1px solid var(--color-border-light);
    padding: 0.35rem;
    background: var(--color-white);
    margin-top: 0.5rem;
}

.admin-main .faq-item,
.admin-main .trainer-item,
.admin-main .dynamic-tab-item {
    background: linear-gradient(135deg, rgba(78, 193, 240, 0.06) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(78, 193, 240, 0.22);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.admin-main .admin-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 43, 70, 0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.admin-main .admin-modal-card {
    background: var(--color-white);
    padding: var(--space-lg);
    border-radius: var(--border-radius-lg);
    max-width: 430px;
    width: 100%;
    box-shadow: 0 16px 50px rgba(20, 43, 70, 0.2);
}

.admin-main .admin-modal-card h3 {
    margin-bottom: var(--space-md);
}

.admin-main .filter-form,
.admin-main form[method="GET"] {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    align-items: end;
}

.admin-main .filter-form .form-control,
.admin-main form[method="GET"] .form-control {
    min-width: 180px;
}

/* ===== TABLE STYLES (Dashboard) ===== */
.table-container {
    overflow-x: auto;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead {
    background-color: var(--color-primary);
    color: var(--color-white);
}

thead th {
    padding: var(--space-md) var(--space-lg);
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

tbody td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: var(--color-bg);
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-icon.green {
    background-color: rgba(46, 204, 113, 0.15);
    color: var(--color-success);
}

.stat-card-icon.blue {
    background-color: rgba(52, 152, 219, 0.15);
    color: var(--color-info);
}

.stat-card-icon.orange {
    background-color: rgba(243, 156, 18, 0.15);
    color: var(--color-warning);
}

.stat-card-icon.red {
    background-color: rgba(231, 76, 60, 0.15);
    color: var(--color-error);
}

.stat-card-info h3 {
    font-size: 1.75rem;
    margin-bottom: 2px;
}

.stat-card-info p {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
    color: var(--color-text-light);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: var(--space-lg);
}

.empty-state h3 {
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

/* ===== COURSE PREVIEW ===== */
.preview-banner {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.preview-shell {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.preview-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 1rem;
}

.preview-pill {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(20, 43, 70, 0.08);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.preview-price-card {
    min-width: 180px;
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    background: #f8fbff;
}

.preview-price {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--color-primary);
}

.preview-old-price {
    color: var(--color-text-light);
    text-decoration: line-through;
    margin-top: 0.25rem;
}

.preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.preview-meta i {
    margin-left: 0.25rem;
    color: var(--color-secondary);
}

.preview-block {
    padding: 1rem 0;
    border-top: 1px solid var(--color-border-light);
}

.preview-html {
    color: var(--color-text);
    white-space: pre-line;
}

.preview-html p,
.preview-html ul,
.preview-html ol {
    margin-bottom: 0.75rem;
}

.preview-list {
    display: grid;
    gap: 0.75rem;
}

.preview-list-item {
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    padding: 0.85rem 1rem;
    background: #fbfdff;
}

.preview-list-item p {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .preview-hero {
        flex-direction: column;
    }

    .preview-price-card {
        width: 100%;
        min-width: 0;
    }
}

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-approved {
    background-color: #d4edda;
    color: #155724;
}

.badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.badge-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-active {
    background-color: #d4edda;
    color: #155724;
}

.badge-offer {
    background-color: #dc2626;
    color: #ffffff;
}

/* Sale starburst badge — overlaid on the card image beside the offer price */
.offer-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    width: 124px;
    height: 124px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 14px;
    text-align: center;
    color: #ffffff;
    background: radial-gradient(circle at 50% 42%, #e5342b 0%, #dc2626 55%, #b91c1c 100%);
    clip-path: polygon(100.0% 50.0%, 81.9% 41.5%, 93.3% 25.0%, 73.3% 26.7%, 75.0% 6.7%, 58.5% 18.1%, 50.0% 0.0%, 41.5% 18.1%, 25.0% 6.7%, 26.7% 26.7%, 6.7% 25.0%, 18.1% 41.5%, 0.0% 50.0%, 18.1% 58.5%, 6.7% 75.0%, 26.7% 73.3%, 25.0% 93.3%, 41.5% 81.9%, 50.0% 100.0%, 58.5% 81.9%, 75.0% 93.3%, 73.3% 73.3%, 93.3% 75.0%, 81.9% 58.5%);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
    transform: rotate(-6deg);
    line-height: 1.15;
}

.offer-badge__label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    opacity: 0.95;
}

.offer-badge__price {
    font-size: 20px;
    font-weight: 900;
    white-space: nowrap;
}

.offer-badge__old {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    white-space: nowrap;
}

.badge-inactive {
    background-color: #e2e3e5;
    color: #383d41;
}

/* ===== CONTACT PAGE ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.contact-info-item i {
    width: 44px;
    height: 44px;
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--color-secondary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.contact-info-item h4 {
    margin-bottom: 2px;
    font-size: 1rem;
}

.contact-info-item p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ===== CONTACT PAGE bottom spacing (form card vs footer) ===== */
.contact-grid {
    align-items: stretch;
    margin-bottom: var(--space-2xl);
}

.contact-grid > div {
    display: flex;
    flex-direction: column;
    /* every column reserves equal bottom breathing room before the footer */
    padding-bottom: var(--space-xl);
}

/* Push the Important-Links block down so both columns end at a comparable
   distance above the footer (matches the form card's bottom edge). */
.contact-grid > div:first-child .contact-links-block {
    margin-top: auto;
}

/* The contact form gets a distinct elevated card so it doesn't blend with
   the page background (replaces the old flat/transparent box). Explicit
   width+max-width override the fit-content sizing the auto horizontal margins
   produce inside the flex column, so the card reaches a comfortable ~440px
   (up to the column/cell width) while staying centered with a clear gap to
   the neighbouring info column. */
.contact-grid .form-container.contact-form-card {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    padding: var(--space-2xl);
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.course-hero {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 32px;
}

.course-hero__info {
    flex: 1 1 55%;
    min-width: 0;
}

.course-hero__image {
    flex: 1 1 45%;
    max-width: 500px;
}

.course-hero__image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: 8px;
    background-color: #f4f4f4;
}

.course-hero__info:only-child {
    flex: 1 1 100%;
    max-width: 100%;
}

.course-hero__title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.course-hero__desc {
    font-size: 16px;
    color: #4b5563;
    margin-bottom: 16px;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .course-hero {
        flex-direction: column;
    }
    .course-hero__image {
        max-width: 100%;
        order: -1;
    }
}

.review-stars,
.rating-stars,
.star-rating {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ===== COURSE DETAIL PAGE ===== */
.course-detail-header {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.course-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.course-detail-meta-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.course-detail-meta-item i {
    color: var(--color-secondary);
    width: 20px;
}

.course-detail-body {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    padding: var(--space-2xl);
    line-height: 1.9;
}

.course-detail-body h2,
.course-detail-body h3 {
    margin-top: var(--space-xl);
}

.course-detail-body ul,
.course-detail-body ol {
    padding-right: var(--space-xl);
    margin-bottom: var(--space-md);
    list-style: disc;
}

.course-detail-body li {
    margin-bottom: var(--space-sm);
}

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-md));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: calc(100% - var(--space-xl) * 2);
    max-width: 480px;
}

.toast {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
    animation: toastIn 0.3s ease forwards;
}

.toast-success { border-right: 4px solid var(--color-success); }
.toast-error   { border-right: 4px solid var(--color-error); }
.toast-info    { border-right: 4px solid var(--color-info); }

.toast i { font-size: 1.1rem; }
.toast-success i { color: var(--color-success); }
.toast-error i   { color: var(--color-error); }
.toast-info i    { color: var(--color-info); }

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ===== RESPONSIVE ===== */

/* Tablet: 768px and below */
@media (max-width: 768px) {
    :root {
        --container-max: 100%;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        padding: var(--space-md);
        transform: translateY(-120%);
        opacity: 0;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .main-nav.nav-open {
        transform: translateY(0);
        opacity: 1;
    }

    .main-nav .nav-list {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .main-nav .nav-list li a {
        padding: var(--space-md);
        border-radius: var(--border-radius);
        width: 100%;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: var(--space-lg);
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .programs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .program-tab {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* Phone: 480px and below */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-md);
    }

    .btn-gold {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .hero-link-secondary {
        font-size: 0.8rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }

    .hero-actions .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .members-and-growing-section {
        flex-direction: column;
        padding: 32px 6vw;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        border-radius: 0;
    }

    .members-and-growing-section .mag-stat {
        padding: 20px 16px;
        text-align: center;
    }

    .members-and-growing-section .mag-stat + .mag-stat {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.12);
    }

    html[dir="rtl"] .members-and-growing-section .mag-stat + .mag-stat {
        border-right: none;
        border-top: 1px solid rgba(255,255,255,0.12);
    }

    .members-and-growing-section .mag-stat .number {
        font-size: 28px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .course-card-meta {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .course-detail-header {
        padding: var(--space-lg);
    }

    .programs-showcase .container {
        padding: 0 16px;
    }

    .programs-grid {
        grid-template-columns: 1fr;
    }

    .programs-tabs {
        gap: var(--space-xs);
    }

    .program-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .program-card-image {
        height: 150px;
    }

    table {
        font-size: 0.8rem;
    }

    thead th,
    tbody td {
        padding: var(--space-sm) var(--space-md);
    }
}

/* ===== FOOTER ===== */
.site-footer {
    background: linear-gradient(135deg, #1a2280 0%, #2F39A9 50%, #1e5a8a 100%);
    color: rgba(255,255,255,0.85);
    margin-top: 0;
    border-top: 3px solid rgba(21, 216, 179, 0.4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-2xl);
    padding: var(--space-3xl) 0;
}

.footer-col {
    margin-top: 12px;
}

.footer-heading {
    color: var(--color-white);
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
    position: relative;
    padding-bottom: var(--space-sm);
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 2px;
    background-color: var(--color-secondary);
}

.footer-text {
    font-size: 0.9rem;
    line-height: 1.8;
    opacity: 0.8;
}

.footer-links li,
.footer-contact li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: var(--color-secondary);
    padding-right: 5px;
}

.footer-links i {
    font-size: 0.7rem;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: 0.9rem;
}

.footer-contact i {
    margin-top: 4px;
    color: var(--color-secondary);
    width: 16px;
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    background-color: rgba(255,255,255,0.1);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.footer-social a:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.footer-newsletter-text {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: var(--space-sm);
}

.footer-newsletter {
    display: flex;
    gap: 0;
}

.footer-newsletter input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    outline: none;
}

.footer-newsletter button {
    padding: 0.65rem 1rem;
    border: none;
    background-color: var(--color-secondary);
    color: var(--color-white);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.footer-newsletter button:hover {
    background-color: var(--color-secondary-dark);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: var(--space-lg) 0;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

.footer-bottom p {
    margin-bottom: 0;
}

/* ===== MEMBERS AND GROWING (Misk-style) ===== */
.members-and-growing-section {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 56px 6vw;
    background: linear-gradient(135deg, #2F39A9 0%, #2E6FA0 60%, #49A4BB 100%);
    border-radius: 0;
    max-width: none;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    overflow: hidden;
    position: relative;
}

.members-and-growing-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.members-and-growing-section .mag-stat {
    flex: 1 1 0;
    text-align: center;
    padding: 32px 20px;
    position: relative;
}

.members-and-growing-section .mag-stat + .mag-stat {
    border-left: 1px solid rgba(255,255,255,0.12);
}

html[dir="rtl"] .members-and-growing-section .mag-stat + .mag-stat {
    border-left: none;
    border-right: 1px solid rgba(255,255,255,0.12);
}

.members-and-growing-section .mag-stat .number {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    line-height: 1;
    color: #fff;
    font-family: var(--font-heading);
    margin-bottom: 8px;
    display: block;
}

.members-and-growing-section .mag-stat .label {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    font-weight: 400;
}

/* ===== WIDER SHOWCASE (card-level tweaks) ===== */
.programs-showcase .panel-cards-grid {
    gap: 18px;
}

.programs-showcase .panel-card {
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    border-radius: 14px;
}

.programs-showcase .panel-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(10,20,30,0.15);
}

/* ===== SHOWCASE 3D FLIP =====
   The front face is the exact same .panel-card as before (visual untouched).
   The back face shows a real blurb (short_description / short_description_ar from the
   courses table) + an "استكشف البرنامج" button that navigates to course-details.php.
   Desktop: CSS :hover flip. Touch: JS toggles .flipped (first tap flips, second navigates). */
.panel-card-flip {
    height: 240px;
    min-height: 240px;
    perspective: 1400px;
    cursor: pointer;
}

.panel-card-flip-inner {
    position: relative;
    width: 100%;
    height: 240px;
    min-height: 240px;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.panel-card-flip.flipped .panel-card-flip-inner {
    transform: rotateY(180deg);
}

@media (hover: hover) and (pointer: fine) {
    .panel-card-flip:hover .panel-card-flip-inner {
        transform: rotateY(180deg);
    }
}

.panel-card-front,
.panel-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.panel-card-front {
    height: 240px;
    min-height: 240px;
}

.panel-card-back {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px 20px;
    text-align: center;
    border-radius: 14px;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 16px 40px rgba(47,57,169,0.25);
    overflow: hidden;
    /* top/left/right fixed, height animates via --back-h so a long blurb makes
       the back face grow (overlaying neighbours via absolute positioning) with the
       same 0.55s timing as the flip itself; --back-h is set by JS. */
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    height: 240px;
    transition: height 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
    z-index: 30;
}

.panel-card-flip:hover .panel-card-back,
.panel-card-flip.flipped .panel-card-back {
    height: var(--back-h, 240px);
}

.panel-card-back-veil {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 32, 0.32);
    z-index: 0;
}

.panel-card-back-desc {
    position: relative;
    z-index: 1;
    margin: 0;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.8;
    color: rgba(255,255,255,0.95);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.card-explore-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: #101838;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(10, 20, 30, 0.20);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-explore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(10, 20, 30, 0.28);
}

@media (prefers-reduced-motion: reduce) {
    .panel-card-flip-inner {
        transition: none;
    }
    .panel-card-back {
        transition: none;
    }
}

/* ===== CTA TICKET SECTION ===== */
/* Subtle living background: the blurred circles keep a slow float loop, and
   every colour change on hover eases over ~0.5s (never jumps). animations/pseudo
   keep to transform+opacity so the compositor handles them cheaply. */
.cta-ticket {
    position: relative;
    width: 100vw;
    margin: 0 calc(50% - 50vw);
    padding: 0;
    overflow: hidden;
    border-top: 0;
    border-bottom: 0;
    background: linear-gradient(90deg, #023f39 0%, #0a5d52 35%, #0e6d5f 65%, #0a564d 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
    transition: background 0.5s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.5s ease, transform 0.35s ease;
}

.cta-ticket:hover {
    background: linear-gradient(90deg, #0a4338 0%, #0f5f4d 18%, #a77e1a 42%, #d4ae3f 68%, #f4dd79 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 10px 28px rgba(143, 109, 25, 0.18);
}

.cta-ticket::before,
.cta-ticket::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    filter: blur(2px);
    transition: background 0.5s ease, box-shadow 0.5s ease, opacity 0.5s ease;
    animation: ctaFloat 10s ease-in-out infinite;
    will-change: transform;
}

.cta-ticket::before {
    right: 9%;
    bottom: -90px;
    animation-duration: 11s;
    animation-delay: -4s; /* phase-shift the two circles so they never move in sync */
}

.cta-ticket::after {
    left: 8%;
    top: -90px;
    animation-duration: 9s;
}

@keyframes ctaFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-16px) scale(1.05);
    }
}

.cta-ticket:hover::before,
.cta-ticket:hover::after {
    background: rgba(255,255,255,0.11);
    box-shadow: 0 0 30px rgba(255,255,255,0.16);
}

/* Gentle speed-up of the float while the pointer is over the section */
.cta-ticket:hover::before {
    animation-duration: 6.5s;
}

.cta-ticket:hover::after {
    animation-duration: 5.5s;
}

.cta-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 54px 32px 58px;
    text-align: center;
}

.cta-inner h2 {
    margin: 0 0 28px;
    color: #fff;
    font-size: clamp(2.2rem, 3vw, 4.1rem);
    line-height: 1.4;
    font-weight: 700;
    max-width: 1000px;
    font-family: var(--font-primary);
}

.cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 200px;
    padding: 14px 26px;
    border-radius: 12px;
    background: rgba(88, 181, 164, 0.25);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: transform 0.35s ease, background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    background: rgba(88, 181, 164, 0.35);
    border-color: #fff;
    box-shadow: 0 8px 20px rgba(8, 56, 49, 0.35);
}

.cta-btn-outline {
    background: rgba(122, 202, 191, 0.2);
    border-color: rgba(255,255,255,0.72);
}

.cta-btn-outline:hover {
    background: rgba(122, 202, 191, 0.3);
    border-color: #fff;
    box-shadow: 0 8px 20px rgba(8, 56, 49, 0.3);
}

/* ===== TESTIMONIALS SECTION ===== */
.testimonials-section {
    position: relative;
    padding: 0 0 90px;
    background: transparent;
    overflow: hidden;
}

.testimonials-section::before,
.testimonials-section::after {
    display: none;
}

.testimonials-section .container {
    max-width: 1460px;
    position: relative;
    z-index: 1;
}

.testimonials-section .section-header {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 36px;
    margin-top: 40px;
}

.testimonials-section .section-header h2 {
    position: relative;
    display: block;
    font-size: clamp(2rem, 3vw, 3.2rem);
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.2;
    margin: 0;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    text-align: center;
}

.testimonials-section .section-header h2::after {
    content: "";
    display: none;
}

.testimonials-section .section-header .text-green-dark {
    color: var(--color-secondary);
}

.testimonials-section .section-header p {
    display: block;
    max-width: 680px;
    margin: 14px auto 0;
    color: var(--color-text-light);
    font-size: 1rem;
    line-height: 1.75;
}

/* ===== Testimonials carousel (unified Misk-style, one view per slide) ===== */
.testimonials-carousel {
    position: relative;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-areas:
        "prev viewport next"
        "footer footer footer";
    grid-template-columns: auto minmax(0, 760px) auto;
    align-items: center;
    gap: 20px;
}

.testimonials-prev {
    grid-area: prev;
}

.testimonials-viewport {
    grid-area: viewport;
    min-width: 0;
    overflow: hidden;
    border-radius: 22px;
}

.testimonials-track {
    display: flex;
    direction: ltr; /* predictable order for translateX on both page directions */
    align-items: stretch; /* every slide stretches to the tallest one -> equal heights, never clipped */
    transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

.testimonials-slide {
    flex: 0 0 100%;
    min-width: 0;
    display: flex;
}

/* Restore RTL text flow inside cards on Arabic pages */
html[dir="rtl"] .testimonial-card {
    direction: rtl;
}

.testimonial-card {
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: 22px;
    padding: clamp(26px, 3.5vw, 42px) clamp(24px, 4vw, 48px);
    min-height: clamp(340px, 36vh, 390px);
    box-shadow: 0 12px 30px rgba(26, 31, 78, 0.06);
    transition: box-shadow 0.25s ease;
}

.testimonial-card:hover {
    box-shadow: 0 16px 38px rgba(26, 31, 78, 0.1);
}

.testimonial-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(21, 216, 179, 0.14);
    color: var(--color-accent-dark);
    font-size: 1.1rem;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.testimonial-text {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.9;
    color: var(--color-text);
    font-weight: 500;
}

.testimonial-stars {
    display: flex;
    gap: 3px;
    font-size: 0.95rem;
    margin-top: 16px;
}

.testimonial-meta {
    margin-top: auto;
    padding-top: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.testimonial-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--color-border-light);
    background: var(--color-border-light);
}

.testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.testimonial-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--color-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.05rem;
}

.testimonial-id {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.testimonial-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.4;
}

.testimonial-role {
    font-size: 0.85rem;
    color: var(--color-text-light);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.testimonials-nav {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-primary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.testimonials-nav:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.testimonials-next {
    grid-area: next;
}

.testimonials-footer {
    grid-area: footer;
    text-align: center;
    align-self: center;
}

.testimonials-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: 1rem;
    color: var(--color-text-light);
    font-weight: 500;
    /* Numbers must always read left-to-right: "1 / 7", even on RTL pages
       (without this, the rtl inline-flex visually reverses to "7 / 1"). */
    direction: ltr;
}

.testimonials-counter span {
    min-width: 18px;
    text-align: center;
}

#testimonialsCounterCurrent {
    color: var(--color-primary);
    font-weight: 800;
    font-size: 1.15rem;
}

.testimonials-counter-sep {
    color: var(--color-border);
    font-weight: 700;
}

@media (max-width: 640px) {
    .testimonials-carousel {
        gap: 10px;
    }
    .testimonials-nav {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
    .testimonial-card {
        min-height: 430px;
        padding: 26px 20px;
    }
    .testimonial-quote {
        width: 44px;
        height: 44px;
        margin-bottom: 16px;
    }
}

@media (max-width: 576px) {
    .testimonials-carousel {
        grid-template-areas:
            "viewport viewport viewport"
            "prev     footer   next";
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 16px 10px;
    }
}

/* ===== UPDATED: Task 5 - Responsive refinements ===== */
@media (max-width: 768px) {
    /* Logo: hide long site-name text, cap image height */
    .logo-text {
        display: none;
    }
    .logo-img {
        max-height: 45px;
        height: auto;
    }

    /* Paths/showcase tabs: scrollable strip (already single row on desktop) */
    .showcase-tabs-wrap {
        margin-bottom: 28px;
    }
    .showcase-tab {
        min-height: 44px;
        padding: 12px 16px;
        font-size: 16px;
    }

    /* 44px tap targets on touch devices */
    .arr-btn {
        width: 44px;
        height: 44px;
    }
    .dot {
        width: 14px;
        height: 14px;
    }
    .nav-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    .main-nav .nav-list li a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ===== UPDATED: Task 6 - Review submission form ===== */
.review-submit-section {
    padding: 42px 0 60px;
    background: linear-gradient(180deg, #dde9f1 0%, #dde9f1 100%);
}

.review-submit-section .container {
    max-width: 1460px;
}

.review-submit-section .section-header {
    text-align: right;
    margin-bottom: 26px;
    padding: 0 4px;
}

.review-submit-section .section-header h2 {
    font-size: clamp(2.2rem, 3vw, 4.5rem);
    font-weight: 800;
    color: var(--color-primary);
    margin: 0;
    line-height: 1.2;
    font-family: var(--font-primary);
}

.review-submit-section .section-header h2 .text-green-dark {
    color: var(--color-primary);
}

.review-submit-section .section-header p {
    color: rgba(31, 79, 115, 0.8);
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 10px 0 0;
    text-align: center;
    max-width: 760px;
    margin-inline: auto;
}

.form-container {
    max-width: 520px;
    margin: 0 auto;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(31, 79, 115, 0.12);
    border-radius: 18px;
    padding: var(--space-2xl);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.review-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 6px;
    direction: ltr;
}

.review-stars input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.review-stars label {
    font-size: 1.9rem;
    color: #d5dbe2;
    cursor: pointer;
    transition: color 0.15s ease;
}

.review-stars input:checked ~ label,
.review-stars label:hover,
.review-stars label:hover ~ label {
    color: #f59e0b;
}

.review-stars input:focus-visible + label {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
    border-radius: 4px;
}

.form-success {
    text-align: center;
    padding: 24px 16px;
}

.form-success i {
    font-size: 3rem;
    color: var(--color-success);
    margin-bottom: 12px;
}

.form-success h3 {
    color: var(--color-primary);
    margin-bottom: 6px;
}

.form-success p {
    color: var(--color-text-light);
}

.review-cta-section {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    overflow: hidden;
    background: linear-gradient(135deg, #1e2a8a 0%, #2F39A9 40%, #2E6FA0 80%, #1a5a80 100%);
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,.1);
    border-bottom: 4px solid rgba(21, 216, 179, 0.7);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
    transition: background 0.5s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 0.5s ease;
}

.review-cta-section::before,
.review-cta-section::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    filter: blur(2px);
    transition: background 0.5s ease, box-shadow 0.5s ease, opacity 0.5s ease;
    animation: reviewCtaFloat 12s ease-in-out infinite;
    will-change: transform;
}

.review-cta-section::before {
    width: 440px;
    height: 440px;
    right: 12%;
    bottom: -160px;
    box-shadow: 0 0 0 40px rgba(255,255,255,0.04), 0 0 0 90px rgba(255,255,255,0.02);
    animation-duration: 14s;
    animation-delay: -5s;
}

.review-cta-section::after {
    width: 160px;
    height: 160px;
    right: 18%;
    bottom: 50px;
    background: rgba(255,255,255,0.12);
    animation-duration: 9s;
}

@keyframes reviewCtaFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(14px) scale(1.06);
    }
}

.review-cta-section:hover {
    background: linear-gradient(135deg, #2F39A9 0%, #49A4BB 50%, #15D8B3 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 10px 28px rgba(47, 57, 169, 0.25);
}

.review-cta-section:hover::before {
    background: rgba(21, 216, 179, 0.15);
    box-shadow: 0 0 0 40px rgba(21, 216, 179, 0.06), 0 0 0 90px rgba(21, 216, 179, 0.03);
    animation-duration: 8s;
}

.review-cta-section:hover::after {
    background: rgba(21, 216, 179, 0.22);
    box-shadow: 0 0 20px rgba(21, 216, 179, 0.3);
    animation-duration: 6s;
}

.review-cta-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    min-height: 360px;
    width: 100%;
    max-width: none;
    padding: 0 48px;
}

.review-cta-copy {
    flex: 1;
    text-align: center;
}

.review-cta-copy h2 {
    color: var(--color-accent);
    font-size: clamp(2.6rem, 4vw, 5rem);
    line-height: 1.2;
    margin: 0 0 18px;
    font-weight: 800;
    font-family: var(--font-primary);
}

.review-cta-copy .text-green-dark {
    color: var(--color-accent);
}

.review-cta-copy p {
    max-width: 780px;
    margin: 0 auto;
    color: rgba(255,255,255,0.92);
    font-size: 1.05rem;
    line-height: 1.9;
}

.review-cta-actions {
    display: flex;
    justify-content: center;
    align-items: center;
}

.review-open-modal,
.review-submit-btn {
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #5ec8b7 0%, #3da8a0 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 1rem 2.25rem;
    min-width: 220px;
    box-shadow: 0 16px 28px rgba(16, 96, 88, 0.25);
    cursor: pointer;
}

/* scoped to beat the inline critical-CSS `.btn` copy in header.php */
.review-cta-actions .review-open-modal,
.review-modal-form .review-submit-btn {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-open-modal:hover,
.review-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(16, 96, 88, 0.32);
}

/* Accessibility: kill the endless float for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
    .cta-ticket::before,
    .cta-ticket::after,
    .review-cta-section::before,
    .review-cta-section::after {
        animation: none;
    }
}

/* Continuous float is desktop-only for battery/CPU: on phones the blurred
   circles stay static (hover colour transitions still apply on desktop).
   Note: must come AFTER the base animation rules to override them. */
@media (max-width: 768px) {
    .cta-ticket::before,
    .cta-ticket::after,
    .review-cta-section::before,
    .review-cta-section::after {
        animation: none;
    }
}

.review-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    padding: 20px;
}

.review-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.review-modal {
    position: relative;
    width: min(100%, 620px);
    background: #f3f3f3;
    border-radius: 24px;
    padding: 22px 26px 26px;
    box-shadow: 0 26px 80px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(31, 79, 115, 0.08);
}

.review-modal-close {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(31, 79, 115, 0.16);
    background: rgba(255,255,255,0.7);
    font-size: 1.8rem;
    line-height: 1;
    color: var(--color-primary);
    cursor: pointer;
}

.review-modal-form {
    display: grid;
    gap: 18px;
}

.review-modal-title-wrap {
    text-align: center;
    margin-bottom: 6px;
}

.review-modal-title-wrap h3 {
    margin: 0;
    font-size: clamp(1.8rem, 2.4vw, 2.3rem);
    color: var(--color-primary);
    font-family: var(--font-primary);
    font-weight: 700;
}

.review-modal-form .form-group {
    margin: 0;
}

.review-modal-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1.02rem;
}

.review-modal-form .form-control {
    width: 100%;
    min-height: 52px;
    border: 1px solid rgba(31, 79, 115, 0.18);
    border-radius: 12px;
    background: rgba(255,255,255,0.9);
    padding: 0.9rem 0.95rem;
    font-size: 1rem;
    color: var(--color-text);
}

.review-modal-form textarea.form-control {
    min-height: 130px;
    resize: vertical;
}

.review-stars-modal {
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.review-stars-modal label {
    font-size: 2.2rem;
    margin: 0;
    color: #f4b942;
    filter: drop-shadow(0 4px 10px rgba(244,185,66,0.15));
}

.review-stars-modal input:checked ~ label,
.review-stars-modal label:hover,
.review-stars-modal label:hover ~ label {
    color: #f59e0b;
}

.review-modal-form .review-submit-btn {
    margin-top: 8px;
    background: linear-gradient(180deg, #2f4e68 0%, #244a63 100%);
    border-radius: 12px;
    min-height: 56px;
    font-size: 1.1rem;
}

@media (max-width: 767px) {
    .review-cta-inner {
        flex-direction: column;
        padding: 40px 0;
        text-align: center;
    }

    .review-cta-copy {
        width: 100%;
    }

    .review-cta-copy h2 {
        font-size: 2.6rem;
    }

    .review-open-modal {
        min-width: 200px;
    }

    .review-modal {
        padding: 22px 18px 18px;
    }
}

/* ===== UPDATED: Task 1 - Navbar density & breakpoints ===== */
/* <1400px: tighter links so the full menu fits without overlap */
@media (max-width: 1400px) {
    .main-nav .nav-list li a {
        font-size: 13px;
        padding: 8px 10px;
    }
    .main-nav .nav-list li a span {
        font-size: inherit;
    }
}

/* <1200px: switch to hamburger menu (toggle shown, nav becomes slide-down panel) */
@media (max-width: 1200px) {
    .nav-toggle {
        display: block;
    }
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        padding: var(--space-md);
        transform: translateY(-120%);
        opacity: 0;
        transition: all 0.3s ease;
        z-index: 999;
    }
    .main-nav.nav-open {
        transform: translateY(0);
        opacity: 1;
    }
    .main-nav .nav-list {
        flex-direction: column;
        gap: var(--space-xs);
    }
    .main-nav .nav-list li a {
        padding: 0.8rem 1rem;
        width: 100%;
        font-size: 1rem;
    }
    .main-nav.nav-open .paths-dropdown.open {
        position: static;
        box-shadow: none;
        border: none;
        border-right: 3px solid var(--color-secondary);
        border-radius: 0 var(--border-radius) var(--border-radius) 0;
        margin: 4px 8px 10px;
        padding: var(--space-xs);
        max-height: none;
        overflow: visible;
    }
    .logo-text {
        display: none;
    }
    .logo-img {
        max-height: 45px;
        width: auto;
        height: auto;
    }
}

/* <992px: logo image only (site name hidden), nothing clips it */
@media (max-width: 992px) {
    .logo-text {
        display: none;
    }
    .logo-img {
        max-height: 45px;
        width: auto;
        height: auto;
    }
}

/* ===== UPDATED: Task 5 - Training kits page ===== */
.training-kits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.kit-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.kit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.kit-card-image {
    aspect-ratio: 16 / 9;
    position: relative;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    overflow: hidden;
}

.kit-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kit-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kit-card-placeholder i {
    font-size: 2.6rem;
    color: rgba(255, 255, 255, 0.9);
}

.kit-card-body {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.kit-card-body h3 {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}

.kit-card-desc {
    color: var(--color-text-light);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: var(--space-md);
    flex: 1;
}

.kit-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    margin-top: auto;
}

.kit-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-primary);
}

.kit-price small {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.kit-price-free {
    color: var(--color-success);
    font-size: 0.95rem;
}

.kit-order-btn {
    border-radius: 50px;
}

/* Empty state placeholder */
.kits-coming-soon {
    text-align: center;
    padding: 64px 24px;
    background: var(--color-white);
    border: 1px dashed var(--color-border);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--space-2xl);
}

.kits-coming-soon-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kits-coming-soon-icon i {
    font-size: 2.2rem;
    color: var(--color-white);
}

.kits-coming-soon h3 {
    color: var(--color-primary);
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.kits-coming-soon p {
    color: var(--color-text-light);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Kits grid: 2 columns on tablets, 1 on phones */
@media (max-width: 768px) {
    .training-kits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .training-kits-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== UPDATED: Task 6 - Accredit kit page (steps + form) ===== */
.accredit-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.accredit-step {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    padding: 24px 20px;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.accredit-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.accredit-step-num {
    position: absolute;
    top: -12px;
    right: 50%;
    transform: translateX(50%);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.accredit-step > i {
    font-size: 2rem;
    color: var(--color-secondary);
    margin-bottom: 12px;
}

.accredit-step h3 {
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.accredit-step p {
    color: var(--color-text-light);
    font-size: 0.85rem;
    line-height: 1.8;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .accredit-steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .accredit-steps-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== UPDATED: Task 7 - Become a trainer (benefits) ===== */
.trainer-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.trainer-benefit {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius-lg);
    padding: 24px 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.trainer-benefit:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.trainer-benefit > i {
    font-size: 2rem;
    color: var(--color-secondary);
    margin-bottom: 12px;
}

.trainer-benefit h3 {
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.trainer-benefit p {
    color: var(--color-text-light);
    font-size: 0.85rem;
    line-height: 1.8;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .trainer-benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .trainer-benefits-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== UPDATED: brand name - visible on large screens, hidden on small ===== */
.navbar-brand .brand-text,
.navbar-brand .site-name,
.navbar-brand span,
.hide-brand-text,
.logo .logo-text.hide-brand-text {
    display: inline !important;
    font-size: 15px !important;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hide brand name on small/medium screens (nav + logo + name need >= 1411px) */
@media (max-width: 1410px) {
    .navbar-brand .brand-text,
    .navbar-brand .site-name,
    .navbar-brand span,
    .hide-brand-text,
    .logo .logo-text.hide-brand-text {
        display: none !important;
    }
}

/* Logo image must stay visible at all times */
.logo-img,
.navbar-brand img,
.navbar-brand .logo-img {
    display: inline-block !important;
    max-height: 45px !important;
    width: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== UPDATED: prevent navbar line break ===== */
.navbar {
    flex-wrap: nowrap !important;
}
.navbar-nav {
    flex-wrap: nowrap !important;
    white-space: nowrap;
}
.nav-item {
    white-space: nowrap;
}
.main-nav,
.main-nav .nav-list {
    flex-wrap: nowrap !important;
    white-space: nowrap;
}
.main-nav .nav-list li {
    white-space: nowrap;
}

/* ===== UPDATED: remove extra space before language switcher (EN) ===== */
.navbar-end,
.navbar-right,
.lang-switcher,
.nav-lang {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.navbar-spacer,
.nav-spacer {
    display: none !important;
    flex: 0 !important;
}

.navbar-nav,
.navbar-collapse {
    justify-content: flex-end !important;
    gap: 0 !important;
}

/* Actual project classes: keep nav compact against the logo side */
.nav-lang-item,
.nav-list > li:last-child {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ===================================================================
   RESPONSIVE DENSITY LAYER
   Fluid type + auto-fit grids + dense graduated breakpoints (320 -> 1920).
   Placed AFTER the classic mobile-last blocks (wins ties) and BEFORE the
   LTR overrides below (which keep final authority on direction alignment).
   =================================================================== */

/* ----- Fluid base size: 19px on desktop ramping down smoothly on smaller
   viewports; every rem token (--space-*) and rem font scales with it. */
:root {
    font-size: clamp(16px, 0.625vw + 11.5px, 19px);
}

/* ----- Fluid container gutters, safe for both page directions */
.main-content .container,
main .container,
.site-footer > .container {
    padding-inline: clamp(16px, 2.5vw, 24px);
}

/* ----- Auto-fit card grids: column count is a pure function of available
   width (no fixed 3 -> 2 -> 1 steps, nothing can overflow a squeezed row). */
.courses-grid,
.featured-programs-section .courses-grid,
.trainers-page-grid,
.training-kits-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
}

/* ----- Featured programs: cap at 3 columns on wide screens. Below 1240px
   the auto-fill rule above already yields 1/2 columns and a max of 3, so
   this only kicks in exactly where a 4th ~280px track would otherwise fit
   and pins it to 3 stretched tracks instead. */
@media (min-width: 1240px) {
    .featured-programs-section .courses-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.accredit-steps-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}

.trainer-benefits-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
}

/* ----- Footer: 4 asymmetric columns are too tight below ~1100px */
@media (max-width: 1100px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-xl);
    }
}

@media (max-width: 560px) {
    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ----- Hamburger panel: internal scroll instead of pushing past the fold */
@media (max-width: 1315px) {
    .main-nav.main-nav {
        overscroll-behavior: contain;
    }
    .main-nav.main-nav .nav-list {
        max-height: calc(100vh - var(--header-height) - 52px);
        overflow-y: auto;
    }
}

/* ----- Section headers breathe less on small screens */
@media (max-width: 768px) {
    .section-header {
        padding-top: clamp(24px, 6vw, 40px);
    }
}

/* ----- Hero: shorter on phones (beats the inline critical 65vh cap) */
@media (max-width: 576px) {
    .hero-slider.hero-slider {
        height: 58vh;
        min-height: 360px;
    }
}

@media (max-width: 414px) {
    .hero-slider.hero-slider {
        height: 52vh;
        min-height: 330px;
    }
}

/* ----- Showcase: tabs snap while scrolling, cards track the width */
@media (max-width: 640px) {
    .showcase-tabs {
        scroll-snap-type: x proximity;
        scroll-padding-inline: 4px;
    }
    .showcase-tab {
        scroll-snap-align: start;
    }
}

@media (max-width: 414px) {
    .panel-cards-grid .panel-card-flip {
        flex: 1 0 90%;
    }
    .showcase-tab {
        padding: 10px 14px;
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .panel-cards-grid .panel-card-flip {
        flex: 1 0 96%;
    }
}

/* ----- Testimonials: no oversized minimum height on phones */
@media (max-width: 440px) {
    .testimonial-card {
        min-height: 0;
        padding-block: 22px;
    }
    .testimonials-section .section-header h2 {
        font-size: clamp(1.6rem, 7vw, 2rem);
    }
}

/* ----- CTA section: full-width buttons on very small screens */
@media (max-width: 767px) {
    .cta-btn {
        min-width: 0;
        width: 100%;
        max-width: 320px;
    }
}

/* ----- Review CTA heading stays readable on narrow phones */
@media (max-width: 480px) {
    .review-cta-copy h2 {
        font-size: clamp(2rem, 8vw, 2.6rem);
    }
}

/* ----- Auth split-screen: tighter on phones */
@media (max-width: 480px) {
    .auth-shell {
        margin-top: 52px;
        margin-bottom: 16px;
        border-radius: 18px;
    }
    .auth-card {
        padding: var(--space-xl) var(--space-lg);
    }
}

/* ----- Admin: stack editors, shrink filter inputs on narrow screens */
@media (max-width: 640px) {
    .admin-main .admin-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
    .admin-main .filter-form .form-control,
    .admin-main form[method="GET"] .form-control {
        min-width: 140px;
    }
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* ----- Landscape phones: hero fills the short viewport, sections tighten */
@media (orientation: landscape) and (max-height: 520px) {
    .hero-slider.hero-slider {
        height: 100vh;
        min-height: 300px;
    }
    .auth-shell {
        margin: 20px auto 16px;
    }
    .review-cta-section,
    .review-cta-inner {
        min-height: 280px;
    }
}

/* ===================================================================
   LTR (ENGLISH) OVERRIDES
   Applied only when the document is Left-to-Right (html[dir="ltr"]).
   Arabic (RTL) keeps its own arrangement via rtl.css + inline RTL blocks.
   =================================================================== */

/* ----- Section headings: left-aligned with the underline accent on the left ----- */
html[dir="ltr"] .section-header {
    text-align: left;
}

html[dir="ltr"] .section-header h2::after {
    left: 0;
    transform: none;
}

html[dir="ltr"] .section-header p {
    margin-left: 0;
}

/* Featured training programs (home) */
html[dir="ltr"] .featured-programs-section .section-header {
    text-align: left;
}

html[dir="ltr"] .featured-programs-section .section-header h2 {
    font-size: clamp(1.55rem, 2.05vw, 2.2rem);
}

/* Testimonials + review submit sections */
html[dir="ltr"] .testimonials-section .section-header h2 {
    text-align: left;
}

html[dir="ltr"] .testimonials-section .section-header p {
    margin-left: 0;
}

html[dir="ltr"] .review-submit-section .section-header {
    text-align: left;
}

html[dir="ltr"] .review-submit-section .section-header p {
    text-align: left;
    margin-inline: 0;
}

/* ----- Hero slide content: left-aligned, single-line heading sizing ----- */
html[dir="ltr"] .hero-slide-content {
    text-align: left;
}

html[dir="ltr"] .hero-slide-content h1 {
    text-align: left;
    font-size: clamp(1.3rem, 2.2vw, 1.9rem);
}

html[dir="ltr"] .hero-slide-content p {
    text-align: left;
}

html[dir="ltr"] .hero-actions {
    justify-content: flex-start;
}

/* ----- Glued input + button combos: flat on the shared edge ----- */
/* Footer newsletter: flat edge between button (left) and input (right) */
html[dir="ltr"] .footer-newsletter button {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

html[dir="ltr"] .footer-newsletter input {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}