/* Fixed Header Bar */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0; /* Add this */
    width: 100%;
    height: 40px;
    background: #7fa0a9ff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    /* Mobile fixes */
    -webkit-transform: translate3d(0, 0, 0); /* Better than translateZ */
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform; /* Hint to browser for optimization */
}

.site-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.site-title:visited {
    color: white;
}

.site-title:hover {
    opacity: 0.9;
}

/* Add padding to body to prevent content from being hidden under header */
body {
    padding-top: 40px;
    /* Mobile fixes */
    -webkit-overflow-scrolling: touch;
}

/* Sandwich Menu Styles */
.sandwich-menu {
    display: flex;
    align-items: center;
    height: 100%;
}

.menu-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-right: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    border-radius: 0;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hamburger {
    width: 24px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-panel {
    position: fixed;
    top: 0;
    left: -350px;
    width: 320px;
    height: 100%;
    background: linear-gradient(135deg, #dadce6ff 0%, #a0cbdfff 100%);
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.menu-panel.active {
    left: 0;
}

.menu-header {
    background: linear-gradient(135deg, #a4bfd6ff 0%, #4b6ba2ff 100%);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    padding: 0;
}

.menu-close-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    font-size: 24px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 10000 !important;
    border-radius: 0 !important;
}

.menu-close-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: rotate(90deg) !important;
}

.menu-content {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section-title {
    padding: 10px 25px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.menu-item {
    display: block;
    padding: 12px 25px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #333;
    border-left-color: #667eea;
    transform: translateX(5px);
}

.menu-item.home {
    background: rgba(47, 111, 168, 0.1);
    border-left-color: #2f6fa8;
    font-weight: 600;
}

.menu-item.admin {
    background: rgba(250, 112, 154, 0.1);
    border-left-color: #fa709a;
}

.menu-item.logout {
    background: rgba(255, 107, 107, 0.1);
    border-left-color: #ff6b6b;
    color: #d63384;
}

.menu-item.logout:hover {
    background: rgba(255, 107, 107, 0.2);
    color: #d63384;
}

.menu-item.current-page {
    background: rgba(102, 126, 234, 0.2);
    border-left-color: #667eea;
    font-weight: 600;
}

/* ── VV sub-menu ─────────────────────────────────────────────── */

.menu-submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 25px;
    color: #333;
    font-size: inherit;
    font-family: inherit;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.menu-submenu-toggle:hover {
    background: rgba(255, 255, 255, 0.5);
    border-left-color: #667eea;
    transform: translateX(5px);
}

.menu-submenu-toggle.is-open {
    background: rgba(255, 255, 255, 0.3);
    border-left-color: #667eea;
}

.menu-submenu-arrow {
    font-size: 10px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.menu-submenu-toggle.is-open .menu-submenu-arrow {
    transform: rotate(90deg);
}

.menu-submenu-items {
    max-height: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.04);
    transition: max-height 0.25s ease;
}

.menu-submenu-items.is-open {
    max-height: 600px;
}

.menu-submenu-items .menu-item {
    padding-left: 36px;
    font-size: 0.93em;
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

/* Hide header and menu in fullscreen mode */
:fullscreen .site-header,
:-webkit-full-screen .site-header,
:fullscreen .menu-overlay,
:-webkit-full-screen .menu-overlay,
:fullscreen .menu-panel,
:-webkit-full-screen .menu-panel { display: none !important; }

:fullscreen body,
:-webkit-full-screen body { padding-top: 0 !important; }

/* Mobile responsiveness */
@media (max-width: 480px) {
    .menu-panel {
        width: 280px;
        left: -290px;
    }
    
    .site-title {
        font-size: 1.1rem;
    }
}