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

:root {
    --primary: #15803d;
    --primary-dark: #166534;
    --primary-light: #22c55e;
    --secondary: #0284c7;
    --secondary-dark: #0369a1;
    --secondary-light: #38bdf8;
    --accent: #eab308;
    --accent-gold: #facc15;
    --tennis-ball: #ccff00;
    --danger: #ef4444;
    --court-blue: #0284c7;
    --court-green: #15803d;
    --court-lines: #ffffff;

    /* 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(34, 197, 94, 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(21, 128, 61, 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(21, 128, 61, 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(21, 128, 61, 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;
}

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

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

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

/* 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);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transition: background-color var(--transition-normal);
}

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

.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-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.3);
    font-size: 1.3rem;
}

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

.logo-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

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

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

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

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

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: var(--transition-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(21, 128, 61, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 128, 61, 0.45);
}

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

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

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

/* Presentation Mode Overlay */
.presentation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 17, 32, 0.98);
    backdrop-filter: blur(16px);
    z-index: 2000;
    display: none;
    flex-direction: column;
}

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

.pres-header {
    height: 70px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.pres-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pres-slide-counter {
    background: var(--bg-card);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 0.9rem;
}

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

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

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

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

.slide-content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.slide-badge {
    display: inline-block;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.slide-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: #ffffff;
}

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

.slide-points-list li {
    background: var(--bg-surface);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border-right: 4px solid var(--primary-light);
    font-size: 1.05rem;
    line-height: 1.8;
}

.slide-points-list li strong {
    color: var(--accent-gold);
}

.pres-footer {
    height: 75px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.pres-nav-btn {
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.pres-nav-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--primary-light);
}

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

/* Hero Section */
.hero-section {
    position: relative;
    padding: 60px 0 45px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 20%, rgba(21, 128, 61, 0.18), transparent 70%);
}

.hero-glow {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 650px;
    height: 450px;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.22) 0%, rgba(34, 197, 94, 0.15) 50%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 22px;
}

.tag-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-light);
    animation: pulse 2s infinite;
}

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

/* Teacher Credentials Box */
.teacher-credential-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 28px;
    width: 100%;
    max-width: 950px;
    box-shadow: var(--card-shadow);
    text-align: right;
}

.teacher-avatar-emblem {
    font-size: 2.8rem;
    background: rgba(34, 197, 94, 0.12);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(34, 197, 94, 0.3);
    flex-shrink: 0;
}

.teacher-details {
    flex: 1;
}

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

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

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

.school-director-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    text-align: center;
    flex-shrink: 0;
}

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

.director-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-gold);
    margin-top: 2px;
}

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

.hero-subtitle {
    font-size: 1.15rem;
    max-width: 880px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

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

/* Hero Stats Bar */
.portal-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 1100px;
    margin-top: 15px;
}

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

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

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

.stat-icon-wrap.green { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.stat-icon-wrap.blue { background: rgba(2, 132, 199, 0.15); color: #38bdf8; }
.stat-icon-wrap.orange { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.stat-icon-wrap.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

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

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

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

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

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

.section-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 800;
    color: #4ade80;
    margin-bottom: 12px;
}

.section-badge.blue {
    background: rgba(2, 132, 199, 0.12);
    border-color: rgba(2, 132, 199, 0.35);
    color: #38bdf8;
}

.section-badge.gold {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.35);
    color: #facc15;
}

.section-title {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 14px;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
}

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

.cards-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.card-icon-badge {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 18px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.card-icon-badge.blue {
    background: rgba(2, 132, 199, 0.15);
    color: #38bdf8;
    border-color: rgba(2, 132, 199, 0.3);
}

.card-icon-badge.gold {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border-color: rgba(234, 179, 8, 0.3);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.card-desc {
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 16px;
}

.card-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
}

.card-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.card-list li::before {
    content: "✓";
    color: var(--primary-light);
    font-weight: 800;
}

/* Technical Grips Table / Cards */
.grips-showcase-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--card-shadow);
    margin-bottom: 40px;
}

.grips-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 24px;
}

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

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

.grip-emblem {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.grip-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--accent-gold);
}

.grip-bevel {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(2, 132, 199, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: #38bdf8;
    margin-bottom: 10px;
    font-weight: 700;
}

.grip-use {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Feature Image Card */
.feature-media-card {
    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);
    display: grid;
    grid-template-columns: 1fr 1fr;
}

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

.feature-media-body {
    padding: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Tactical Tennis 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: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 24px;
}

.court-mode-btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.court-canvas-box {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0d2818;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.court-info-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    text-align: center;
}

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

.court-info-item p {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-gold);
}

/* Scoring Simulator */
.scoreboard-box {
    background: #020617;
    border: 2px solid #1e293b;
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 850px;
    margin: 0 auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.scoreboard-display {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
    align-items: center;
}

.sb-header-cell {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
}

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

.sb-server-dot {
    width: 10px;
    height: 10px;
    background-color: var(--tennis-ball);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--tennis-ball);
    display: inline-block;
}

.sb-score-cell {
    font-size: 1.8rem;
    font-weight: 900;
    font-family: monospace;
    color: var(--tennis-ball);
    background: #020617;
    border-radius: 6px;
    padding: 6px 0;
    border: 1px solid #1e293b;
}

.sb-action-bar {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.sb-announcement-box {
    background: rgba(2, 132, 199, 0.15);
    border: 1px solid rgba(2, 132, 199, 0.4);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-top: 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Virtual Umpire Lab */
.umpire-lab-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.soundboard-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 35px;
}

.soundboard-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 8px;
    text-align: center;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

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

.soundboard-icon {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.scenario-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 10px;
    align-self: flex-start;
}

.scenario-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
    color: var(--text-primary);
    flex: 1;
}

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

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

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

.scenario-btn.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--primary-light);
    color: #4ade80;
    font-weight: 800;
}

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

.scenario-feedback {
    margin-top: 12px;
    font-size: 0.85rem;
    padding: 10px;
    border-radius: var(--radius-sm);
    display: none;
}

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

.flip-card {
    background-color: transparent;
    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:hover .flip-card-inner,
.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-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

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

.flip-card-front .flip-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.flip-card-front h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.flip-card-hint {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.flip-card-back {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: var(--border-highlight);
    transform: rotateY(180deg);
}

.flip-card-back p {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #e2e8f0;
}

/* 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: 24px;
    margin-top: 20px;
}

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

.match-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    text-align: right;
    user-select: none;
}

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

.match-card.selected {
    border-color: var(--accent-gold);
    background: rgba(234, 179, 8, 0.15);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.25);
}

.match-card.matched {
    border-color: var(--primary-light);
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    pointer-events: none;
    opacity: 0.75;
}

/* Video Library */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

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

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

.video-content {
    padding: 22px;
}

.video-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.video-content h4 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.video-content p {
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 14px;
}

.btn-yt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition-fast);
}

.btn-yt:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Standardized Quiz */
.quiz-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--card-shadow);
    max-width: 900px;
    margin: 0 auto;
}

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

.quiz-progress-bar {
    height: 8px;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.quiz-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 8px;
}

.quiz-question-card {
    margin-bottom: 24px;
}

.quiz-q-num {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 800;
    display: block;
    margin-bottom: 6px;
}

.quiz-q-text {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.quiz-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option-btn {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    text-align: right;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.quiz-option-btn:hover:not(:disabled) {
    border-color: var(--primary-light);
    background: var(--bg-card-hover);
}

.quiz-option-btn:disabled {
    cursor: default;
    opacity: 0.82;
}

.quiz-option-btn.correct {
    border-color: #22c55e !important;
    background: rgba(34, 197, 94, 0.25) !important;
    color: #4ade80 !important;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
    opacity: 1 !important;
}

.quiz-option-btn.wrong {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.25) !important;
    color: #f87171 !important;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
    opacity: 1 !important;
}

.quiz-feedback-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    font-size: 0.92rem;
    line-height: 1.7;
    display: none;
}

.quiz-nav-row {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
}

/* Certificate */
.certificate-card {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border: 3px solid var(--accent-gold);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    margin-top: 30px;
    display: none;
    position: relative;
}

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

.cert-title {
    font-size: 1.8rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.cert-student-name {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffffff;
    margin: 15px 0;
    text-decoration: underline;
}

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

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

.cert-sig-box {
    text-align: center;
}

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

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

/* Printable Student Rubric Card */
.rubric-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.rubric-table th {
    background: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 800;
    font-size: 0.9rem;
}

.rubric-table td {
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--bg-surface);
    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;
    padding-top: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Print Styles */
@media print {
    .navbar, .scroll-progress, .hero-actions-row, .court-controls-bar,
    .sb-action-bar, .soundboard-grid, .quiz-nav-row, .btn-icon,
    .pres-header, .pres-footer, .footer {
        display: none !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .card, .scoreboard-box, .quiz-wrapper, .rubric-table {
        border: 1px solid #000000 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .cards-grid-3, .flip-cards-grid, .grips-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .portal-stats-bar, .cards-grid-4, .soundboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .feature-media-card {
        grid-template-columns: 1fr;
    }
    .videos-grid, .scenarios-grid {
        grid-template-columns: 1fr;
    }
    .teacher-credential-box {
        flex-direction: column;
        text-align: center;
    }
    .teacher-school-desc {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .cards-grid-3, .cards-grid-2, .flip-cards-grid, .grips-grid,
    .portal-stats-bar, .cards-grid-4, .soundboard-grid, .matching-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .scoreboard-display {
        grid-template-columns: 1fr 1fr;
    }
}
