:root {
    --font-sans: 'Space Grotesk', 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    --bg-body: #020617;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #111827;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --accent: #0891b2;
    --accent-strong: #06b6d4;
}

:root[data-theme="light"] {
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent: #0891b2;
    --accent-strong: #0e7490;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

.sidebar {
    min-height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    backdrop-filter: blur(16px);
}

@media (max-width: 1023px) {
    .sidebar {
        display: none;
    }
}

.topbar {
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    backdrop-filter: blur(16px);
}

.topbar input {
    min-width: 0;
}

.search-button,
.toggle-switch {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    font-size: 1rem;
}

.search-button:hover,
.search-button:focus-visible {
    border-color: var(--accent);
    background: rgba(8, 145, 178, 0.16);
}

.search-container {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.25s ease, opacity 0.2s ease;
}

.search-container.active {
    max-width: 28rem;
    opacity: 1;
}

.search-container input {
    width: 100%;
    min-width: 16rem;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.6rem;
    height: 2rem;
    border-radius: 999px;
    padding: 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.toggle-switch .toggle-thumb {
    position: absolute;
    left: 0.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    background: var(--bg-body);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.toggle-switch .toggle-label {
    position: relative;
    z-index: 1;
    margin-left: 1.45rem;
}

.toggle-switch.active {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(8, 145, 178, 0.18);
}

.toggle-switch.active .toggle-thumb {
    transform: translate(1.6rem, -50%);
    background: #ffffff;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-left: 2px solid transparent;
    border-radius: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent);
    background-color: rgba(8, 145, 178, 0.12);
}

.nav-link.active {
    color: var(--accent);
    background-color: rgba(8, 145, 178, 0.12);
    border-left-color: var(--accent);
}

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 60;
    padding: 1.5rem;
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(16px);
    display: none;
}

.mobile-nav.open {
    display: block;
}

.mobile-nav .nav-link {
    margin-top: 0.75rem;
}

.cookie-notice {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    max-width: 22rem;
    padding: 1rem 1.1rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1rem;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.18);
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
    z-index: 70;
}

.search-results {
    margin: 0 auto;
    max-width: 1200px;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
}

.search-results.hidden {
    display: none;
}

.search-highlight {
    background: rgba(34, 197, 94, 0.18);
    border-radius: 0.375rem;
    padding: 0.05rem 0.15rem;
}

body[data-theme="light"] .bg-slate-900,
body[data-theme="light"] .bg-slate-900\/50,
body[data-theme="light"] .bg-slate-900\/70,
body[data-theme="light"] .bg-slate-900\/80 {
    background-color: var(--bg-surface) !important;
}

body[data-theme="light"] .bg-slate-950,
body[data-theme="light"] .bg-slate-950\/50,
body[data-theme="light"] .bg-slate-950\/60,
body[data-theme="light"] .bg-slate-950\/70,
body[data-theme="light"] .bg-slate-950\/40 {
    background-color: var(--bg-surface-elevated) !important;
}

body[data-theme="light"] .text-slate-100 {
    color: var(--text-primary) !important;
}

body[data-theme="light"] .text-slate-300,
body[data-theme="light"] .text-slate-400 {
    color: var(--text-secondary) !important;
}

body[data-theme="light"] .text-slate-500 {
    color: #64748b !important;
}

body[data-theme="light"] .text-slate-950 {
    color: #020617 !important;
}

body[data-theme="light"] .border-slate-800,
body[data-theme="light"] .border-slate-700 {
    border-color: var(--border-color) !important;
}

body[data-theme="light"] .text-cyan-400 {
    color: var(--accent) !important;
}

body[data-theme="light"] .bg-cyan-950,
body[data-theme="light"] .bg-cyan-950\/50 {
    background-color: rgba(224, 242, 254, 0.9) !important;
    color: var(--accent) !important;
}
