/* ==============================================
   Header & Navigation Styles
   Extracted from inline <style> blocks in header.php
   for reduced HTML size and browser caching
   ============================================== */

/* Floating Action Buttons */
.floating-action-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    gap: 15px;
}
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #00ffff;
    border: 1px solid #00ffff;
    outline: none;
    width: 48px;
    height: 48px;
    border-radius: 0;
    font-size: 1.3rem;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}
.action-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    border-color: #00ffff;
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.25), inset 0 0 15px rgba(0, 255, 255, 0.06);
    transform: none;
}
#scrollToTopBtn { display: none; }

/* Lightning effect over header logo */
.logo-link { position: relative; display: inline-block; }
.logo-link .lightning-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    background:
        radial-gradient(circle at 30% 20%, rgba(0, 255, 255, 0.25), transparent 30%),
        radial-gradient(circle at 70% 70%, rgba(255, 0, 255, 0.25), transparent 35%),
        linear-gradient(115deg, transparent 47%, rgba(0, 255, 255, 0.8) 50%, transparent 53%);
    filter: drop-shadow(0 0 18px rgba(0, 255, 255, 0.9));
    opacity: 0;
    animation: lightningFlash 3s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes lightningFlash {
    0%, 60%, 100% { opacity: 0; }
    61% { opacity: 1; }
    62% { opacity: .2; }
    63% { opacity: .95; }
    64% { opacity: .15; }
    66% { opacity: .85; }
    68% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .logo-link .lightning-overlay { animation: none; opacity: 0; }
}

/* Force square corners on ALL mobile/tablet buttons */
@media screen and (max-width: 1024px) {
    .server-actions a, .server-actions .btn, .server-badges .badge,
    .server-stats-and-actions a, .server-stats-and-actions .badge,
    .btn, .btn-secondary, .btn-details, .btn-social, .btn-vote,
    a.btn, a.btn-secondary, a.btn-details, a.btn-social, a.btn-vote {
        border-radius: 0px !important;
        -webkit-border-radius: 0px !important;
        -moz-border-radius: 0px !important;
    }
}

/* Global reset-countdown styles */
.reset-countdown {
    background: none;
    color: #e0e0e0;
    box-shadow: none;
    border: none;
    padding: 0;
    min-width: unset;
    text-align: center;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.countdown-label i {
    color: #00ffff;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.35);
    animation: hourglassWobble 2.2s ease-in-out infinite;
    display: inline-block;
    transform-origin: 50% 60%;
}
@keyframes hourglassWobble {
    0% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 0 rgba(0,255,255,0)); }
    25% { transform: rotate(-10deg) scale(1.03); filter: drop-shadow(0 0 6px rgba(0,255,255,0.3)); }
    50% { transform: rotate(0deg) scale(1.05); filter: drop-shadow(0 0 10px rgba(0,255,255,0.45)); }
    75% { transform: rotate(10deg) scale(1.03); filter: drop-shadow(0 0 6px rgba(0,255,255,0.3)); }
    100% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 0 rgba(0,255,255,0)); }
}
@media (prefers-reduced-motion: reduce) {
    .countdown-label i { animation: none; text-shadow: none; }
}

/* Square style overrides */
.sort-controls .btn-sort, .sort-links .btn-sort { border-radius: 0 !important; }
.server-stats-and-actions .badge, .server-stats-and-actions a,
.server-stats-and-actions .btn, .server-stats-and-actions .btn-details,
.server-stats-and-actions .btn-secondary, .server-stats-and-actions .btn-vote {
    border-radius: 0 !important;
}

/* Desktop countdown */
.desktop-countdown { margin-right: 20px; }
.countdown-label {
    font-weight: normal;
    font-size: 0.9em;
    margin-bottom: 2px;
    color: #aaa;
    letter-spacing: normal;
}
.countdown-label i { margin-right: 6px; color: #00ffff; }
.countdown-timer {
    font-size: 0.95em;
    font-weight: normal;
    letter-spacing: normal;
    color: #00ffff;
}
.countdown-timer span {
    background: none;
    padding: 0;
    border-radius: 0;
    margin: 0 1px;
    display: inline;
    min-width: unset;
    color: #00ffff;
}

/* Desktop header layout */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 20;
}

/* Mobile header and navigation system */
@media (max-width: 900px) {
    body.drawer-open { overflow: hidden; }
    .navbar-toggler, .mobile-menu-toggle, .mobile-toggle,
    button[class*="navbar"], button[class*="toggle"] { display: none !important; }
    header {
        position: sticky; top: 0; background: #0a0a0f;
        box-shadow: 0 2px 12px rgba(0,0,0,0.3); z-index: 30; padding: 0.8rem 0;
    }
    header .container {
        display: flex; flex-direction: row; justify-content: center;
        align-items: center; padding: 0 0.5rem; position: relative;
    }
    #branding { margin: 0; text-align: center; display: flex; justify-content: center; }
    #branding h1 { margin: 0; }
    .header-logo { height: 65px; width: auto; }
    .desktop-countdown { display: none; }
    .reset-countdown-container {
        width: 100%; background: rgba(10, 10, 15, 0.95); padding: 8px;
        text-align: center; border-bottom: 1px solid rgba(0, 255, 255, 0.1);
        font-size: 0.9rem; z-index: 10;
    }
    .mobile-countdown-container .reset-countdown {
        display: inline-flex; flex-direction: row; align-items: center;
        justify-content: center; gap: 8px;
    }
    .mobile-controls {
        display: block; position: absolute; top: 0; left: 0;
        width: 100%; height: 56px; z-index: 35;
    }
    .mobile-nav-btn {
        position: absolute; background: none; border: none; color: #00ffff;
        font-size: 1.5rem; padding: 8px; cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        width: 44px; height: 44px; top: 50%; transform: translateY(-50%);
        pointer-events: auto;
    }
    .categories-btn { left: 8px; }
    .menu-btn { right: 8px; }
    .drawer-overlay {
        display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5); z-index: 9999; opacity: 0;
        transition: opacity 0.25s ease-in-out;
    }
    .drawer-overlay.active { display: block; opacity: 1; }
}

/* Desktop view styles */
@media (min-width: 901px) {
    .mobile-controls, .drawer-overlay, .mobile-drawer, .mobile-countdown-container {
        display: none !important;
    }
    header .container {
        display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1rem;
    }
    .header-logo { height: 80px !important; width: auto !important; }
    nav ul {
        display: flex !important; flex-direction: row; position: static;
        background: none; box-shadow: none;
    }
}

/* Mobile view styles */
@media (max-width: 900px) {
    .desktop-nav { display: none; }
    .mobile-controls { display: block; }
    header .container { justify-content: center; padding: 0.8rem 0.5rem; position: relative; }
}

/* Remove ALL bullet points from categories drawer */
.categories-drawer ul, .categories-drawer ol,
.categories-drawer .sidebar-menu,
.categories-drawer .drawer-content ul,
.categories-drawer .drawer-content .sidebar-menu {
    list-style: none !important; list-style-type: none !important;
    list-style-image: none !important; padding-left: 0 !important; margin-left: 0 !important;
}
.categories-drawer li, .categories-drawer .drawer-content li,
.categories-drawer .sidebar-menu li,
.categories-drawer .drawer-content .sidebar-menu li {
    list-style: none !important; list-style-type: none !important;
    list-style-image: none !important; display: block !important;
    padding-left: 0 !important; margin-left: 0 !important; position: relative !important;
}
.categories-drawer li::before, .categories-drawer li::after,
.categories-drawer li::marker,
.categories-drawer .drawer-content li::before,
.categories-drawer .drawer-content li::after,
.categories-drawer .drawer-content li::marker {
    display: none !important; content: none !important; width: 0 !important; height: 0 !important;
}
#categoriesDrawer ul, #categoriesDrawer li {
    list-style: none !important; list-style-type: none !important;
}
#categoriesDrawer li::marker { content: none !important; }

/* Mobile Drawer Styles */
.mobile-drawer {
    position: fixed; top: 0; bottom: 0; width: 320px; height: 100%;
    background: #0d0d14; box-shadow: 2px 0 16px rgba(0,0,0,0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto; z-index: 10000; display: flex; flex-direction: column;
}
.categories-drawer { left: 0; transform: translateX(-100%); }
.categories-drawer.active { transform: translateX(0); }
.nav-drawer { right: 0; transform: translateX(100%); }
.nav-drawer.active { transform: translateX(0); }

/* Drawer header */
.drawer-header {
    background: #0d0d14; color: #00ffff; padding: 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid #00ffff; position: sticky; top: 0;
    z-index: 10001; width: 100%; box-sizing: border-box;
}
.drawer-header h3 {
    margin: 0; color: #00ffff; font-size: 1.2rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.drawer-close-btn {
    background: rgba(255, 68, 68, 0.15); border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444; font-size: 1.2rem; cursor: pointer; padding: 5px;
    display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
}
.drawer-content { padding: 1rem; flex: 1; overflow-y: auto; padding-bottom: 2rem; }

/* Force remove list styles in drawer */
.drawer-content ul, .categories-drawer ul, .menu-drawer ul {
    list-style: none !important; list-style-type: none !important; padding-left: 0 !important;
}
.drawer-content li, .categories-drawer li, .menu-drawer li {
    list-style: none !important; list-style-type: none !important;
    list-style-image: none !important; background: none !important; padding-left: 0 !important;
}
.drawer-content li::before, .drawer-content li::marker,
.categories-drawer li::before, .categories-drawer li::marker,
.menu-drawer li::before, .menu-drawer li::marker {
    display: none !important; content: none !important;
}
.categories-drawer .sidebar-menu, .menu-drawer .sidebar-menu {
    list-style: none !important; padding-left: 0 !important;
}
.categories-drawer .sidebar-menu li, .menu-drawer .sidebar-menu li {
    list-style: none !important; list-style-type: none !important; list-style-image: none !important;
}

/* Mobile categories list */
.mobile-categories-list { list-style: none !important; list-style-type: none !important; padding: 0; margin: 0; }
.mobile-categories-list li { list-style: none !important; list-style-type: none !important; }
.mobile-nav-links li { margin-bottom: 8px; }
.mobile-nav-links a {
    display: block; padding: 14px 18px; color: #e0e0e0; text-decoration: none;
    font-size: 1.05rem; font-weight: 500; border-radius: 0;
    background: rgba(0, 255, 255, 0.05); border: 1px solid rgba(0, 255, 255, 0.25);
    border-left: 3px solid #00cccc; transition: all 0.25s ease;
}
.mobile-nav-links a:hover, .mobile-nav-links a:focus {
    background: rgba(0, 255, 255, 0.12); color: #00ffff;
    border-color: #00ffff; border-left: 3px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

/* Sidebar menu in mobile drawer */
.drawer-content .sidebar-menu { list-style: none !important; list-style-type: none !important; padding: 0; margin: 0; }
.drawer-content .sidebar-menu li { margin: 0; list-style: none !important; list-style-type: none !important; }
.drawer-content .sidebar-menu li::before, .drawer-content .sidebar-menu li::marker {
    display: none !important; content: none !important;
}
.drawer-content .sidebar-menu .category-link {
    display: flex !important; align-items: center; gap: 10px; padding: 8px 12px !important;
    color: #e0e0e0; text-decoration: none; transition: all 0.3s ease; border: none; width: 100%;
}
.drawer-content .sidebar-menu .category-link:hover { background-color: rgba(0, 255, 255, 0.08); color: #00ffff; }
.drawer-content .sidebar-menu .category-logo {
    width: 24px; height: 24px; object-fit: contain; border-radius: 4px; flex-shrink: 0;
}
.drawer-content .sidebar-menu .category-link span {
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem;
}
.drawer-content .sidebar-menu .category-link i {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    color: #00ffff; font-size: 1.1rem;
}

/* ==========================
   Modern Header Redesign
   ========================== */
:root {
    --rps-primary: #00ffff;
    --rps-primary-2: #ff00ff;
    --rps-primary-3: #00cccc;
    --rps-surface: rgba(10,10,15,0.9);
    --rps-border: rgba(0,255,255,0.14);
    --rps-hover: rgba(0,255,255,0.08);
}

/* Categories drawer consistent styles */
.categories-drawer .drawer-content, .categories-drawer .drawer-content * { box-sizing: border-box; }
.categories-drawer .drawer-content ul, .categories-drawer .drawer-content ol {
    list-style: none !important; padding-left: 0 !important; margin: 0 !important;
}
.categories-drawer .drawer-content li { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.categories-drawer .drawer-content a {
    display: block !important; padding: 12px 14px !important; color: #e0e0e0 !important;
    font-weight: 500 !important; text-decoration: none !important;
    border: 1px solid rgba(0, 255, 255, 0.25) !important;
    border-left: 3px solid #00cccc !important; background: rgba(0, 255, 255, 0.05) !important;
    border-radius: 0 !important; margin: 6px 0 !important;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease !important;
}
.categories-drawer .drawer-content a:hover, .categories-drawer .drawer-content a:focus {
    background: rgba(0, 255, 255, 0.12) !important; color: #00ffff !important;
    border-color: #00ffff !important; border-left: 3px solid #00ffff !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2) !important;
}
@media (max-width: 480px) {
    .categories-drawer .drawer-content a { padding: 9px 10px !important; }
}

/* Body padding for fixed header + 40px gap - prevents CLS */
/* Desktop: header ~130px + 40px gap = 170px */
body { padding-top: 170px; }
/* Mobile: header ~100px + 40px gap = 140px */
@media (max-width: 900px) {
    body { padding-top: 140px; }
}

/* Reserve space for Font Awesome icons before they load - prevents CLS */
.desktop-nav ul li a i, .countdown-label i, .mobile-nav-btn i,
.action-btn i, .mobile-nav-links a i {
    display: inline-block;
    width: 1em;
    height: 1em;
    text-align: center;
}
/* Stable nav link sizing to prevent font swap CLS */
.desktop-nav ul li a {
    min-height: 42px;
    min-width: 80px;
}

/* Header: flat, square style */
#mainHeader {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    background: #0a0a0f; border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    box-shadow: none; -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important; transition: transform 0.3s ease;
    min-height: 95px; /* Prevent CLS - reserve header space */
    contain: layout style;
}
#mainHeader.header-hidden { transform: translateY(-100%); }
#mainHeader .container {
    background: #0a0a0f; background-image: none; border: none;
    border-radius: 0; padding: 10px 16px 14px; box-shadow: none;
}
#mainHeader::before { content: none; }
#mainHeader::after {
    content: ""; position: absolute; bottom: 0; left: 0; right: 0;
    height: 1px; background: #00ffff;
}
#scrollProgressBar { display: none !important; }

/* Desktop navigation */
.desktop-nav ul { list-style: none; display: flex; align-items: center; gap: 10px; margin: 0; }
.desktop-nav ul li a {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px; border-radius: 0; color: #e0e0e0; text-decoration: none;
    border: 1px solid rgba(0, 255, 255, 0.2); background: transparent; transition: all .25s ease;
}
.desktop-nav ul li a::after {
    content: ""; position: absolute; left: 2px; right: 2px; bottom: -6px; height: 3px;
    background: linear-gradient(90deg, #00ffff, #ff00ff); display: none;
    transform: scaleX(0); transform-origin: left; transition: transform .25s ease; opacity: .95;
}
.desktop-nav ul li a:hover::after, .desktop-nav ul li a:focus::after { transform: scaleX(1); }
.desktop-nav ul li a:hover, .desktop-nav ul li a:focus {
    background: rgba(0, 255, 255, 0.08); color: #00ffff;
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.15), inset 0 0 12px rgba(0, 255, 255, 0.05);
}

/* CTA buttons */
.desktop-nav a.nav-cta {
    background: transparent; color: #00ffff !important; border: 1px solid #00ffff;
    border-radius: 0; box-shadow: 0 0 8px rgba(0, 255, 255, 0.15); animation: none;
}
.desktop-nav a.nav-cta::after { display: none; }
.desktop-nav a.nav-cta:hover, .desktop-nav a.nav-cta:focus {
    background: rgba(0, 255, 255, 0.1); color: #00ffff !important; border-color: #00ffff;
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.25), inset 0 0 15px rgba(0, 255, 255, 0.06);
}
.mobile-nav-links a.nav-cta {
    background: transparent; color: #00ffff !important; border: 1px solid #00ffff;
    border-radius: 0; box-shadow: 0 0 8px rgba(0, 255, 255, 0.15); animation: none;
}
.mobile-nav-links a.nav-cta:hover, .mobile-nav-links a.nav-cta:focus {
    background: rgba(0, 255, 255, 0.1); color: #00ffff !important; border-color: #00ffff;
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.25), inset 0 0 15px rgba(0, 255, 255, 0.06);
}

/* Countdown pill */
.desktop-countdown .countdown-timer {
    background: rgba(0,255,255,0.06); border: 1px solid rgba(0,255,255,0.15);
    padding: 6px 10px; border-radius: 0;
}
.desktop-countdown .countdown-timer span { font-weight: 600; }

/* Mobile controls polish */
.mobile-nav-btn {
    border-radius: 0; background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(0, 255, 255, 0.3); color: #00ffff;
}
.mobile-nav-btn:hover, .mobile-nav-btn:focus {
    background: #00ffff; color: #0a0a0f; border-color: #00ffff;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .desktop-nav a.nav-cta { transition: none; }
    #mainHeader::before { animation: none; }
    .desktop-nav a.nav-cta, .mobile-nav-links a.nav-cta { animation: none; }
    #scrollProgressBar { transition: none; }
}

/* Keyframes */
@keyframes headerAccent {
    0% { background-position: 0% 0; }
    100% { background-position: 100% 0; }
}
@keyframes ctaPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
