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

:root {
    --primary: #ea580c;
    --primary-dark: #c2410c;
    --primary-light: #f97316;
    --secondary: #0284c7;
    --secondary-dark: #0369a1;
    --secondary-light: #38bdf8;
    --accent: #f59e0b;
    --accent-gold: #facc15;
    --court-wood: #78350f;
    --court-floor: #b45309;
    --court-key: #0284c7;
    --danger: #ef4444;
    --success: #22c55e;

    /* Dark Mode (Default) */
    --bg-main: #0b1120;
    --bg-surface: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #273549;
    --bg-alt: #0a0f1d;
    --border-color: rgba(255, 255, 255, 0.09);
    --border-highlight: rgba(249, 115, 22, 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(234, 88, 12, 0.22);
    --nav-bg: rgba(11, 17, 32, 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(234, 88, 12, 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(234, 88, 12, 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;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5);
    color: #ffffff;
}

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

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

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

.btn-outline:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: var(--primary-light);
    color: var(--primary-light);
}

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

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

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

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

.nav-container {
    width: 90%;
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(234, 88, 12, 0.3));
    border: 1px solid rgba(249, 115, 22, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

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

.logo-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.3;
}

.logo-badge {
    font-size: 0.76rem;
    color: var(--text-muted);
}

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

/* Hero Section */
.hero-section {
    position: relative;
    padding: 60px 0 50px;
    background: radial-gradient(circle at 50% 20%, rgba(234, 88, 12, 0.15) 0%, transparent 70%);
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.hero-glow {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 350px;
    background: radial-gradient(ellipse, rgba(249, 115, 22, 0.25), transparent 70%);
    filter: blur(80px);
    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;
    border-radius: var(--radius-full);
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 24px;
}

.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%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

/* Teacher Credential Box */
.teacher-credential-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    max-width: 860px;
    margin: 0 auto 30px;
    text-align: right;
    box-shadow: var(--card-shadow);
    flex-wrap: wrap;
}

.teacher-avatar-emblem {
    font-size: 2.4rem;
    line-height: 1;
}

.teacher-details {
    flex: 1;
    min-width: 250px;
}

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

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

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

.school-director-badge {
    text-align: left;
    border-right: 2px solid var(--border-color);
    padding-right: 18px;
    display: flex;
    flex-direction: column;
}

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

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

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

.gradient-text {
    background: linear-gradient(135deg, #f97316 0%, #facc15 50%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 880px;
    margin: 0 auto 30px;
    line-height: 1.9;
}

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

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

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

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

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

.stat-icon-wrap.orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.stat-icon-wrap.blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.stat-icon-wrap.green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.stat-icon-wrap.gold { background: rgba(250, 204, 21, 0.15); color: #facc15; }

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

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

/* Sections */
.section {
    padding: 70px 0;
    position: relative;
}

.section-alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

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

.section-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.35);
    color: var(--primary-light);
    font-size: 0.82rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.section-badge.blue {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.35);
    color: var(--secondary-light);
}

.section-badge.gold {
    background: rgba(250, 204, 21, 0.12);
    border-color: rgba(250, 204, 21, 0.35);
    color: var(--accent-gold);
}

.section-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 14px;
    line-height: 1.35;
}

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

/* Feature Media Showcase Card */
.feature-media-card {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    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;
    max-height: 480px;
    object-fit: cover;
    display: block;
}

.feature-media-body {
    padding: 34px 34px 34px 20px;
}

/* Grids & Cards */
.cards-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 26px;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-normal);
    position: relative;
}

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

.card-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(249, 115, 22, 0.15);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 18px;
}

.card-icon-badge.blue {
    background: rgba(56, 189, 248, 0.15);
    color: var(--secondary-light);
}

.card-icon-badge.gold {
    background: rgba(250, 204, 21, 0.15);
    color: var(--accent-gold);
}

.card-icon-badge.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

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

.card-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 14px;
}

.card-list {
    list-style: none;
    font-size: 0.88rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-list li {
    position: relative;
    padding-right: 18px;
}

.card-list li::before {
    content: "•";
    position: absolute;
    right: 0;
    color: var(--primary-light);
    font-weight: bold;
    font-size: 1.1rem;
}

/* Beef Technique Box */
.beef-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin: 30px 0;
    box-shadow: var(--card-shadow);
}

.beef-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.beef-letter-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-fast);
}

.beef-letter-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

.beef-letter {
    display: inline-block;
    width: 48px;
    height: 48px;
    line-height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #fff;
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 10px;
}

/* Tactical Court Simulator */
.court-sim-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.court-controls-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

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

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

.court-mode-btn.active {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.4);
}

.court-canvas-box {
    max-width: 820px;
    margin: 0 auto 24px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    background: #78350f;
}

.court-svg {
    width: 100%;
    height: auto;
    display: block;
}

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

.court-info-item h5 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.court-info-item p {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-light);
}

/* Shot Clock & Referee Simulator */
.shotclock-referee-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 34px;
    box-shadow: var(--card-shadow);
}

.shotclock-display-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.shotclock-device {
    background: #000000;
    border: 4px solid #334155;
    border-radius: var(--radius-md);
    padding: 20px 30px;
    text-align: center;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.4);
    min-width: 200px;
}

.shotclock-label {
    font-size: 0.82rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.shotclock-digits {
    font-size: 4.5rem;
    font-weight: 900;
    color: #ef4444;
    font-family: 'Courier New', monospace, monospace;
    line-height: 1;
    text-shadow: 0 0 20px #ef4444;
}

.shotclock-digits.running {
    color: #facc15;
    text-shadow: 0 0 20px #facc15;
}

.shotclock-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Soundboard Grid */
.soundboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 25px 0 35px;
}

.soundboard-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.soundboard-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.soundboard-icon {
    font-size: 1.5rem;
}

/* Referee Scenarios */
.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.scenario-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scenario-badge {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: rgba(249, 115, 22, 0.15);
    color: var(--primary-light);
    font-size: 0.75rem;
    font-weight: 800;
}

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

.scenario-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scenario-btn {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.82rem;
    cursor: pointer;
    text-align: right;
    transition: all var(--transition-fast);
}

.scenario-btn:hover {
    border-color: var(--primary-light);
}

.scenario-btn.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #4ade80;
    font-weight: 700;
}

.scenario-btn.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}

.scenario-feedback {
    display: none;
    font-size: 0.82rem;
    line-height: 1.6;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.6);
    border-left: 3px solid var(--primary-light);
}

/* Basketball Scoreboard */
.scoreboard-box {
    background: #090d16;
    border: 2px solid #334155;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    max-width: 900px;
    margin: 0 auto;
}

.scoreboard-display {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: center;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.sb-header-cell {
    font-size: 0.78rem;
    color: #94a3b8;
    text-align: center;
    font-weight: 800;
}

.sb-player-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sb-score-cell {
    font-size: 1.8rem;
    font-weight: 900;
    text-align: center;
    color: #facc15;
    font-family: 'Courier New', monospace;
    background: #000;
    border-radius: 6px;
    padding: 4px;
    border: 1px solid #334155;
}

.sb-action-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.sb-announcement-box {
    background: #1e293b;
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 0.9rem;
    color: #f8fafc;
    text-align: center;
    border: 1px dashed var(--border-color);
}

/* Flip Cards */
.flip-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.flip-card {
    height: 240px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

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

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

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

.flip-card-back {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    transform: rotateY(180deg);
    border-color: var(--primary-light);
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.8;
}

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

.flip-card-hint {
    font-size: 0.75rem;
    color: var(--accent-gold);
    margin-top: 10px;
}

/* Matching Game */
.matching-game-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.matching-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.match-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1.6;
}

.match-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.match-card.selected {
    background: rgba(249, 115, 22, 0.2);
    border-color: var(--primary-light);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.match-card.matched {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #4ade80;
    cursor: default;
    opacity: 0.85;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.video-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 6px;
}

.video-content h4 {
    font-size: 1.05rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.video-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}

.btn-yt {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: #ff0000;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    align-self: flex-start;
    transition: opacity var(--transition-fast);
}

.btn-yt:hover {
    opacity: 0.9;
}

/* Quiz Section */
.quiz-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 34px;
    box-shadow: var(--card-shadow);
}

.quiz-progress-bar-box {
    margin-bottom: 24px;
}

.quiz-progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

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

.quiz-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.quiz-question-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 20px;
}

.q-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.q-num-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.q-title {
    font-size: 1.05rem;
    font-weight: 800;
}

.q-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.q-opt-btn {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: right;
    transition: all var(--transition-fast);
}

.q-opt-btn:hover {
    border-color: var(--primary-light);
}

.q-opt-btn.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #4ade80;
    font-weight: 700;
}

.q-opt-btn.wrong {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #f87171;
}

.q-feedback {
    display: none;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.8);
    border-left: 3px solid var(--accent-gold);
    font-size: 0.88rem;
    line-height: 1.7;
}

/* Certificate Card */
.certificate-card {
    display: none;
    margin-top: 35px;
    background: radial-gradient(circle at center, #1e293b, #0b1120);
    border: 3px solid var(--accent-gold);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 40px rgba(250, 204, 21, 0.25);
}

.cert-emblem {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.cert-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.cert-student-name {
    font-size: 1.6rem;
    font-weight: 900;
    color: #38bdf8;
    margin: 14px 0;
    border-bottom: 2px dashed rgba(56, 189, 248, 0.4);
    display: inline-block;
    padding: 0 30px 6px;
}

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

.cert-signatures {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 20px;
}

.cert-sig-box {
    display: flex;
    flex-direction: column;
}

.cert-sig-role {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.cert-sig-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Rubric Table */
.rubric-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 0.9rem;
}

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

.rubric-table th {
    background: var(--bg-surface);
    color: var(--accent-gold);
    font-weight: 800;
}

/* Presentation Mode Overlay */
.presentation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #090d16;
    z-index: 2000;
    display: none;
    flex-direction: column;
}

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

.pres-header {
    padding: 16px 30px;
    background: #0f172a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pres-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

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

.pres-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pres-slide {
    display: none;
    width: 100%;
    max-width: 950px;
    animation: fadeIn 0.3s ease;
}

.pres-slide.active {
    display: block;
}

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

.slide-content-card {
    background: #1e293b;
    border: 2px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

.slide-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    background: rgba(249, 115, 22, 0.2);
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.slide-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 24px;
    line-height: 1.35;
    color: #f8fafc;
}

.slide-points-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 1.15rem;
    line-height: 1.8;
}

.slide-points-list li {
    position: relative;
    padding-right: 28px;
}

.slide-points-list li::before {
    content: "🏀";
    position: absolute;
    right: 0;
    font-size: 1.2rem;
}

.pres-footer {
    padding: 16px 30px;
    background: #0f172a;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pres-nav-btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: #fff;
    border: none;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
}

.pres-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Footer */
.footer {
    background: #070b14;
    border-top: 1px solid var(--border-color);
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.footer-copy {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 25px;
}

/* Responsive */
@media (max-width: 900px) {
    .feature-media-card {
        grid-template-columns: 1fr;
    }
    .feature-media-img {
        max-height: 320px;
    }
    .matching-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 1.9rem;
    }
    .teacher-credential-box {
        flex-direction: column;
        text-align: center;
    }
    .teacher-school-desc {
        justify-content: center;
    }
    .school-director-badge {
        border-right: none;
        padding-right: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
        align-items: center;
    }
}

/* Print Styles */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .navbar, .hero-section, .court-sim-wrapper, .shotclock-referee-box,
    .flip-cards-grid, .matching-game-wrapper, .videos-grid, .footer,
    .presentation-overlay, .scroll-progress, .btn, .nav-actions,
    .quiz-progress-bar-box, #quizQuestionsContainer, .quiz-nav-row {
        display: none !important;
    }
    .certificate-card {
        display: block !important;
        border: 4px solid #b45309 !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        page-break-after: always;
    }
    .certificate-card * {
        color: #000000 !important;
    }
    #student-card {
        display: block !important;
    }
    .rubric-table th, .rubric-table td {
        border: 1px solid #000000 !important;
        color: #000000 !important;
    }
}
