/* ===================================================
   بوابة التربية الصحية والبدنية (1-1) - الصف الأول ثانوي
   الوحدة الرابعة: مهارات وقوانين وممارسة كرة الطاولة واستثمار الوقت الحر
   نظام المسارات - المملكة العربية السعودية • وزارة التعليم
   إعداد وتصميم: أ / ثامر بن محمد العمير • إدارة: أ / أحمد مصلح الشمراني
   المدرسة المركزية بالمنطقة الشرقية
   =================================================== */

:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: #38bdf8;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --secondary-light: #34d399;
    --accent: #f59e0b;
    --accent-gold: #fbbf24;
    --accent-orange: #ea580c;
    --tt-ball: #f97316;
    --tt-table-blue: #1d4ed8;
    --tt-table-green: #15803d;
    --tt-rubber-red: #dc2626;
    --tt-rubber-black: #1e293b;
    --danger: #ef4444;

    /* Dark Mode (Default) */
    --bg-main: #090e17;
    --bg-surface: #0f172a;
    --bg-card: #182234;
    --bg-card-hover: #1f2d45;
    --bg-alt: #0b1322;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(56, 189, 248, 0.4);
    --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(2, 132, 199, 0.22);
    --nav-bg: rgba(9, 14, 23, 0.94);

    --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.94);
}

/* Base Styles */
* {
    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);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, var(--primary-light), var(--accent-gold), var(--secondary-light));
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease-out;
}

/* Container */
.container {
    width: 90%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: rgba(56, 189, 248, 0.08);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary-light);
}

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

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

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 1300px;
    margin: 0 auto;
}

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

.logo-icon {
    font-size: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.2), rgba(16, 185, 129, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: var(--radius-md);
}

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

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

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

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

/* Hero Section */
.hero-section {
    position: relative;
    padding: 60px 0 50px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 10%, rgba(2, 132, 199, 0.15) 0%, transparent 65%);
}

.hero-glow {
    position: absolute;
    top: -120px;
    right: 20%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.12), transparent 70%);
    filter: blur(50px);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(2, 132, 199, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 20px;
}

.tag-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-light);
    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; }
}

/* Teacher Credential Box */
.teacher-credential-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    max-width: 960px;
    margin: 0 auto 30px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
    text-align: right;
}

[data-theme="light"] .teacher-credential-box {
    background: linear-gradient(135deg, #f0fdf4, #e0f2fe);
    border-color: rgba(2, 132, 199, 0.35);
}

.teacher-avatar-emblem {
    font-size: 2.4rem;
    background: rgba(2, 132, 199, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.teacher-details {
    flex-grow: 1;
}

.teacher-role-tag {
    font-size: 0.8rem;
    color: var(--accent-gold);
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.teacher-name-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.teacher-school-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.school-director-badge {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    text-align: center;
    flex-shrink: 0;
}

[data-theme="light"] .school-director-badge {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
}

.director-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.director-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

.hero-title {
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1.35;
    margin-bottom: 16px;
}

.gradient-text {
    background: linear-gradient(135deg, #38bdf8, #34d399, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 860px;
    margin: 0 auto 28px;
    line-height: 1.8;
}

.hero-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
}

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

.stat-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    text-align: right;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.stat-box:hover {
    transform: translateY(-3px);
    border-color: var(--border-highlight);
}

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

.stat-icon-wrap.blue { background: rgba(2, 132, 199, 0.15); color: #38bdf8; }
.stat-icon-wrap.green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon-wrap.orange { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.stat-icon-wrap.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

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

/* Sections */
.section {
    padding: 70px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-alt {
    background-color: var(--bg-alt);
}

.section-header {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 40px;
}

.section-badge {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(2, 132, 199, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 12px;
}
.section-badge.green { background: rgba(16, 185, 129, 0.12); border-color: rgba(52, 211, 153, 0.3); color: #34d399; }
.section-badge.gold { background: rgba(245, 158, 11, 0.12); border-color: rgba(251, 191, 36, 0.3); color: #fbbf24; }
.section-badge.purple { background: rgba(168, 85, 247, 0.12); border-color: rgba(192, 132, 252, 0.3); color: #c084fc; }

.section-title {
    font-size: 1.85rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 0.98rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Feature Media Showcase Card */
.feature-media-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--card-shadow);
    align-items: center;
}

.feature-media-img {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
    display: block;
}

.feature-media-body {
    padding: 30px;
}

.card-list {
    list-style: none;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-list li {
    position: relative;
    padding-right: 22px;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.card-list li::before {
    content: "🏓";
    position: absolute;
    right: 0;
    top: 2px;
    font-size: 0.85rem;
}

/* Technical Specs & Comparison Cards */
.skills-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.spec-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.spec-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
}

.spec-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.spec-card-icon {
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(2, 132, 199, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spec-card-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.spec-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-steps li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.spec-steps li strong {
    color: var(--primary-light);
    display: block;
    margin-bottom: 2px;
}

/* Callout Box */
.callout-box {
    background: rgba(2, 132, 199, 0.08);
    border-right: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 20px 0;
}
.callout-box.gold {
    background: rgba(245, 158, 11, 0.08);
    border-right-color: var(--accent-gold);
}
.callout-box.green {
    background: rgba(16, 185, 129, 0.08);
    border-right-color: var(--secondary);
}

.callout-title {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.callout-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Common Errors Table */
.errors-table-wrap {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 24px;
}

.errors-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.92rem;
}

.errors-table th, .errors-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.errors-table th {
    background: rgba(2, 132, 199, 0.12);
    color: var(--text-primary);
    font-weight: 800;
}

.errors-table tr:last-child td {
    border-bottom: none;
}

/* ===================================================
   محاكي طاولة كرة الطاولة والمسارات التفاعلي (Simulator)
   =================================================== */
.simulator-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
}

.sim-controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sim-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sim-mode-btn {
    padding: 8px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sim-mode-btn.active, .sim-mode-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary-light);
}

.sim-display-area {
    position: relative;
    background: #08101e;
    border-radius: var(--radius-md);
    padding: 16px;
    overflow: hidden;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.table-tennis-svg {
    width: 100%;
    max-width: 880px;
    height: auto;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6));
}

.sim-info-panel {
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.sim-info-item {
    font-size: 0.88rem;
}
.sim-info-item strong {
    color: var(--primary-light);
    display: block;
    margin-bottom: 4px;
}
.sim-info-item span {
    color: var(--text-secondary);
}

/* ===================================================
   حاسبة النقاط والتدوير ITTF (Scoreboard)
   =================================================== */
.scoreboard-wrapper {
    background: linear-gradient(135deg, #0b1528, #13223f);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
    text-align: center;
}

.scoreboard-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.player-panel {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    position: relative;
    transition: all var(--transition-normal);
}

.player-panel.serving {
    border-color: var(--accent-gold);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.server-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--accent-gold);
    color: #000000;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    display: none;
}

.player-panel.serving .server-badge {
    display: inline-block;
}

.player-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.score-digit {
    font-size: 4rem;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    margin-bottom: 12px;
}

.score-btn-add {
    padding: 10px 20px;
    width: 100%;
    font-size: 1rem;
    font-weight: 800;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.score-btn-add:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: scale(1.02);
}

.score-vs-divider {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent-gold);
}

.deuce-alert-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: var(--radius-full);
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: #fca5a5;
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 16px;
    display: none;
}

.scoreboard-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ===================================================
   مختبر التحكيم وصافرة الحكم الافتراضية (Referee Lab)
   =================================================== */
.referee-lab-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--card-shadow);
}

.whistle-station {
    text-align: center;
    padding: 24px;
    background: rgba(2, 132, 199, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 28px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.whistle-btn {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: 4px solid #fef3c7;
    font-size: 2.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
    outline: none;
    margin-bottom: 10px;
}
.whistle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.6);
}
.whistle-btn:active {
    transform: scale(0.95);
}

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

.situation-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: all var(--transition-fast);
}
.situation-card:hover {
    border-color: var(--primary-light);
}

.situation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.situation-icon {
    font-size: 1.4rem;
}
.situation-title {
    font-size: 1rem;
    font-weight: 800;
}

.situation-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
}

.situation-decision {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.6;
    border-right: 3px solid var(--accent-gold);
}
.situation-decision strong {
    color: var(--accent-gold);
    display: block;
    margin-bottom: 2px;
}

/* ===================================================
   حاسبة استثمار الوقت الحر (Leisure Time Calculator)
   =================================================== */
.leisure-calc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.leisure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.input-slider-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calc-input-row {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}

.calc-input-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.calc-slider {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.leisure-results-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.result-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.result-metric-row:last-child {
    border-bottom: none;
}

.result-val {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--primary-light);
}

.vision-bar-container {
    margin-top: 16px;
}

.vision-bar-track {
    background: rgba(255, 255, 255, 0.08);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-top: 6px;
}

.vision-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #0284c7);
    border-radius: 6px;
    width: 60%;
    transition: width 0.4s ease;
}

/* ===================================================
   بطاقات التقليب التفاعلية ولعبة المطابقة
   =================================================== */
.flip-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.flip-card {
    background: transparent;
    perspective: 1000px;
    height: 220px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.flip-front, .flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flip-front {
    background: var(--bg-card);
}

.flip-back {
    background: linear-gradient(135deg, var(--bg-surface), #182740);
    transform: rotateY(180deg);
    border-color: var(--primary-light);
}

.flip-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.flip-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.flip-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===================================================
   الاختبار المعياري الشامل (20 سؤالاً مع التغذية الفورية)
   =================================================== */
.quiz-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--card-shadow);
    margin-top: 20px;
}

.quiz-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.quiz-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

.quiz-questions-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.quiz-question-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: all var(--transition-fast);
}

.quiz-q-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-light);
    display: inline-block;
    margin-bottom: 8px;
}

.quiz-q-text {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.65;
    margin-bottom: 16px;
}

.quiz-options-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.quiz-option-btn {
    text-align: right;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.92rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.6;
}

.quiz-option-btn:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--primary-light);
}

.quiz-option-btn.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--secondary) !important;
    color: #6ee7b7 !important;
    font-weight: 700;
}

.quiz-option-btn.wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--danger) !important;
    color: #fca5a5 !important;
}

.quiz-feedback-box {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.7;
    display: none;
    border-right: 4px solid transparent;
}

/* Digital Certificate Card */
.certificate-card {
    background: radial-gradient(circle at center, #1e293b, #0f172a);
    border: 4px double var(--accent-gold);
    border-radius: var(--radius-lg);
    padding: 34px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    margin-top: 30px;
    display: none;
    position: relative;
}

.cert-header {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.cert-student-name {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffffff;
    margin: 14px 0;
    border-bottom: 2px dashed rgba(251, 191, 36, 0.4);
    display: inline-block;
    padding: 0 30px 8px;
}

.cert-body {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 650px;
    margin: 0 auto 20px;
}

.cert-signatures {
    display: flex;
    justify-content: space-around;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-sig-block {
    text-align: center;
}
.cert-sig-title {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.cert-sig-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* ===================================================
   وضع عرض الشاشات الذكية (Presentation Mode)
   =================================================== */
.presentation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #090e17;
    z-index: 2000;
    display: none;
    flex-direction: column;
    padding: 24px 30px;
}

.presentation-overlay.active {
    display: flex;
}

.pres-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pres-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #38bdf8;
}

.pres-slide-counter {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--accent-gold);
}

.pres-controls-top {
    display: flex;
    gap: 10px;
}

.pres-viewport {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.pres-slide {
    display: none;
    width: 100%;
    max-width: 980px;
}

.pres-slide.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.slide-content-card {
    background: #131d2e;
    border: 2px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.slide-badge {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-gold);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.slide-title {
    font-size: 1.9rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 22px;
}

.slide-points-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.slide-points-list li {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #cbd5e1;
    position: relative;
    padding-right: 28px;
}

.slide-points-list li::before {
    content: "✦";
    position: absolute;
    right: 0;
    color: #38bdf8;
    font-size: 1.1rem;
}

.pres-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pres-nav-btn {
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 800;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.pres-nav-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary-light);
}
.pres-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Printable Rubric Section */
.printable-rubric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 30px;
}

.rubric-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 0.9rem;
}

.rubric-table th, .rubric-table td {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    text-align: right;
}

.rubric-table th {
    background: rgba(2, 132, 199, 0.12);
    font-weight: 800;
}

/* Footer */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 50px 0 30px;
    margin-top: 70px;
    text-align: center;
}

.footer-logo-title {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.footer-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 20px;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 24px;
}

/* Media Queries */
@media (max-width: 900px) {
    .feature-media-card {
        grid-template-columns: 1fr;
    }
    .feature-media-img {
        min-height: 260px;
    }
    .teacher-credential-box {
        flex-direction: column;
        text-align: center;
    }
    .teacher-school-desc {
        justify-content: center;
    }
    .scoreboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .score-vs-divider {
        display: none;
    }
    .leisure-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .navbar, .hero-section, .simulator-box, .scoreboard-wrapper, .referee-lab-card, .quiz-wrapper, .site-footer, .btn, .presentation-overlay {
        display: none !important;
    }
    .printable-rubric-card, .certificate-card {
        display: block !important;
        border: 2px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
}
