/* --- CSS VÁLTOZÓK (Világos téma) --- */
:root {
    --bg-color: #f8f9fa;
    --text-color: #333333;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e9ecef;
    --link-color: #0056b3;
    --link-hover-bg: #f1f3f5;
    --link-active-bg: #e7f1ff;
    --link-active-border: #0056b3;
    --content-bg: #ffffff;
    --border-color: #f1f3f5;
    --nav-side-color: #ced4da;
    --nav-side-hover: rgba(0,0,0,0.02);
    --btn-bg: #e9ecef;
    --btn-hover: #dee2e6;
    --shadow: 0 0 15px rgba(0,0,0,0.02);
}

/* --- SÖTÉT TÉMA VÁLTOZÓK (OLED TÖKÉLETES FEKETE) --- */
:root.dark-theme {
    --bg-color: #000000;
    --text-color: #e0e0e0;
    --sidebar-bg: #000000;
    --sidebar-border: #1a1a1a;
    --link-color: #66b2ff;
    --link-hover-bg: #111111;
    --link-active-bg: #0a1929;
    --link-active-border: #66b2ff;
    --content-bg: #000000;
    --border-color: #1a1a1a;
    --nav-side-color: #333333;
    --nav-side-hover: rgba(255,255,255,0.05);
    --btn-bg: #111111;
    --btn-hover: #222222;
    --shadow: none; /* OLED kijelzőn fekete alapon nincs értelme az árnyéknak */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* --- HAMBURGER GOMB (Desktopon rejtve) --- */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--content-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    height: 100vh;
    height: 100dvh; /* Kifejezetten a mobil böngészősávok okozta probléma ellen */
    z-index: 999;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Flexbox a sidebaron belül, hogy a kapcsoló tuti az aljára kerüljön */
.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-top {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.site-title {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 15px;
}

.menu ul { list-style: none; }

.menu li a {
    display: block;
    padding: 8px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}

.menu li a:hover { background-color: var(--link-hover-bg); }
.menu li a.active {
    color: var(--link-color);
    font-weight: bold;
    background-color: var(--link-active-bg);
    border-left: 3px solid var(--link-active-border);
}

/* --- TÉMA VÁLASZTÓ GOMB (Ikonos kivitel) --- */
.theme-switch-wrapper {
    padding: 15px 20px;
    /* Extra padding alul a biztos láthatóságért mobilon */
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s, color 0.2s;
}

.theme-toggle-btn:hover {
    background: var(--link-hover-bg);
}

.theme-toggle-btn svg {
    margin-right: 12px;
}

/* --- MAIN CONTENT WRAPPER --- */
.content-wrapper {
    margin-left: 300px;
    flex: 1;
    display: flex;
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
}

/* --- DESKTOP PREV/NEXT SIDEBARS --- */
.nav-side {
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--nav-side-color);
    font-size: 3rem;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
}

.nav-side:hover {
    background-color: var(--nav-side-hover);
    color: var(--link-color);
}

/* --- ARTICLE CONTENT --- */
.content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--content-bg);
    min-height: 100%;
    box-shadow: var(--shadow);
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
    transition: background-color 0.3s ease;
}

.content h1 { font-size: 2.2rem; margin-bottom: 20px; border-bottom: 2px solid var(--border-color); padding-bottom: 10px; }
.content h2 { font-size: 1.8rem; margin-top: 30px; margin-bottom: 15px; }
.content p { margin-bottom: 15px; font-size: 1.1rem;}
.content strong { color: var(--text-color); font-weight: 700; }

/* --- MOBILE NAV (Alapból rejtve) --- */
.mobile-nav {
    display: none;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-nav {
    padding: 10px 20px;
    background: var(--btn-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-nav:hover { background: var(--btn-hover); }

/* --- RESPONSIVE MOBILE VIEW --- */
@media (max-width: 900px) {
    .layout { flex-direction: column; }

    .menu-toggle { display: block; }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content-wrapper { margin-left: 0; display: block; }
    .nav-side { display: none; }
    .mobile-nav { display: flex; }

    .content {
        max-width: 100%;
        box-shadow: none;
        padding: 70px 20px 20px 20px; /* Hely a hamburger gombnak */
    }
}
