:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #151923;
    --bg-tertiary: #1e2530;
    --text-primary: #e4e6eb;
    --text-secondary: #a0a8b8;
    --accent-cyan: #00f5ff;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 37, 48, 0.6);
    --highlight-bg: rgba(0, 245, 255, 0.1);
    --warning-bg: rgba(251, 191, 36, 0.1);
    --myth-bg: rgba(239, 68, 68, 0.1);
    --reality-bg: rgba(34, 197, 94, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-bg: rgba(255, 255, 255, 0.8);
    --highlight-bg: rgba(59, 130, 246, 0.1);
    --warning-bg: rgba(251, 191, 36, 0.15);
    --myth-bg: rgba(239, 68, 68, 0.1);
    --reality-bg: rgba(34, 197, 94, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
}

.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

[data-theme="light"] .grid-background {
    opacity: 0.15;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

header {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    color: var(--text-primary);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.header-controls {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10;
}

.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
    border-color: var(--accent-cyan);
}

.sun-icon,
.moon-icon {
    transition: all 0.3s ease;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: block;
}

.header-content {
    position: relative;
}

.logo-container {
    margin-bottom: 20px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.logo-icon {
    filter: drop-shadow(0 0 10px rgba(0, 245, 255, 0.5));
}

header h1 {
    font-size: 2.8em;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.separator {
    margin: 0 15px;
    color: var(--text-secondary);
    font-weight: 300;
}

.subtitle {
    font-size: 1.2em;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    margin-top: 10px;
}

.code-bracket {
    color: var(--accent-cyan);
    font-weight: bold;
}

.topic-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 25px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.nav-btn {
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 245, 255, 0.2);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.2), rgba(168, 85, 247, 0.2));
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

main {
    padding: 40px 30px;
    min-height: 400px;
    background: var(--bg-secondary);
}

.topic-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.topic-section.active {
    display: block;
}

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

h2 {
    color: var(--accent-cyan);
    font-size: 2.2em;
    margin-bottom: 25px;
    font-weight: 800;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 2px;
}

h3 {
    color: var(--text-primary);
    font-size: 1.6em;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

h3::before {
    content: '▸';
    color: var(--accent-purple);
    font-size: 0.8em;
}

h4 {
    color: var(--text-primary);
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

p {
    margin-bottom: 15px;
    font-size: 1.05em;
    color: var(--text-secondary);
    line-height: 1.8;
}

ul, ol {
    margin-left: 30px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 12px;
    font-size: 1.05em;
    color: var(--text-secondary);
    line-height: 1.7;
}

li::marker {
    color: var(--accent-cyan);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

.highlight-box {
    background: var(--highlight-bg);
    border-left: 3px solid var(--accent-cyan);
    padding: 24px;
    margin: 25px 0;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-cyan);
    position: relative;
    overflow: hidden;
}

.highlight-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.05), transparent);
    pointer-events: none;
}

.warning-box {
    background: var(--warning-bg);
    border-left: 3px solid #fbbf24;
    padding: 24px;
    margin: 25px 0;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-left: 3px solid #fbbf24;
    position: relative;
    overflow: hidden;
}

.warning-box::before {
    content: '⚠';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2em;
    opacity: 0.2;
}

.myth-reality {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
}

.myth-card, .reality-card {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.myth-card::before,
.reality-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.myth-card:hover::before,
.reality-card:hover::before {
    opacity: 1;
}

.myth-card {
    background: var(--myth-bg);
    border-left: 3px solid #ef4444;
}

.myth-card:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.reality-card {
    background: var(--reality-bg);
    border-left: 3px solid #22c55e;
}

.reality-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.2);
}

.myth-card h4, .reality-card h4 {
    margin-bottom: 12px;
    font-size: 1.2em;
    font-weight: 700;
}

.myth-card h4 {
    color: #ef4444;
}

.reality-card h4 {
    color: #22c55e;
}

.myth-card p, .reality-card p {
    color: var(--text-secondary);
}

code {
    background: var(--card-bg);
    padding: 3px 8px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    color: var(--accent-pink);
    border: 1px solid var(--border-color);
    font-size: 0.9em;
}

footer {
    background: var(--bg-tertiary);
    padding: 25px;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .header-controls {
        top: 15px;
        right: 15px;
    }

    .logo-container {
        margin-bottom: 15px;
    }

    .logo-icon {
        width: 50px;
        height: 50px;
    }

    .separator {
        display: block;
        margin: 10px 0;
    }

    .myth-reality {
        grid-template-columns: 1fr;
    }

    .topic-nav {
        justify-content: center;
        padding: 20px 15px;
    }

    .nav-btn {
        font-size: 0.9em;
        padding: 10px 18px;
    }

    main {
        padding: 25px 20px;
    }

    h2 {
        font-size: 1.8em;
    }

    h3 {
        font-size: 1.4em;
    }

    .highlight-box,
    .warning-box {
        padding: 20px;
        margin: 20px 0;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-purple), var(--accent-pink));
}

/* Selection styling */
::selection {
    background: rgba(0, 245, 255, 0.3);
    color: var(--text-primary);
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
