﻿/* =============================================
   أكاديمية — Modern Professional Stylesheet
   ============================================= */

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

:root {
    --red:        #7a2228;
    --red-dark:   #561519;
    --red-light:  #9c2b33;
    --red-glow:   rgba(122,34,40,0.35);
    --bg:         #0a0a0a;
    --bg2:        #111214;
    --bg3:        #181a1d;
    --surface:    #1c1e22;
    --surface2:   #232629;
    --border:     #2a2c31;
    --border-red: #3a1216;
    --text:       #e8e9ea;
    --text-muted: #8a8f99;
    --text-dim:   #555c69;
    --white:      #ffffff;
    --radius:     12px;
    --radius-sm:  8px;
    --radius-lg:  20px;
    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --shadow-red: 0 4px 24px rgba(122,34,40,0.3);
    --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }

/* =============================================
   DYNAMIC CONTENT — auto bidi direction
   Applies unicode-bidi: plaintext so the browser
   determines LTR/RTL from actual text content.
   Works with dir="auto" on the HTML element.
   ============================================= */
[dir="auto"],
.ccard-title, .ccard-desc,
.hero-title, .hero-desc,
.card-title, .card-text,
.ns-title,
.nd-title,
.mag-card-title, .mag-card-excerpt, .mag-title,
.ad-card-title, .ad-card-desc, .ad-detail-title, .ad-detail-desc,
.cm-post-text,
.ip-note-title, .ip-note-desc {
    unicode-bidi: plaintext;
}

body {
    font-family: 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 3px; }

/* =============================================
   WATERMARK
   ============================================= */
.watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    width: min(70vw, 700px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.watermark-img {
    width: 100%;
    height: auto;
    opacity: 0.13;
    filter: saturate(0.6) brightness(1.8);
    user-select: none;
    -webkit-user-drag: none;
}

/* ensure page content sits above watermark */
.navbar       { z-index: 1000; }
.page-wrapper { position: relative; z-index: 1; }
.site-footer  { position: relative; z-index: 1; }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(10,10,10,0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
    /* iOS safe area — clears Dynamic Island / notch */
    padding-top: env(safe-area-inset-top, 0px);
}
.navbar.scrolled { box-shadow: 0 2px 30px rgba(0,0,0,0.6); }

.nav-container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-logo { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.nav-logo-img {
    height: 72px; width: auto;
    filter: drop-shadow(0 0 8px var(--red-glow));
    transition: transform var(--transition), filter var(--transition);
}
.nav-logo:hover .nav-logo-img {
    transform: scale(1.08) rotate(-3deg);
    filter: drop-shadow(0 0 14px rgba(122,34,40,0.7));
}
.nav-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-main { font-size: 1rem; font-weight: 900; color: var(--white); letter-spacing: -0.5px; white-space: nowrap; }
.logo-iq   { color: var(--red-light); }
.logo-sub  { font-size: 0.62rem; font-weight: 400; color: var(--text-muted); }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }

.nav-link {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition), background var(--transition);
}
.nav-link i { font-size: 0.85rem; }
.nav-link:hover { color: var(--white); background: var(--surface); }

.nav-btn {
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 0.4rem;
    transition: all var(--transition);
}
.nav-btn-primary { background: var(--red); color: var(--white); border: 1px solid var(--red); }
.nav-btn-primary:hover { background: var(--red-light); box-shadow: var(--shadow-red); }
.nav-btn-outline { color: var(--text-muted); border: 1px solid var(--border); }
.nav-btn-outline:hover { color: var(--white); border-color: var(--red); background: var(--border-red); }

/* Hamburger X animation when active */
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile nav drawer title */
.nav-mobile-title { display: none; padding-bottom: .75rem; margin-bottom: .25rem; border-bottom: 1px solid var(--border-red); font-weight: 800; font-size: .85rem; color: var(--text-muted); list-style: none; }
.nav-mobile-title i { color: var(--red); margin-left: .4rem; }
@media (max-width: 700px) { .nav-mobile-title { display: block; } }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 10px; border-radius: 8px; transition: background 0.2s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-appearance: none; appearance: none; }
.hamburger:hover { background: var(--surface); }
.hamburger span { display: block; width: 26px; height: 3px; background: var(--white); border-radius: 3px; transition: all 0.3s cubic-bezier(0.4,0,0.2,1); transform-origin: center; pointer-events: none; }

/* =============================================
   PAGE WRAPPER
   ============================================= */
.page-wrapper {
    max-width: 1350px;
    margin: calc(68px + env(safe-area-inset-top, 0px)) auto 0;
    padding: 2.5rem 2rem;
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 2rem;
    align-items: start;
}
.main-content { min-width: 0; }

/* =============================================
   HERO
   ============================================= */
.hero {
    position: relative;
    background: linear-gradient(135deg, #0e0506 0%, #1a0508 40%, #0a0a0a 100%);
    border: 1px solid var(--border-red);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 3.5rem 3rem;
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 2.5rem;
    min-height: 380px;
}

.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.shape { position: absolute; border-radius: 50%; background: var(--red); opacity: 0.07; animation: floatShape 8s ease-in-out infinite; }
.shape-1 { width: 300px; height: 300px; top: -80px; left: -80px; }
.shape-2 { width: 200px; height: 200px; bottom: -60px; left: 40%; opacity: 0.05; animation-delay: 3s; }
.shape-3 { width: 150px; height: 150px; top: 20px; left: 55%; opacity: 0.04; animation-delay: 5s; }

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

.hero-content { position: relative; z-index: 1; flex: 1; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(122,34,40,0.2);
    border: 1px solid rgba(122,34,40,0.5);
    color: #e87a80;
    font-size: 0.8rem; font-weight: 700;
    padding: 0.3rem 0.9rem; border-radius: 50px;
    margin-bottom: 1.2rem; letter-spacing: 0.5px;
}

.hero-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 1rem;
    color: var(--white);
}
.hero-accent {
    background: linear-gradient(90deg, #e87a80, var(--red-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-desc { font-size: 1rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 480px; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }

.btn-primary-hero {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--red); color: var(--white);
    padding: 0.8rem 1.8rem; border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 700;
    transition: all var(--transition);
    box-shadow: var(--shadow-red);
}
.btn-primary-hero:hover { background: var(--red-light); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(122,34,40,0.5); }

.btn-ghost-hero {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.8rem 1.8rem; border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 700;
    transition: all var(--transition);
}
.btn-ghost-hero:hover { color: var(--white); border-color: var(--red); background: var(--border-red); }

.hero-stats { display: flex; align-items: center; gap: 1.5rem; }
.h-stat { display: flex; flex-direction: column; align-items: center; }
.h-stat strong { font-size: 1.5rem; font-weight: 900; color: var(--white); line-height: 1; }
.h-stat span   { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.h-stat-divider { width: 1px; height: 36px; background: var(--border); }

.hero-visual { position: relative; z-index: 1; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.hero-logo-wrap { position: relative; }
 .hero-logo-img {
    height: 320px; width: auto;
    filter: drop-shadow(0 0 30px rgba(122,34,40,0.6));
    animation: heroPulse 4s ease-in-out infinite;
}
.hero-logo-glow {
    position: absolute; inset: -20px;
    background: radial-gradient(circle, rgba(122,34,40,0.25) 0%, transparent 70%);
    border-radius: 50%;
    animation: heroPulse 4s ease-in-out infinite;
}
@keyframes heroPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.85; transform: scale(1.04); }
}

/* =============================================
   FEATURES
   ============================================= */
.features-section { margin-bottom: 2.5rem; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

.feature-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem; text-align: center;
    transition: all var(--transition); cursor: default;
}
.feature-card:hover { border-color: var(--red); background: var(--surface2); transform: translateY(-4px); box-shadow: var(--shadow-red); }

.feature-icon {
    width: 52px; height: 52px;
    background: rgba(122,34,40,0.15);
    border: 1px solid var(--border-red);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.3rem; color: #e87a80;
    transition: all var(--transition);
}
.feature-card:hover .feature-icon { background: var(--red); color: var(--white); border-color: var(--red); }
.feature-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.feature-card p  { font-size: 0.82rem; color: var(--text-muted); }

/* =============================================
   SECTIONS
   ============================================= */
.home-section { margin-bottom: 2.5rem; }

.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.section-header h2 { font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; }
.section-header h2 i { color: var(--red); }

.see-all { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 0.35rem; transition: color var(--transition); }
.see-all:hover { color: var(--red); }

.loading-row { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.9rem; }

/* =============================================
   COURSES GRID — LATEST COURSES
   ============================================= */
.courses-section-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* First row: 1 featured (wide) + 2 normal cards */
.courses-row-featured {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Remaining rows: 4 equal columns */
.courses-row-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Show-more button */
.courses-show-more {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}
.courses-show-more button {
    background: transparent;
    border: 1px solid var(--border-red);
    color: var(--red);
    padding: 0.55rem 1.8rem;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.87rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: 0.3px;
}
.courses-show-more button:hover {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 18px rgba(176,0,32,0.35);
}

/* ── The actual course card ── */
.ccard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
    position: relative;
    cursor: default;
}
.ccard:hover {
    transform: translateY(-5px);
    border-color: var(--border-red);
    box-shadow: 0 10px 32px rgba(176,0,32,0.22);
}

/* Thumbnail */
.ccard-thumb {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #10101a;
    flex-shrink: 0;
}
.ccard-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.ccard:hover .ccard-thumb img { transform: scale(1.07); }
.ccard-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 35%, rgba(8,8,18,0.75) 100%);
    pointer-events: none;
}

/* Featured card — taller thumb */
.ccard.featured .ccard-thumb { height: 220px; }
/* Normal card */
.ccard.normal  .ccard-thumb { height: 150px; }
/* Compact card (rows of 4) */
.ccard.compact .ccard-thumb { height: 130px; }

/* Specialization chip overlaid on the image */
.ccard-spec {
    position: absolute;
    bottom: 9px;
    right: 10px;
    background: rgba(160,0,30,0.82);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Body */
.ccard-body {
    padding: 13px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 5px;
}
.ccard-instructor {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}
.ccard-instructor i { color: var(--red); font-size: 0.68rem; }
.ccard-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ccard.featured .ccard-title { font-size: 1.1rem; -webkit-line-clamp: 3; }
.ccard-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    unicode-bidi: plaintext;   /* handle mixed LTR/RTL descriptions */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.ccard.featured .ccard-desc { -webkit-line-clamp: 3; }
.ccard.compact  .ccard-desc { display: none; }
.ccard-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ccard-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--red);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.ccard-btn:hover { background: var(--red-light); box-shadow: 0 3px 12px rgba(176,0,32,0.4); }
.ccard.compact .ccard-btn { font-size: 0.74rem; padding: 5px 11px; }

/* Responsive */
@media (max-width: 1100px) {
    .courses-row-featured { grid-template-columns: 1.5fr 1fr 1fr; }
    .courses-row-grid     { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 780px) {
    .courses-row-featured { grid-template-columns: 1fr 1fr; }
    .courses-row-featured .ccard:nth-child(1) { grid-column: 1/-1; }
    .courses-row-grid     { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .courses-row-featured,
    .courses-row-grid { grid-template-columns: 1fr; }
    .courses-row-featured .ccard:nth-child(1) { grid-column: auto; }
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: all var(--transition);
    display: flex; flex-direction: column;
}
.card:hover { border-color: var(--border-red); transform: translateY(-4px); box-shadow: var(--shadow-red); }
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 0.4rem; }
.card-text  { font-size: 0.83rem; color: var(--text-muted); flex: 1; margin-bottom: 1rem; line-height: 1.6; }
.course-card-bar { height: 4px; background: linear-gradient(90deg, var(--red), var(--red-light)); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.2rem; border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 700; cursor: pointer;
    transition: all var(--transition); border: none; font-family: inherit;
}
.btn-primary  { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-light); box-shadow: var(--shadow-red); }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { color: var(--white); border-color: var(--red); background: var(--border-red); }
.btn-secondary { background: var(--red); color: var(--white); }
.btn-secondary:hover { background: var(--red-light); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: sticky; top: 88px;
    display: flex; flex-direction: column; gap: 1rem;
    max-height: calc(100vh - 108px);
    overflow-y: auto; padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-widget {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1.2rem;
    transition: border-color var(--transition);
}
.sidebar-widget:hover { border-color: var(--border-red); }

.about-widget { text-align: center; padding: 1.5rem 1.2rem; }
.sidebar-logo {
    height: 80px; width: auto;
    margin: 0 auto 0.75rem;
    filter: drop-shadow(0 0 10px var(--red-glow));
}
.about-widget h3 { font-size: 1.05rem; font-weight: 900; color: var(--white); margin-bottom: 0.4rem; }
.about-widget p  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }

.widget-title {
    font-size: 0.875rem; font-weight: 800; color: var(--white);
    margin-bottom: 0.9rem; padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 0.45rem;
}
.widget-title i { color: var(--red); }
.widget-loading { color: var(--text-dim); font-size: 0.8rem; display: flex; align-items: center; gap: 0.5rem; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.stat-box {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 0.9rem 0.5rem;
    text-align: center; display: flex; flex-direction: column; gap: 0.2rem;
}
.stat-num { font-size: 1.6rem; font-weight: 900; color: var(--red-light); line-height: 1; }
.stat-lbl { font-size: 0.72rem; color: var(--text-muted); }

.sidebar-course-item { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.sidebar-course-item:last-child { border-bottom: none; }
.sidebar-course-item a {
    font-size: 0.83rem; font-weight: 600; color: var(--text);
    display: block; transition: color var(--transition);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-course-item a:hover { color: var(--red-light); }
.course-instructor { font-size: 0.72rem; color: var(--text-dim); margin-top: 2px; display: flex; align-items: center; gap: 0.3rem; }
.course-instructor i { color: var(--red); }

.instructor-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.instructor-item:last-child { border-bottom: none; }
.instructor-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--red-dark), var(--red));
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; color: var(--white); flex-shrink: 0;
    border: 2px solid var(--border-red);
}
.instructor-name    { font-size: 0.83rem; font-weight: 700; color: var(--text); }
.instructor-courses { font-size: 0.72rem; color: var(--text-dim); }

.spec-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.spec-tag {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--bg3); border: 1px solid var(--border);
    color: var(--text-muted); border-radius: 50px;
    padding: 0.3rem 0.7rem; font-size: 0.75rem; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.spec-tag:hover { background: var(--red); border-color: var(--red); color: var(--white); }

.social-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.social-icon {
    display: flex; align-items: center; justify-content: center;
    height: 40px; border-radius: var(--radius-sm);
    font-size: 1rem; color: var(--text-muted);
    background: var(--bg3); border: 1px solid var(--border);
    transition: all var(--transition);
}
.social-icon:hover { color: var(--white); transform: translateY(-2px); }
.social-icon.facebook:hover  { background: #1877f2; border-color: #1877f2; }
.social-icon.twitter:hover   { background: #111; border-color: #444; }
.social-icon.youtube:hover   { background: #ff0000; border-color: #ff0000; }
.social-icon.instagram:hover { background: linear-gradient(135deg,#f09433,#dc2743,#bc1888); border-color: #cc2366; }
.social-icon.telegram:hover  { background: #229ed9; border-color: #229ed9; }
.social-icon.email:hover     { background: var(--red); border-color: var(--red); }

/* =============================================
   FOOTER
   ============================================= */
.site-footer { background: var(--bg2); border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-top {
    max-width: 1350px; margin: 0 auto;
    padding: 3rem 2rem 2rem;
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem;
}
.footer-brand { display: flex; align-items: flex-start; gap: 0.75rem; }
.footer-logo  {
    height: 56px; width: auto;
    filter: drop-shadow(0 0 8px var(--red-glow));
}
.footer-brand-name { font-size: 1.2rem; font-weight: 900; color: var(--white); margin-bottom: 0.2rem; }
.footer-brand-desc { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }
.footer-links-group h4 { font-size: 0.85rem; font-weight: 800; color: var(--white); margin-bottom: 0.9rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-red); }
.footer-links-group ul { display: flex; flex-direction: column; gap: 0.45rem; }
.footer-links-group a { font-size: 0.82rem; color: var(--text-muted); transition: color var(--transition); }
.footer-links-group a:hover { color: var(--red-light); }
.footer-social { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.2rem 2rem; text-align: center; font-size: 0.8rem; color: var(--text-dim); max-width: 1350px; margin: 0 auto; }

/* =============================================
   FORMS
   ============================================= */
label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); }
input, textarea, select {
    width: 100%; padding: 0.75rem 1rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 0.9rem; font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(122,34,40,0.15); }
.form-group { margin-bottom: 1.25rem; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-top    { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .page-wrapper { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: none; overflow: visible; }
    .hero { flex-direction: column; text-align: center; padding: 2.5rem 1.5rem; }
    .hero-visual { order: -1; }
    /* .hero-logo-img { height: 140px; }  Removed to avoid conflict */
    .hero-desc { max-width: 100%; }
    .hero-actions, .hero-stats { justify-content: center; }
    .footer-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 700px) {
    /* hide the inline nav-links on mobile */
    .nav-links { display: none !important; }
    .hamburger { display: flex; }
    .features-grid { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; }
    .hero-title { font-size: 1.7rem; }
}

/* ── Mobile Nav Drawer (body-level) ── */
.mob-drawer-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.mob-drawer-overlay.open { display: block; }

.mob-drawer {
    position: fixed;
    top: 0; right: -110%;
    width: min(300px, 85vw);
    height: 100vh;
    height: -webkit-fill-available;
    min-height: 100vh;
    background: #0e0e0e;
    border-left: 1px solid rgba(122,34,40,0.5);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: right 0.32s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -8px 0 40px rgba(0,0,0,0.7);
    will-change: right;
}
.mob-drawer.open { right: 0; }

.mob-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Push content below Dynamic Island / notch */
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.2rem 1rem;
    border-bottom: 1px solid rgba(122,34,40,0.4);
    background: rgba(122,34,40,0.1);
}
.mob-drawer-title {
    font-size: .9rem; font-weight: 800;
    color: #fff;
    display: flex; align-items: center; gap: .5rem;
}
.mob-drawer-title i { color: #e87a80; }

.mob-close-btn {
    background: none; border: none;
    width: 44px; height: 44px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #aaa;
    font-size: 1.2rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-appearance: none;
    pointer-events: auto;
}
.mob-close-btn:hover { background: rgba(122,34,40,.3); color: #fff; }

.mob-drawer-body { display: flex; flex-direction: column; padding: .75rem .75rem; gap: .15rem; flex: 1; }

.mob-drawer-body a {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1rem;
    border-radius: 10px;
    font-size: .95rem; font-weight: 600;
    color: #ccc;
    text-decoration: none;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.mob-drawer-body a:hover,
.mob-drawer-body a:focus  { background: rgba(122,34,40,.2); color: #fff; }
.mob-drawer-body a i      { width: 20px; text-align: center; color: #e87a80; font-size: .9rem; }
.mob-drawer-body hr       { border: none; border-top: 1px solid rgba(255,255,255,.07); margin: .35rem 0; }
.mob-drawer-body .mob-nav-btn {
    background: rgba(122,34,40,.85); color: #fff; font-weight: 700;
    justify-content: center; margin-top: .4rem;
}
.mob-drawer-body .mob-nav-btn:hover { background: rgba(176,0,32,.9); }
@media (max-width: 480px) {
    .nav-container { padding: 0 1rem; }
    .page-wrapper  { padding: 1.5rem 1rem; }
    .hero { padding: 2rem 1.2rem; border-radius: var(--radius); }
}


/* =====================================================
   DASHBOARD LAYOUT  (Owner / Instructor / Student)
   ===================================================== */

/* ── Layout shell ── */
.db-layout {
  display: flex;
  min-height: calc(100vh - 80px);
  background: var(--dark-bg);
  direction: rtl;
}

/* ── Sidebar ── */
.db-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--dark-card);
  border-left: 1px solid rgba(122,34,40,0.25);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 0.5rem;
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
}

.db-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(122,34,40,0.3);
  margin-bottom: 0.5rem;
}

.db-sidebar-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--red-glow));
}

.db-sidebar-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--white);
}

.db-sidebar-sub {
  font-size: 0.75rem;
  color: var(--gray-text);
}

/* ── Nav items ── */
.db-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.db-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  color: var(--gray-text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}

.db-nav-item i { width: 18px; text-align: center; }

.db-nav-item:hover {
  background: rgba(122,34,40,0.15);
  color: var(--white);
}

.db-nav-item.active {
  background: linear-gradient(135deg, rgba(122,34,40,0.35), rgba(180,50,60,0.2));
  color: var(--white);
  border-right: 3px solid var(--red-glow);
}

/* ── Badge ── */
.db-badge {
  margin-right: auto;
  margin-left: 0;
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.owner-badge { background: rgba(122,34,40,0.5); color: #ffaaaa; border: 1px solid rgba(122,34,40,0.7); }

/* ── Permissions box ── */
.db-permissions-box {
  margin-top: auto;
  padding: 1rem;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  border: 1px solid rgba(122,34,40,0.2);
}

.instructor-perm { border-color: rgba(30,80,180,0.3); }
.student-perm    { border-color: rgba(30,140,80,0.3); }

.db-perm-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red-glow);
  margin-bottom: 0.6rem;
}

.instructor-perm .db-perm-title { color: #60a0ff; }
.student-perm    .db-perm-title { color: #40c080; }

.db-perm-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.db-perm-list li {
  font-size: 0.75rem;
  color: var(--gray-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.db-perm-list li .fa-check  { color: #40c068; }
.db-perm-list li .fa-times  { color: #e04040; }

/* ── Main content ── */
.db-main {
  flex: 1;
  padding: 2rem 1.75rem;
  overflow-y: auto;
  min-width: 0;
}

/* ── Page header ── */
.db-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.db-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.db-page-title i { color: var(--red-glow); }

/* ── Alert ── */
.db-alert {
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  background: rgba(122,34,40,0.25);
  border: 1px solid rgba(122,34,40,0.5);
  color: #ffcccc;
}

.db-alert-success { background: rgba(30,140,60,0.25); border-color: rgba(30,140,60,0.5); color: #aaffcc; }

/* ── Stats grid ── */
.db-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.db-stat-card {
  background: var(--dark-card);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  text-align: center;
  border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}

.db-stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

.db-stat-card.red    { border-color: rgba(122,34,40,0.4); }
.db-stat-card.blue   { border-color: rgba(30,80,200,0.4); }
.db-stat-card.green  { border-color: rgba(30,140,80,0.4); }
.db-stat-card.gold   { border-color: rgba(200,160,30,0.4); }
.db-stat-card.purple { border-color: rgba(120,50,200,0.4); }
.db-stat-card.teal   { border-color: rgba(30,160,160,0.4); }
.db-stat-card.orange { border-color: rgba(200,100,30,0.4); }

.db-stat-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }
.db-stat-card.red    .db-stat-icon { color: var(--red-glow); }
.db-stat-card.blue   .db-stat-icon { color: #60a0ff; }
.db-stat-card.green  .db-stat-icon { color: #40c080; }
.db-stat-card.gold   .db-stat-icon { color: #f0c040; }
.db-stat-card.purple .db-stat-icon { color: #a070ff; }
.db-stat-card.teal   .db-stat-icon { color: #40d0d0; }
.db-stat-card.orange .db-stat-icon { color: #f08040; }

.db-stat-val   { font-size: 2rem; font-weight: 900; color: var(--white); line-height: 1; }
.db-stat-label { font-size: 0.78rem; color: var(--gray-text); margin-top: 0.3rem; }

/* ── Generic card ── */
.db-card {
  background: var(--dark-card);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.db-card-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.db-card-header i { color: var(--red-glow); }

/* ── Dual grid ── */
.db-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* ── Table ── */
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.db-table th {
  text-align: right;
  padding: 0.6rem 0.8rem;
  color: var(--gray-text);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.db-table td {
  padding: 0.65rem 0.8rem;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.db-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.db-empty { text-align: center; color: var(--gray-text); padding: 1.5rem !important; }

/* ── Pills / badges ── */
.db-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(122,34,40,0.35);
  color: #ffcccc;
}
.db-pill.green  { background: rgba(30,140,80,0.3);  color: #aaffcc; }
.db-pill.blue   { background: rgba(30,80,200,0.3);  color: #aaccff; }
.db-pill.orange { background: rgba(200,100,30,0.3); color: #ffddaa; }

/* ── Buttons ── */
.db-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  background: linear-gradient(135deg, var(--red-dark), var(--red-glow));
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.db-btn-primary:hover { opacity: 0.88; transform: translateY(-1px); color: var(--white); }

.db-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}
.db-btn-sm.blue  { background: rgba(30,80,200,0.35);  color: #aaccff; }
.db-btn-sm.green { background: rgba(30,140,80,0.35);  color: #aaffcc; }
.db-btn-sm.red   { background: rgba(122,34,40,0.45);  color: #ffaaaa; }
.db-btn-sm:hover { opacity: 0.8; }

.db-btn-danger-sm {
  background: rgba(180,30,30,0.35);
  color: #ffaaaa;
  border: 1px solid rgba(180,30,30,0.4);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}
.db-btn-danger-sm:hover { background: rgba(180,30,30,0.6); }

/* ── Forms ── */
.db-inline-form { display: inline; }

.db-select-role {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--white);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.db-search-bar { margin-bottom: 1rem; }
.db-search-input {
  width: 100%;
  max-width: 360px;
  padding: 0.5rem 0.9rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.85rem;
}
.db-search-input:focus { outline: none; border-color: var(--red-glow); }

/* ── Grid cards (instructors, courses) ── */
.db-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ── Instructor card ── */
.db-instructor-card {
  background: var(--dark-card);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.2s;
}
.db-instructor-card:hover { transform: translateY(-4px); }
.db-avatar { font-size: 2.5rem; color: var(--red-glow); margin-bottom: 0.5rem; }
.db-instructor-name  { font-size: 1rem; font-weight: 700; color: var(--white); }
.db-instructor-email { font-size: 0.75rem; color: var(--gray-text); margin: 0.25rem 0; }
.db-instructor-stat  { font-size: 0.78rem; color: var(--gray-text); margin-top: 0.5rem; }

/* ── Course card ── */
.db-course-card {
  background: var(--dark-card);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s;
}
.db-course-card:hover { transform: translateY(-3px); border-color: rgba(122,34,40,0.4); }
.db-course-card.enrolled { border-color: rgba(30,140,80,0.3); }

.db-course-title   { font-size: 0.95rem; font-weight: 700; color: var(--white); }
.db-course-meta    { display: flex; gap: 0.75rem; font-size: 0.75rem; color: var(--gray-text); flex-wrap: wrap; }
.db-course-desc    { font-size: 0.78rem; color: var(--gray-text); line-height: 1.5; }
.db-course-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* ── Upload box ── */
.db-upload-box {
  background: var(--dark-card);
  border-radius: 14px;
  border: 2px dashed rgba(122,34,40,0.4);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: border-color 0.2s;
}
.db-upload-box:hover { border-color: var(--red-glow); }
.db-upload-box i { color: var(--red-glow); }
.db-upload-box h3 { font-size: 1rem; color: var(--white); }
.db-upload-box p  { font-size: 0.82rem; color: var(--gray-text); }

/* ── Profile card ── */
.db-profile-card { display: flex; align-items: center; gap: 2rem; padding: 2rem; flex-wrap: wrap; }
.db-profile-avatar { color: var(--red-glow); }
.db-profile-info { display: flex; flex-direction: column; gap: 0.5rem; }
.db-profile-name  { font-size: 1.4rem; font-weight: 800; color: var(--white); }
.db-profile-role  { }
.db-profile-email { font-size: 0.9rem; color: var(--gray-text); }

/* ── Empty state ── */
.db-empty-full {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--gray-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.db-empty-full i { color: rgba(122,34,40,0.4); }
.db-empty-full p  { font-size: 0.9rem; }

/* ── Misc ── */
.db-info-text { color: var(--gray-text); font-size: 0.9rem; line-height: 1.6; }
.db-link { color: var(--red-glow); text-decoration: underline; }
.mt-1 { margin-top: 0.5rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .db-layout    { flex-direction: column; }
  .db-sidebar   { width: 100%; height: auto; position: static; }
  .db-nav       { flex-direction: row; flex-wrap: wrap; }
  .db-dual-grid { grid-template-columns: 1fr; }
  .db-permissions-box { display: none; }
}


/* =====================================================
   AUTH PAGES  (Login / Register)
   ===================================================== */

.auth-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at top, rgba(122,34,40,0.12) 0%, transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--dark-card);
  border-radius: 20px;
  border: 1px solid rgba(122,34,40,0.25);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.auth-logo { text-align: center; margin-bottom: 1.25rem; }
.auth-logo-img { height: 80px; filter: drop-shadow(0 0 12px var(--red-glow)); }

.auth-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--white);
  text-align: center;
  margin: 0 0 0.3rem;
}

.auth-sub {
  font-size: 0.85rem;
  color: var(--white);
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-error {
  background: rgba(200,40,40,0.18);
  border: 1px solid rgba(200,40,40,0.45);
  color: #ffaaaa;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.auth-field { display: flex; flex-direction: column; gap: 0.35rem; }

.auth-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
}

.auth-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  padding: 0.6rem 0.9rem;
  color: var(--white);
  font-size: 0.88rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
  direction: rtl;
}

.auth-input:focus {
  outline: none;
  border-color: var(--red-glow);
  box-shadow: 0 0 0 3px rgba(122,34,40,0.2);
}

.auth-select { cursor: pointer; }

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--red-dark), var(--red-glow));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  margin-top: 0.25rem;
  text-decoration: none;
}

.auth-btn:hover { opacity: 0.88; transform: translateY(-1px); color: var(--white); }

.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--white);
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  align-items: center;
}

.auth-links a { color: var(--white); text-decoration: none; font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }

/* ── Social Login / Signup Buttons ───────────────────────────────── */
.auth-social-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0 1rem;
  color: var(--white);
  font-size: .8rem;
}
.auth-social-divider::before,
.auth-social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.12);
}

.auth-social-btns { display: flex; flex-direction: column; gap: .55rem; }

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .62rem 1rem;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  border: none;
  cursor: pointer;
}
.auth-social-btn:hover { transform: translateY(-1px); opacity: .93; }
.auth-social-btn:active { transform: translateY(0); }

/* Google */
.auth-social-btn.google { background: #1f2937; color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.18); }
.auth-social-btn.google:hover { box-shadow: 0 3px 10px rgba(60,64,67,.35); }

/* Facebook */
.auth-social-btn.facebook { background: #1877f2; color: #fff; }
.auth-social-btn.facebook:hover { background: #1060cb; box-shadow: 0 3px 10px rgba(24,119,242,.4); }

/* Apple */
.auth-social-btn.apple { background: #000; color: #fff; }
.auth-social-btn.apple:hover { background: #1a1a1a; box-shadow: 0 3px 10px rgba(0,0,0,.5); }

.auth-social-note {
  text-align: center;
  font-size: .72rem;
  color: var(--white);
  margin: .6rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

/* ── Email Verification (OTP) Page ───────────────────────────────── */
.verify-card { max-width: 420px; }

.verify-icon-wrap {
  text-align: center;
  margin-bottom: .5rem;
}
.verify-icon {
  font-size: 2.8rem;
  color: var(--red-glow);
  animation: pulse-icon 2s ease-in-out infinite;
}
@keyframes pulse-icon {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%       { opacity: .7; transform: scale(1.08); }
}

.verify-email-masked {
  color: var(--red-glow);
  font-style: normal;
}

/* 6-box OTP input */
.otp-inputs {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin: 1.4rem 0 .5rem;
  direction: ltr; /* digits always LTR */
}
.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
  caret-color: var(--red-glow);
}
.otp-digit:focus {
  border-color: var(--red-glow);
  background: rgba(229,57,53,.08);
  box-shadow: 0 0 0 3px rgba(229,57,53,.2);
}
.otp-digit:not(:placeholder-shown) {
  border-color: rgba(229,57,53,.5);
  background: rgba(229,57,53,.05);
}

.otp-hint {
  text-align: center;
  font-size: .78rem;
  color: var(--gray-text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}

/* Resend form */
.verify-resend-form { text-align: center; margin-top: 1rem; }
.verify-resend-text {
  font-size: .82rem;
  color: var(--gray-text);
  margin-bottom: .4rem;
}
.verify-resend-btn {
  background: none;
  border: 1px solid rgba(229,57,53,.4);
  color: var(--red-glow);
  border-radius: 8px;
  padding: .4rem 1.1rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.verify-resend-btn:hover { background: rgba(229,57,53,.12); }

/* Info message (non-error flash) */
.auth-info-msg {
  background: rgba(33,150,243,.12);
  border: 1px solid rgba(33,150,243,.3);
  border-radius: 10px;
  padding: .65rem 1rem;
  color: #90caf9;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
}

/* Demo box */
.auth-demo-box {
  margin-top: 1.5rem;
  background: rgba(0,0,0,0.3);
  border: 1px dashed rgba(122,34,40,0.4);
  border-radius: 12px;
  padding: 1rem;
}

.auth-demo-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-text);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-demo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
}

.auth-demo-row:last-child { margin-bottom: 0; }

.auth-demo-role {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-demo-role.instructor { background: rgba(30,80,200,0.3); color: #aaccff; }
.auth-demo-role.student    { background: rgba(30,140,80,0.3);  color: #aaffcc; }

.auth-demo-row code {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  color: #e0e0e0;
  font-family: monospace;
  cursor: text;
  user-select: all;
}

/* Nav username display */
.nav-user-info { display: flex; align-items: center; }
.nav-username {
  font-size: 0.8rem;
  color: var(--gray-text);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}
.nav-username i { color: var(--red-glow); }


/* ============================
   CLICKABLE STAT CARDS
============================= */
.db-stat-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: 16px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.db-stat-link:hover .db-stat-card {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  cursor: pointer;
}

/* ============================
   COURSE LINK CARD (discussions)
============================= */
.db-course-link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.18s, transform 0.18s;
}
.db-course-link-card:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-2px);
  color: var(--red-glow);
}
.db-course-link-card small {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================
   DISCUSSION BOARD
============================= */
.db-disc-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,0.07);
}
.db-disc-textarea {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  direction: rtl;
}
.db-disc-textarea:focus {
  outline: none;
  border-color: var(--red-glow);
  background: rgba(255,255,255,0.1);
}
.db-disc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.db-disc-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.db-disc-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 16px;
  direction: rtl;
  transition: background 0.15s;
}
.db-disc-item.pinned {
  border-color: rgba(255, 200, 60, 0.4);
  background: rgba(255, 200, 60, 0.06);
}
.db-disc-item.reply {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.92rem;
}
.db-disc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.db-disc-user {
  color: var(--red-glow);
  font-size: 0.95rem;
}
.db-disc-time {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-right: auto;
}
.db-disc-msg {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 10px;
  white-space: pre-wrap;
}
.db-disc-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.db-disc-replies {
  margin-top: 12px;
  margin-right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 2px solid rgba(255,255,255,0.1);
  padding-right: 12px;
}
.db-btn-icon {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0 4px;
  font-size: 0.85rem;
}

/* ============================
   RATINGS
============================= */
.db-rating-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.db-existing-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.db-rating-stars {
  font-size: 1.25rem;
  letter-spacing: 2px;
}
.db-rating-stars.gold { color: #f0b429; }
.db-review-text {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 4px 0 0;
  width: 100%;
}
.db-rating-toggle summary {
  list-style: none;
  cursor: pointer;
}
.db-rating-toggle summary::-webkit-details-marker { display: none; }
.db-rating-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 0;
}
/* CSS-only star rating (RTL) */
.db-star-input {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 4px;
  direction: ltr;
}
.db-star-input input { display: none; }
.db-star-input label {
  font-size: 1.6rem;
  color: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: color 0.15s;
}
.db-star-input input:checked ~ label,
.db-star-input label:hover,
.db-star-input label:hover ~ label {
  color: #f0b429;
}
.db-rating-stars.stars { color: #f0b429; font-size: 1.1rem; }

/* ============================
   OWNER ACTION CELLS
============================= */
.db-action-cell {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}
.db-btn-icon-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: opacity 0.15s, transform 0.12s;
  color: #fff;
}
.db-btn-icon-sm:hover { opacity: 0.85; transform: scale(1.08); }
.db-btn-icon-sm.red    { background: var(--red-glow, #e05252); }
.db-btn-icon-sm.green  { background: #27ae60; }
.db-btn-icon-sm.orange { background: #e67e22; }
.db-btn-icon-sm.blue   { background: #2980b9; }

/* Inactive course card dim */
.inactive-course { opacity: 0.6; }
.inactive-course .db-course-title { text-decoration: line-through; }

/* ============================
   MISC HELPERS
============================= */
.db-pill.gold  { background: rgba(240,180,41,0.18); color: #f0b429; border: 1px solid rgba(240,180,41,0.3); }
.db-pill.teal  { background: rgba(26,188,156,0.18); color: #1abc9c; border: 1px solid rgba(26,188,156,0.3); }
.db-pill.red   { background: rgba(224,82,82,0.18); color: #e05252; border: 1px solid rgba(224,82,82,0.3); }
.db-pill.orange{ background: rgba(230,126,34,0.18); color: #e67e22; border: 1px solid rgba(230,126,34,0.3); }
.db-pill.blue  { background: rgba(41,128,185,0.18); color: #2980b9; border: 1px solid rgba(41,128,185,0.3); }
.db-pill.green { background: rgba(39,174,96,0.18); color: #27ae60; border: 1px solid rgba(39,174,96,0.3); }
.db-btn-sm.teal  { background: rgba(26,188,156,0.2); color: #1abc9c; border: 1px solid rgba(26,188,156,0.4); }
.db-btn-sm.gold  { background: rgba(240,180,41,0.2); color: #f0b429; border: 1px solid rgba(240,180,41,0.4); }
.db-btn-sm.ml-auto { margin-right: auto; margin-left: 0; }
.mt-1 { margin-top: 8px; }


/* ============================
   COURSE THUMBNAIL (home page cards)
============================= */
.course-card-with-thumb {
  padding: 0 !important;
  overflow: hidden;
}
.course-card-thumb-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: #1a1a2e;
}
.course-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.course-card-with-thumb:hover .course-card-thumb {
  transform: scale(1.06);
}
.course-card-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(10,10,20,0.7) 100%);
  pointer-events: none;
}
.course-card-with-thumb .card-body {
  padding: 16px 18px 18px;
}

/* ============================
   COURSE THUMBNAIL (dashboard cards)
============================= */
.db-course-thumb-wrap {
  position: relative;
  width: 100%;
  height: 148px;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: #151525;
  margin: -1px -1px 0;
}
.db-course-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.db-course-card:hover .db-course-thumb {
  transform: scale(1.05);
}
.db-course-thumb-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.db-course-thumb-badge.red {
  background: rgba(192,57,43,0.85);
  color: #fff;
}
/* Adjust card padding when thumb is present */
.db-course-card {
  padding: 0;
  overflow: hidden;
}
.db-course-card .db-course-title,
.db-course-card .db-course-meta,
.db-course-card .db-course-desc,
.db-course-card .db-course-actions,
.db-course-card .db-rating-section,
.db-course-card .db-rating-stars {
  padding-left: 14px;
  padding-right: 14px;
}
.db-course-card .db-course-title {
  padding-top: 12px;
}
.db-course-card .db-course-actions {
  padding-bottom: 12px;
}
