/* --- HAMBURGER MENU BUTTON --- */
.hamburger-btn {
    position: absolute; 
    top: 25px;
    right: 30px;
    width: 32px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1501; 
    transition: transform 0.3s var(--ease-spring);
}

.hamburger-btn:active {
    transform: scale(0.9);
}

.hamburger-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 999px;
    transform-origin: center;
    transition: transform 0.45s var(--ease-spring), opacity 0.25s ease, background-color 0.35s ease;
}

body.modal-open .hamburger-btn {
    display: none;
}

.hamburger-btn.open span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
    background-color: #e5a93d;
}
.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.3);
}
.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
    background-color: #e5a93d;
}

/* --- LEFT SLIDING DRAWER (LIQUID GLASS) --- */
.left-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: rgba(14, 14, 16, 0.74);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset -1px 0 1px rgba(255, 255, 255, 0.08);
    z-index: 1500;
    transform: translate3d(-102%, 0, 0);
    transition: transform 0.55s var(--ease-liquid), background-color 0.45s var(--ease-liquid), border-color 0.45s var(--ease-liquid), box-shadow 0.55s var(--ease-liquid);
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

body.light-theme .left-drawer {
    background-color: rgba(255, 255, 255, 0.78);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.left-drawer.open {
    transform: translate3d(0, 0, 0);
    box-shadow: 15px 0 45px rgba(0, 0, 0, 0.4), inset -1px 0 1px rgba(255, 255, 255, 0.12);
}

body.light-theme .left-drawer.open {
    box-shadow: 15px 0 45px rgba(0, 0, 0, 0.08), inset -1px 0 1px rgba(255, 255, 255, 0.9);
}

.left-drawer nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 25px; 
}

.left-drawer nav ul li {
    opacity: 0;
    transform: translateX(-14px);
    transition: opacity 0.4s var(--ease-liquid), transform 0.45s var(--ease-liquid);
}

.left-drawer.open nav ul li {
    opacity: 1;
    transform: translateX(0);
}

.left-drawer.open nav ul li:nth-child(1) { transition-delay: 0.05s; }
.left-drawer.open nav ul li:nth-child(2) { transition-delay: 0.09s; }
.left-drawer.open nav ul li:nth-child(3) { transition-delay: 0.13s; }
.left-drawer.open nav ul li:nth-child(4) { transition-delay: 0.16s; }
.left-drawer.open nav ul li:nth-child(5) { transition-delay: 0.19s; }
.left-drawer.open nav ul li:nth-child(6) { transition-delay: 0.23s; }

.left-drawer nav a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1rem; 
    letter-spacing: 1px;
    transition: color 0.3s var(--ease-liquid), transform 0.3s var(--ease-liquid);
    position: relative;
    padding-bottom: 5px;
    display: inline-block;
}

.left-drawer nav a:hover {
    color: var(--accent-gold);
    transform: translateX(4px);
}

.left-drawer nav a.active {
    color: var(--text-primary);
    font-weight: 500;
    border-bottom: 2px solid var(--accent-gold); 
}

.drawer-divider {
    border: 0;
    border-top: 1px solid var(--border-divider); 
    width: 100%;
    margin: 5px 0;
    list-style: none;
    transition: border-color 0.45s var(--ease-liquid);
}

/* --- DRAWER FOOTER & YOUTUBE LINK --- */
.drawer-footer {
    margin-top: auto;
    padding-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.drawer-yt-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    font-weight: 500;
    width: fit-content;
    transition: color 0.3s var(--ease-liquid), transform 0.35s var(--ease-spring);
}

.drawer-yt-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: block;
    transition: transform 0.4s var(--ease-spring), filter 0.3s ease;
}

.drawer-yt-link:hover {
    color: var(--accent-gold);
    transform: translateX(4px);
}

.drawer-yt-link:hover .drawer-yt-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.6));
}

@keyframes drawerViewSwap {
    from {
        opacity: 0;
        transform: translate3d(-8px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@media (max-height: 650px) {
    .left-drawer {
        padding: 50px 30px 30px;
    }
    .drawer-footer {
        margin-top: 25px;
        padding-top: 15px;
    }
}

/* --- DRAWER OVERLAY BACKGROUND --- */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 1499;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s var(--ease-liquid);
}

body.light-theme .drawer-overlay {
    background: rgba(17, 17, 19, 0.35);
}

.drawer-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* --- CENTRAL TOP HEADER --- */
.central-header {
    width: 100%;
    background-color: var(--bg-header);
    padding: 25px 20px 15px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle); 
    transition: background-color 0.45s var(--ease-liquid), border-color 0.45s var(--ease-liquid);
}

.central-header img.logo {
    max-width: 220px; 
    width: 100%; 
    height: auto;
    display: block;
    margin-bottom: 8px; 
    transition: filter 0.45s var(--ease-liquid);
}

.central-header p.quote {
    font-size: 1rem; 
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    font-style: italic; 
    transition: opacity 0.35s var(--ease-liquid), color 0.45s var(--ease-liquid); 
}

body.light-theme .central-header p.quote {
    font-weight: 400;
}

/* --- RIGHT-SIDE STICKY SIDEBAR --- */
.right-sidebar {
    width: 230px;
    position: sticky;
    top: 0;
    padding: 40px 15px 40px 25px; 
}

.mobile-break {
    display: none; 
}

.right-sidebar nav ul {
    list-style: none; 
    padding: 0;     
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;       
}

.right-sidebar nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem; 
    transition: color 0.35s var(--ease-liquid), transform 0.35s var(--ease-liquid);
    position: relative; 
    padding-bottom: 6px; 
    display: inline-block; 
    white-space: nowrap; 
}

body.light-theme .right-sidebar nav a {
    font-weight: 500;
}

.right-sidebar nav a:hover,
.right-sidebar nav a.active {
    color: var(--text-primary);
}

.right-sidebar nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background-color: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold-glow);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.45s var(--ease-spring), background-color 0.35s ease; 
}

.right-sidebar nav a:hover::after,
.right-sidebar nav a.active::after {
    transform: scaleX(1);
}

/* --- SIDEBAR TOGGLE & ACCORDION ANIMATIONS --- */
#sidebar-irl-links {
    transition: max-height 0.75s var(--ease-liquid), opacity 0.5s var(--ease-liquid);
    max-height: 280px;
    opacity: 1;
    overflow: hidden;
}

#sidebar-irl-links.collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#sidebar-irl-links::after {
    display: none !important;
}

.no-transition {
    transition: none !important;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-muted); 
    font-size: 0.95rem; 
    padding-bottom: 6px;
    margin-top: 15px; 
    padding-top: 15px;
    border-top: 1px solid var(--border-divider);
    margin-bottom: 20px; 
    transition: color 0.3s var(--ease-liquid), border-color 0.45s var(--ease-liquid);
    width: 100%;
    opacity: 0;
    transform: translateX(15px);
    animation: slideLeft 0.6s var(--ease-liquid) 0.2s forwards;
}

body.light-theme .sidebar-toggle {
    font-weight: 500;
}

@keyframes slideLeft {
    to { opacity: 1; transform: translateX(0); }
}

.sidebar-toggle:hover {
    color: var(--text-primary);
}

.sidebar-toggle svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: transform 0.45s var(--ease-spring);
}

.sidebar-toggle.expanded svg {
    transform: rotate(180deg);
}

.sidebar-divider {
    border: 0;
    border-top: 1px solid var(--border-divider);
    width: 100%;
    margin: 10px 0;
    transition: border-color 0.45s var(--ease-liquid);
    list-style: none;
}

.sidebar-new-badge {
    font-family: 'Permanent Marker', cursive;
    color: var(--accent-gold);
    font-size: 0.72rem;
    letter-spacing: 1px;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
    text-shadow: 0 0 8px var(--accent-gold-glow);
    transform: translateY(-1px);
}

body.light-theme .sidebar-new-badge {
    text-shadow: none;
    font-weight: bold;
}

/* --- USER SETTINGS & LIQUID TOGGLES --- */
.setting-item {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-size: 1rem; 
    color: var(--text-primary);
    font-weight: normal; 
    letter-spacing: 1px; 
    width: 100%;
}

.mobile-only { display: none; }
.desktop-only { display: flex; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { 
    position: absolute; 
    cursor: pointer; 
    top: 0; left: 0; right: 0; bottom: 0; 
    background-color: #333338; 
    transition: background-color 0.35s var(--ease-liquid); 
    border-radius: 999px; 
}
body.light-theme .slider {
    background-color: #d2d2da;
}
.slider:before { 
    position: absolute; 
    content: ""; 
    height: 16px; 
    width: 16px; 
    left: 4px; 
    bottom: 4px; 
    background-color: #ffffff; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    transition: transform 0.4s var(--ease-spring), width 0.25s ease; 
    border-radius: 50%; 
}
.switch:active .slider:before {
    width: 20px;
}
input:checked + .slider { background-color: #e5a93d; }
body.light-theme input:checked + .slider { background-color: #c48312; }
input:checked + .slider:before { transform: translateX(18px); }
.switch:active input:checked + .slider:before { transform: translateX(14px); }

/* --- RESPONSIVE NAVIGATION RULES --- */
@media (max-width: 1280px) {
    .central-header { padding: 20px 20px 15px; }
    .central-header img.logo { max-width: 180px; }
    .mobile-break { display: inline; }

    .right-sidebar {
        width: 100%;
        position: relative; 
        top: 0; 
        padding: 15px 10px; 
        text-align: center;
        border-bottom: 1px solid var(--border-subtle);
        max-height: none; 
        overflow-y: visible;
    }
    
    .right-sidebar nav a {
        text-align: center;
        line-height: 1.3;
        font-size: 0.85rem;
        white-space: normal; 
    }

    .right-sidebar nav #sidebar-irl-links {
        display: flex !important;
        flex-direction: row !important; 
        justify-content: center;
        align-items: flex-start;
        gap: 15px; 
        padding: 0;
        margin: 0;
        width: 100%;
        max-height: 500px !important; 
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .right-sidebar nav #sidebar-irl-links li {
        flex: 1;
        display: flex;
        justify-content: center;
        text-align: center;
    }

    #irl-toggle-btn,
    #sidebar-mc-links,
    .right-sidebar nav #sidebar-irl-links::after,
    .sidebar-divider,
    .desktop-sidebar-only {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .mobile-only { display: flex; } 
    .desktop-only { display: none !important; }
    .sidebar-toggle { justify-content: center; gap: 10px; margin-bottom: 15px; }
}

@media (max-width: 480px) {
    .hamburger-btn { top: 20px; right: 20px; }
}

/* --- ADDITIONAL LIGHT MODE NAVIGATION REFINEMENTS --- */
body.light-theme #openSettingsBtn, 
body.light-theme #backToNavBtn { 
    stroke: var(--text-primary); 
}
#openSettingsBtn:hover {
    transform: rotate(65deg);
    stroke: var(--accent-gold) !important;
}
#backToNavBtn:hover { 
    stroke: var(--accent-gold) !important; 
    transform: translateX(-8px) !important;
}
body.light-theme .central-header img.logo { 
    filter: invert(1); 
}
