/**
 * NFL Analytics Textbook
 * Custom Stylesheet
 * Bootstrap 5 Customization
 */

/* ==========================================
   CSS Variables / Theme Colors
   ========================================== */
:root {
    /* Primary Colors */
    --primary: #003366;
    --primary-hover: #002244;
    --secondary: #0066cc;
    --secondary-hover: #0052a3;
    --accent: #ffc107;
    --accent-hover: #e0a800;

    /* Semantic Colors */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;

    /* Neutral Colors */
    --light: #f8f9fa;
    --dark: #1a1a2e;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --section-padding: 4rem;
    --card-padding: 1.5rem;

    /* Borders */
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --border-color: #dee2e6;

    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);

    /* Transitions */
    --transition: all 0.3s ease;
}

/* ==========================================
   Base Styles
   ========================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--gray-800);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==========================================
   Typography
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--gray-600);
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

/* ==========================================
   Navigation Overrides
   ========================================== */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu-dark {
    background: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item:hover {
    background: var(--secondary);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hero .display-4 {
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   Cards
   ========================================== */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-5px);
}

.card-header {
    background: var(--gray-100);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Tool Cards */
.tool-card {
    border-left: 4px solid var(--secondary);
}

.tool-card .tool-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.tool-card .tool-icon i {
    font-size: 1.5rem;
    color: white;
}

/* Team Cards */
.team-card {
    text-align: center;
    padding: 1.5rem 1rem;
}

.team-card .team-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.team-card .team-name {
    font-weight: 600;
    color: var(--dark);
}

.team-card .team-record {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Chapter Cards */
.chapter-card {
    border-left: 4px solid var(--secondary);
}

.chapter-card.completed {
    border-left-color: var(--success);
}

.chapter-card .chapter-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-300);
}

.chapter-card .badge {
    font-size: 0.7rem;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    border-color: var(--secondary-hover);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ==========================================
   Stats / Metrics
   ========================================== */
.stat-box {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.stat-card .stat-rank {
    font-size: 0.75rem;
}

/* ==========================================
   Code Blocks
   ========================================== */
pre {
    background: #282c34;
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-x: auto;
    position: relative;
}

pre code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-block {
    position: relative;
    margin: 1.5rem 0;
}

.code-block .code-header {
    background: #21252b;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-block .code-header .code-lang {
    color: var(--gray-400);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.code-block .code-copy-btn {
    background: transparent;
    border: 1px solid var(--gray-600);
    color: var(--gray-400);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.code-block .code-copy-btn:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.code-block pre {
    margin: 0;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Code Tabs */
.code-tabs .nav-tabs {
    border-bottom: none;
    gap: 0.25rem;
}

.code-tabs .nav-link {
    background: var(--gray-200);
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.code-tabs .nav-link.active {
    background: #282c34;
    color: white;
}

/* ==========================================
   Progress Bar
   ========================================== */
.progress-container {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--gray-200);
}

.progress-bar {
    background: linear-gradient(90deg, var(--secondary), var(--success));
    border-radius: 4px;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar-wrapper {
    background: var(--gray-100);
    min-height: calc(100vh - 60px);
}

.sidebar-sticky {
    position: sticky;
    top: 80px;
    padding: 1.5rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: var(--gray-700);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.sidebar-nav .nav-link:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: white;
}

.sidebar-nav .nav-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-500);
    padding: 0.5rem 1rem;
    margin-top: 1rem;
}

/* ==========================================
   Tables
   ========================================== */
.table-analytics {
    font-size: 0.875rem;
}

.table-analytics th {
    background: var(--gray-100);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table-analytics td {
    vertical-align: middle;
}

.table-analytics .team-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-analytics .team-cell img {
    width: 24px;
    height: 24px;
}

/* ==========================================
   Forms / Tool Inputs
   ========================================== */
.tool-interface {
    background: var(--gray-100);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1rem 0;
}

.tool-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-inputs label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.tool-inputs input,
.tool-inputs select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.tool-inputs input:focus,
.tool-inputs select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.tool-result {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border-left: 4px solid var(--success);
}

.tool-result .result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ==========================================
   Breadcrumbs
   ========================================== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item {
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--gray-600);
}

.breadcrumb-item.active {
    color: var(--gray-800);
}

/* ==========================================
   Badges
   ========================================== */
.badge-difficulty {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-beginner { background: var(--success); }
.badge-intermediate { background: var(--warning); color: var(--dark); }
.badge-advanced { background: var(--danger); }

/* ==========================================
   Ads
   ========================================== */
.ad-container {
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-container ins {
    display: block !important;
}

.ad-mobile-anchor {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    padding: 0.5rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   Back to Top Button
   ========================================== */
.btn-back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow);
}

.btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.btn-back-to-top:hover {
    transform: translateY(-5px);
}

/* ==========================================
   Dark Mode
   ========================================== */
body.dark-mode {
    background: var(--dark);
    color: var(--gray-300);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: var(--gray-100);
}

body.dark-mode .card {
    background: #252540;
    border-color: #3a3a5c;
}

body.dark-mode .card-header {
    background: #1e1e36;
    border-color: #3a3a5c;
}

body.dark-mode .bg-light {
    background: #1e1e36 !important;
}

body.dark-mode .sidebar-wrapper {
    background: #1e1e36;
}

body.dark-mode .tool-interface {
    background: #252540;
}

body.dark-mode .tool-result {
    background: #1e1e36;
}

body.dark-mode .table {
    color: var(--gray-300);
}

body.dark-mode .table-analytics th {
    background: #252540;
}

body.dark-mode input,
body.dark-mode select {
    background: #1e1e36;
    border-color: #3a3a5c;
    color: var(--gray-200);
}

body.dark-mode .text-muted {
    color: var(--gray-500) !important;
}

body.dark-mode .progress-container {
    background: #252540;
}

/* ==========================================
   Animations
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 991.98px) {
    .hero {
        padding: 3rem 0;
    }

    .hero .display-4 {
        font-size: 2rem;
    }

    .sidebar-wrapper {
        display: none;
    }

    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 767.98px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .hero {
        padding: 2rem 0;
    }

    .card {
        margin-bottom: 1rem;
    }

    .tool-inputs {
        grid-template-columns: 1fr;
    }

    .footer {
        text-align: center;
    }

    /* Add padding for mobile anchor ad */
    body {
        padding-bottom: 70px;
    }
}

@media (max-width: 575.98px) {
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .stat-box {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .navbar,
    .ad-container,
    .btn-back-to-top,
    .ad-mobile-anchor,
    .sidebar-wrapper {
        display: none !important;
    }

    body {
        padding: 0;
        color: black;
        background: white;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================
   Utility Classes
   ========================================== */
.section-padding {
    padding: var(--section-padding) 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.border-accent {
    border-color: var(--accent) !important;
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* ==========================================
   Interactive Tools Styles
   ========================================== */
.interactive-tool {
    background-color: #f8f9fa;
    border: 2px solid var(--secondary);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    margin: 2rem 0;
}

.interactive-tool h3 {
    color: var(--secondary);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.interactive-tool p {
    color: #555;
    margin-bottom: 20px;
}

.calculator-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.95rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--secondary);
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--secondary);
    cursor: pointer;
    border: none;
}

.control-value {
    display: inline-block;
    min-width: 60px;
    font-weight: 700;
    color: var(--secondary);
    font-size: 1rem;
}

.result-display {
    background-color: white;
    border: 2px solid var(--secondary);
    border-radius: 5px;
    padding: 20px;
    text-align: center;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 10px 0;
}

.result-label {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 10px;
}

.result-explanation {
    font-size: 0.95rem;
    color: #555;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.result-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.result-card .result-label {
    color: rgba(255,255,255,0.8);
}

.result-card .result-value {
    color: white;
}

/* Decision Cards (Fourth Down Tool) */
.decision-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.decision-card {
    background-color: white;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
}

.decision-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.decision-card.best-option {
    border-color: var(--success);
    background-color: #e8f5e9;
}

.decision-option {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 10px;
}

.decision-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

.decision-card.best-option .decision-value {
    color: var(--success);
}

.recommendation {
    background-color: var(--gray-100);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 15px;
}

/* Simulate button */
.btn-simulate {
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
}

.btn-simulate:hover {
    background-color: var(--primary);
    transform: scale(1.05);
}

/* Chart containers */
#team-scatter-plot,
#win-prob-chart,
#field-position-ep,
#epa-distribution {
    width: 100%;
    min-height: 400px;
    margin-top: 20px;
}

.chart-info {
    background-color: var(--gray-100);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    font-size: 0.9rem;
}

.chart-info p {
    margin-bottom: 5px;
}

.chart-controls {
    text-align: center;
    margin-top: 15px;
}

/* Callout boxes from tutorials */
.callout {
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    background-color: var(--gray-100);
}

.callout h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.callout-note {
    border-color: var(--info);
}

.callout-note h4 {
    color: var(--info);
}

.callout-important {
    border-color: var(--warning);
    background-color: #fff3cd;
}

.callout-important h4 {
    color: #856404;
}

.callout-warning {
    border-color: var(--danger);
    background-color: #f8d7da;
}

.callout-warning h4 {
    color: var(--danger);
}

.callout-tip {
    border-color: var(--success);
    background-color: #d4edda;
}

.callout-tip h4 {
    color: var(--success);
}

/* Code tabs in tutorials */
.panel-tabset {
    margin: 1.5rem 0;
}

.panel-tabset .nav-tabs {
    border-bottom: 2px solid var(--gray-300);
}

.panel-tabset .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--gray-600);
    font-weight: 500;
}

.panel-tabset .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: none;
}

.panel-tabset .tab-pane {
    padding-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .decision-cards {
        grid-template-columns: 1fr;
    }

    .result-value {
        font-size: 2rem;
    }

    #team-scatter-plot,
    #win-prob-chart,
    #field-position-ep,
    #epa-distribution {
        min-height: 300px;
    }

    .interactive-tool {
        padding: 15px;
    }
}

/* Dark mode support for interactive tools */
[data-theme="dark"] .interactive-tool {
    background-color: var(--gray-800);
    border-color: var(--gray-600);
}

[data-theme="dark"] .interactive-tool p {
    color: var(--gray-300);
}

[data-theme="dark"] .result-display {
    background-color: var(--gray-700);
    border-color: var(--gray-600);
}

[data-theme="dark"] .decision-card {
    background-color: var(--gray-700);
    border-color: var(--gray-600);
}

[data-theme="dark"] .callout {
    background-color: var(--gray-800);
}

/* ==========================================
   Tutorial Enrichment Components
   ========================================== */

/* Key Takeaways Box */
.key-takeaways {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: none;
    border-left: 5px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.key-takeaways .alert-heading {
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.key-takeaways ul {
    padding-left: 1.25rem;
}

.key-takeaways li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--gray-800);
}

.key-takeaways li:last-child {
    margin-bottom: 0;
}

/* Practice Problems Section */
.practice-problems {
    margin-top: 3rem;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.practice-problems .card-header {
    padding: 1rem 1.5rem;
}

.practice-problems .card-header h4 {
    margin: 0;
    font-size: 1.25rem;
}

.practice-problems .card-body {
    padding: 1.5rem;
}

.practice-problems .problem {
    padding: 1rem;
    background: var(--gray-100);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.practice-problems .problem:last-child {
    margin-bottom: 0;
}

.practice-problems .problem h5 {
    color: var(--success);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.practice-problems .problem p {
    margin-bottom: 1rem;
    color: var(--gray-800);
}

.practice-problems .collapse-container .btn {
    font-size: 0.875rem;
}

.practice-problems .card-body.bg-light {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--gray-700);
    white-space: pre-wrap;
}

/* Related Resources Section */
.related-resources {
    margin-top: 2rem;
    border-radius: var(--border-radius);
}

.related-resources .card-header {
    padding: 0.75rem 1.25rem;
}

.related-resources .card-header h5 {
    margin: 0;
    font-size: 1rem;
}

.related-resources .card-body {
    padding: 1rem;
}

.related-resources a .d-flex {
    transition: var(--transition);
}

.related-resources a:hover .d-flex {
    background-color: var(--gray-100);
    transform: translateX(5px);
}

.related-resources .hover-shadow:hover {
    box-shadow: var(--shadow-sm);
}

/* Dark mode support for enrichment components */
[data-theme="dark"] .key-takeaways {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    border-left-color: var(--secondary);
}

[data-theme="dark"] .key-takeaways .alert-heading {
    color: #90caf9;
}

[data-theme="dark"] .key-takeaways li {
    color: var(--gray-200);
}

[data-theme="dark"] .practice-problems {
    background-color: var(--gray-800);
}

[data-theme="dark"] .practice-problems .problem {
    background-color: var(--gray-700);
}

[data-theme="dark"] .practice-problems .card-body.bg-light {
    background-color: var(--gray-700) !important;
    color: var(--gray-200);
}

[data-theme="dark"] .related-resources {
    background-color: var(--gray-800);
}

[data-theme="dark"] .related-resources a:hover .d-flex {
    background-color: var(--gray-700);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .key-takeaways {
        padding: 1rem;
    }

    .practice-problems .card-body {
        padding: 1rem;
    }

    .related-resources .col-md-6 {
        margin-bottom: 0.5rem;
    }
}
