/* ===================================================
   بوابة التربية الصحية والبدنية الرقمية - المرحلة الثانوية
   نظام المسارات - المملكة العربية السعودية
   صفحة التوجيه والتنقل الشاملة لجميع الدروس والوحدات
   =================================================== */

:root {
    --primary: #0284c7;
    --primary-light: #38bdf8;
    --secondary: #10b981;
    --secondary-light: #34d399;
    --accent: #f97316;
    --accent-gold: #f59e0b;
    --purple: #8b5cf6;

    /* Dark Mode (Default) */
    --bg-main: #0b1120;
    --bg-surface: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #273549;
    --bg-alt: #070c18;
    --border-color: rgba(255, 255, 255, 0.09);
    --border-highlight: rgba(56, 189, 248, 0.35);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --card-glow: 0 0 25px rgba(14, 165, 233, 0.15);
    --nav-bg: rgba(11, 17, 32, 0.92);

    --font-main: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-alt: #f1f5f9;
    --border-color: #e2e8f0;
    --border-highlight: rgba(2, 132, 199, 0.5);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --card-glow: 0 0 20px rgba(2, 132, 199, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.92);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 85px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.75;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, #34d399 50%, #fb923c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    z-index: 900;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
    width: 92%;
    max-width: 1300px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.logo-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
}

.logo-badge {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--primary-light);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-highlight);
}

.sound-toggle-btn {
    width: auto;
    padding: 0 14px;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 700;
}

/* Hero Section */
.hero-section {
    padding: 70px 0 50px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-glow {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, rgba(16, 185, 129, 0.15) 50%, transparent 70%);
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 22px;
}

/* Teacher & School Official Credential Card */
.teacher-credential-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-lg);
    padding: 24px 30px;
    max-width: 960px;
    margin: 0 auto 36px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(14, 165, 233, 0.15);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    text-align: right;
    position: relative;
    overflow: hidden;
}

.teacher-credential-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary-light), var(--secondary-light), var(--accent));
}

.teacher-avatar-emblem {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.teacher-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.teacher-role-tag {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.teacher-name-title {
    font-size: 1.55rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.25;
}

.teacher-school-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.teacher-school-desc span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.school-director-badge {
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.35);
    padding: 12px 20px;
    border-radius: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.director-label {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 800;
}

.director-name {
    font-size: 1.05rem;
    font-weight: 900;
    color: #ffffff;
}

@media (max-width: 820px) {
    .teacher-credential-box {
        grid-template-columns: 1fr;
        text-align: center;
        justify-items: center;
    }
    .teacher-school-desc {
        justify-content: center;
    }
}

.tag-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 10px #38bdf8;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 35px;
}

/* Stats Overview Bar */
.portal-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto 50px;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-fast);
}

.stat-box:hover {
    transform: translateY(-3px);
    border-color: var(--border-highlight);
}

.stat-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-icon-wrap.blue { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.stat-icon-wrap.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon-wrap.orange { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.stat-icon-wrap.purple { background: rgba(139, 92, 246, 0.15); color: #c084fc; }

.stat-info {
    text-align: right;
}

.stat-number {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Search & Filter Controls */
.controls-section {
    margin-bottom: 40px;
}

.search-filter-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--card-shadow);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 46px 12px 18px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.grade-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-pill:hover, .filter-pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

/* Grade Section Titles */
.grade-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 45px 0 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.grade-tag {
    background: rgba(14, 165, 233, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 800;
}

.grade-tag.green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.grade-section-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
}

.grade-section-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-right: auto;
}

/* Units Grid */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.unit-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    outline: none;
}

.unit-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-6px);
    box-shadow: var(--card-shadow), var(--card-glow);
}

.unit-card:focus-visible {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.4), var(--card-shadow);
}

.unit-card-banner {
    height: 140px;
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.banner-fitness-1 {
    background: linear-gradient(135deg, #065f46, #047857, #0284c7);
}

.banner-fitness-2 {
    background: linear-gradient(135deg, #1e3a8a, #0369a1, #0f766e);
}

.banner-handball {
    background: linear-gradient(135deg, #1e293b, #c2410c, #b45309);
}

.unit-banner-overlay {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 7rem;
    opacity: 0.15;
    pointer-events: none;
    user-select: none;
}

.unit-badge-grade {
    display: inline-block;
    align-self: flex-start;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.unit-banner-title {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.unit-card-body {
    padding: 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.unit-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.features-list li {
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.features-list li::before {
    content: '✓';
    color: var(--secondary);
    font-weight: 900;
}

.unit-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.unit-pill {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.unit-actions-row {
    margin-top: auto;
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.92rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0284c7);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-highlight);
}

/* Quick Tools Drawer */
.quick-tools-section {
    margin: 60px 0;
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 35px;
}

.quick-tools-header {
    text-align: center;
    margin-bottom: 30px;
}

.quick-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.tool-shortcut-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all var(--transition-fast);
}

.tool-shortcut-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--card-shadow);
}

.tool-shortcut-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.tool-shortcut-card h4 {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.tool-shortcut-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}

.tool-target-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-top: 6px;
}

/* Footer */
.footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    padding: 50px 0 24px;
    margin-top: 60px;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-info {
    max-width: 600px;
}

.footer-info h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.footer-info p {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-vision {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: var(--radius-md);
}

.vision-logo {
    font-size: 2rem;
}

.vision-text strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.vision-text span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    .search-filter-wrapper {
        flex-direction: column;
    }
    .grade-filter-pills {
        width: 100%;
        justify-content: center;
    }
}

.banner-football {
    background: linear-gradient(135deg, #043826, #065f46, #0284c7);
}
