/* --- A NEW, FUTURISTIC LIGHT THEME --- */

[data-bs-theme="light"] {
    /* 1. Define Color Palette (Calmed Futuristic Palette for Light Mode) */
    --bs-primary: #0088cc; /* Deeper Cyan for better legibility on light backgrounds */
    --bs-primary-rgb: 0, 136, 204;
    --bs-secondary: #5a6268;
    --bs-success: #00a844; /* Calmed Green (Readable contrast) */
    --bs-info: #7b00e0; /* Deeper Purple */
    --bs-warning: #d4af37; /* Muted Gold/Yellow */
    --bs-danger: #e61f5b; /* Controlled Cyber Pink */
    --bs-body-bg: #f4f7f9; /* Soft tech-gray background */
    --bs-body-color: #2b3035;
    --bs-card-bg: #ffffff;
    --bs-card-border-color: #e2e8f0;
    
    /* 2. Define Fonts (to match dark theme) */
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

/* 3. Apply Base Styles */
[data-bs-theme="light"] body {
    background: var(--bs-body-bg);
    font-family: var(--font-body);
    color: var(--bs-body-color);
}

[data-bs-theme="light"] h1,
[data-bs-theme="light"] h2,
[data-bs-theme="light"] h3,
[data-bs-theme="light"] h4,
[data-bs-theme="light"] h5,
[data-bs-theme="light"] h6,
[data-bs-theme="light"] .navbar-brand {
    font-family: var(--font-heading);
    color: #111417;
    /* REDUCED GLOW: Changed to a very subtle, soft drop shadow to prevent text blurring */
    text-shadow: 0 1px 2px rgba(var(--bs-primary-rgb), 0.15);
}

/* --- FIX: Changed link color from purple to primary cyan --- */
[data-bs-theme="light"] a {
    color: var(--bs-primary);
}
[data-bs-theme="light"] a:hover {
    color: #006699; /* Darker cyan on hover */
    text-shadow: none;
}


/* 4. Navbar */
[data-bs-theme="light"] .navbar {
    background-color: var(--bs-card-bg) !important;
    border-bottom: 1px solid var(--bs-card-border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,.04);
}
/* Make navbar links match new primary color */
[data-bs-theme="light"] .nav-link {
    color: #495057;
    font-weight: 500;
}
[data-bs-theme="light"] .nav-link:hover {
    color: var(--bs-primary);
}


/* 5. Cards */
[data-bs-theme="light"] .card {
    background-color: var(--bs-card-bg);
    border: 1px solid var(--bs-card-border-color); 
    border-radius: 0.5rem; /* Rounded corners */
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    backdrop-filter: none;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

/* Rounded glowing border (same behavior as dark theme) */
[data-bs-theme="light"] .card::before {
    content: '';
    position: absolute;
    inset: 0; /* top:0, right:0, bottom:0, left:0 */
    border-radius: 0.5rem; /* match the card's border-radius */
    border: 1px solid transparent;
    background: linear-gradient(
        120deg,
        var(--bs-primary),
        var(--bs-info),
        var(--bs-success)
    ) border-box;
    -webkit-mask: 
        linear-gradient(#fff 0 0) padding-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0; 
    transition: opacity 0.4s ease;
    pointer-events: none;
}

[data-bs-theme="light"] .card:hover::before {
    opacity: 1;
}


/* Make the card shadow "pop" on hover */
[data-bs-theme="light"] .card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

[data-bs-theme="light"] .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--bs-card-border-color);
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* 6. Forms & Buttons */

[data-bs-theme="light"] .btn {
    border-radius: 4px; /* Slightly smoother tech look */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease-in-out;
    font-weight: 600; 
    border-width: 1px; 
}
[data-bs-theme="light"] .btn-lg {
    border-radius: 0.5rem;
}
[data-bs-theme="light"] .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.2);
}

/* --- BUTTON CONTRAST FIXES: White text for dark/deep colors, black text only where legible --- */
[data-bs-theme="light"] .btn-primary {
    color: #ffffff !important; /* White text for better contrast against deep primary */
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
[data-bs-theme="light"] .btn-primary:hover {
    background-color: #006699;
    border-color: #006699;
    color: #ffffff !important; 
}

[data-bs-theme="light"] .btn-secondary {
    color: #ffffff !important; /* Forces white text for perfect readability */
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

[data-bs-theme="light"] .btn-secondary:hover {
    background-color: #43494e; /* Slightly darker gray on hover */
    border-color: #43494e;
    color: #ffffff !important;
}

[data-bs-theme="light"] .btn-success {
    color: #ffffff !important; /* White text for safety compliance contrast */
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}
[data-bs-theme="light"] .btn-success:hover {
    background-color: #008233;
    border-color: #008233;
    color: #ffffff !important;
}

[data-bs-theme="light"] .btn-danger {
    color: #fff !important;
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}
[data-bs-theme="light"] .btn-danger:hover {
    background-color: #c21347;
    border-color: #c21347;
    color: #fff !important;
}

[data-bs-theme="light"] .btn-warning {
    color: #111 !important; /* Dark text remains on yellow, but gold yellow improves eye comfort */
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
}

/* --- FIX FOR OUTLINE BUTTON (As seen on the right side of the hero image) --- */
[data-bs-theme="light"] .btn-outline-primary {
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary);
    background-color: transparent;
}
[data-bs-theme="light"] .btn-outline-primary:hover {
    color: #ffffff !important;
    background-color: var(--bs-primary);
}

/* Targets the [data-bs-theme="light"] specifically */
[data-bs-theme="light"] {

    /* When the radio input (btn-check) is CHECKED, 
       find its sibling label (btn-outline-primary) */
    .btn-check:checked + .btn-outline-primary {
        /* Force the text to white so it contrasts with the vibrant background */
        color: #ffffff !important; 
    }

    /* Optional: Ensures the text changes smoothly upon selection */
    .btn-outline-primary {
        transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
    }
}

[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
    border-radius: 0.5rem;
    border-color: var(--bs-card-border-color);
}
[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* 7. Fix Specific UI Elements */

/* Helper text */
[data-bs-theme="light"] .text-white-50 {
    color: var(--bs-secondary) !important;
}

/* Star button/text */
[data-bs-theme="light"] .btn-outline-warning {
    --bs-btn-color: var(--bs-warning);
    --bs-btn-border-color: var(--bs-warning);
    --bs-btn-hover-bg: var(--bs-warning);
    --bs-btn-hover-color: #000;
}
[data-bs-theme="light"] a.btn-outline-danger {
    color: var(--bs-danger);
    border-color: var(--bs-danger);
}
[data-bs-theme="light"] a.btn-outline-danger:hover {
    color: #fff;
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}
/* FIX: "Star text" color */
[data-bs-theme="light"] p.card-text > .ms-2 {
    color: var(--bs-warning);
    font-weight: bold;
}

/* --- FEATURE ICONS (Under-icon text fix) --- */
[data-bs-theme="light"] .feature-icon {
    font-size: 3rem;
    color: var(--bs-primary); 
    text-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), 0.15);
    margin-bottom: 1rem;
}

[data-bs-theme="light"] .step-number {
    font-size: 3rem;
    font-weight: bold;
    color: #343a40; 
    line-height: 1;
}

/* --- Dashboard Icon Colors --- */
[data-bs-theme="light"] .bi-patch-question-fill { color: var(--bs-primary); }
[data-bs-theme="light"] .bi-collection-fill { color: var(--bs-info); }
[data-bs-theme="light"] .bi-people-fill { color: var(--bs-secondary); }
[data-bs-theme="light"] .bi-building-fill { color: #444; }
[data-bs-theme="light"] .bi-bar-chart-steps { color: var(--bs-danger); }
[data-bs-theme="light"] .bi-trophy-fill { color: var(--bs-warning); }
[data-bs-theme="light"] .bi-award-fill { color: var(--bs-warning); }
[data-bs-theme="light"] .bi-check-circle-fill { color: var(--bs-success); }


/* --- Fix for quiz form header --- */
[data-bs-theme="light"] .card-header-formset {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--bs-card-border-color);
}

/* Ensure images within articles never exceed the container width */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

/* Rich-text article typography — raw author HTML (TinyMCE/markdown output) has no
   Bootstrap .table/.prose class, so it needs its own section spacing and table styling. */
.article-content, .blog-content, .article-body { line-height: 1.7; }
.article-content > *, .blog-content > *, .article-body > * { margin-top: 0; margin-bottom: 1.25rem; }
.article-content > *:last-child, .blog-content > *:last-child, .article-body > *:last-child { margin-bottom: 0; }
.article-content h1, .article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6,
.blog-content h1, .blog-content h2, .blog-content h3, .blog-content h4, .blog-content h5, .blog-content h6,
.article-body h1, .article-body h2, .article-body h3, .article-body h4, .article-body h5, .article-body h6 {
    margin-top: 2rem;
}
.article-content > *:first-child, .blog-content > *:first-child, .article-body > *:first-child { margin-top: 0; }
.article-content table, .blog-content table, .article-body table {
    width: 100%;
    border-collapse: collapse;
}
.article-content th, .article-content td,
.blog-content th, .blog-content td,
.article-body th, .article-body td {
    border: 1px solid var(--bs-border-color);
    padding: 0.6rem 0.9rem;
    text-align: left;
    vertical-align: top;
}
.article-content thead th, .blog-content thead th, .article-body thead th {
    background: var(--bs-tertiary-bg);
}
.article-content ul, .article-content ol,
.blog-content ul, .blog-content ol,
.article-body ul, .article-body ol {
    padding-left: 1.5rem;
}
.article-content li, .blog-content li, .article-body li { margin-bottom: 0.4rem; }

/* --- Testimonial Card Fix --- */
[data-bs-theme="light"] .testimonial-card {
    border: none; 
    border-left: 3px solid var(--bs-info);
}

/* Disable the hover effect for testimonial cards */
[data-bs-theme="light"] .testimonial-card:hover::before {
    opacity: 0;
}