/* assets/css/layout.css */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Mobile Dynamic Top Bar --- */
.mobile-topbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: 60px;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.mobile-topbar.hidden {
    transform: translateY(-100%); /* Slides up when scrolling down */
}

.mobile-topbar img {
    width: 30px; height: auto; margin-right: 10px;
}

.mobile-topbar h2 {
    color: var(--maroon-primary); font-size: 1.2rem; margin: 0;
}


/* --- Navigation Styling --- */
.main-nav {
    background-color: var(--white);
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    display: flex;
    z-index: 1000;
}

.nav-link {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    padding: 15px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link i {
    margin-right: 12px;
    font-size: 1.2rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--maroon-primary);
    background-color: var(--primary-soft-bg, rgba(128, 0, 0, 0.05));
    border-left: 4px solid var(--maroon-primary);
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    width: 100%;
}

/* --- Desktop Layout (Sidebar) --- */
@media (min-width: 769px) {
    .main-nav {
        flex-direction: column;
        width: 250px;
        position: fixed;
        height: 100vh;
        left: 0;
        top: 0;
    }
    .main-content {
        margin-left: 250px; /* Offset for sidebar */
    }
}

/* --- Mobile Layout (Bottom Nav) --- */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .mobile-topbar { display: flex; } /* Show Top Bar */
    
    .app-container {
        flex-direction: column;
    }
    
    .main-nav {
        position: fixed;
        bottom: 0; left: 0; width: 100%;
        height: 65px;
        flex-direction: row;
        justify-content: flex-start;
        overflow-x: auto; /* Allow swiping horizontally */
        -webkit-overflow-scrolling: touch;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        padding-bottom: env(safe-area-inset-bottom);
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    
    .main-nav::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }

    .nav-link {
        flex: 0 0 auto; /* Stop text from squashing */
        min-width: 75px; 
        flex-direction: column;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.65rem;
        border-left: none;
        border-top: 3px solid transparent;
        text-align: center;
    }

    .nav-link i {
        margin-right: 0; margin-bottom: 4px; font-size: 1.2rem;
    }

    .nav-link.active {
        border-left: none;
        border-top: 3px solid var(--maroon-primary);
    }
    
    /* Fix the logout button styles for horizontal layout */
    .nav-link[onclick="logoutUser()"] {
        margin-top: 0 !important;
        border-left: 1px solid #eee;
        border-top: 3px solid transparent !important;
    }

    .main-content {
        padding-top: 80px; /* Push content down for dynamic top bar */
        padding-bottom: 85px; /* Push content up for bottom nav */
    }
}