/* src/public/css/layout.css */

/* --- Global Layout Variables --- */
:root {
    --sidebar-width: 250px;
    --header-height-mobile: 60px;
    --bottom-nav-height: 60px;
    --bg-color: #f4f6f8;
    /* Example background color */
    --ui-spacing-unit: 20px;
}

/* --- Layout Containers --- */

/* App Container: The main wrapper for the authenticated area */
.app-container {
    display: flex;
    flex-direction: column;
    /* Mobile first: Column */
    min-height: 100vh;
    background-color: var(--bg-color);
}

/* Main Content Area */
.main-content {
    flex: 1;
    width: 100%;
    padding-bottom: var(--bottom-nav-height);
    /* Space for bottom nav on mobile */
    overflow-x: hidden;
}

/* Page Container: Limits content width and adds padding */
.page-container {
    width: 100%;
    max-width: 1200px;
    /* Standard Max Width */
    margin: 0 auto;
    padding: 16px;
}

.page-container.wide {
    max-width: 1600px;
}

/* --- Sidebar (Desktop) --- */
.sidebar {
    display: none;
    /* Hidden on mobile */
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid #e1e4e8;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-direction: column;
    padding: 20px;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 30px;
}

.sidebar-logo img {
    height: 32px;
    /* Adjust based on actual logo */
    width: auto;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    color: #4a5568;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav-item i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
    background-color: #f9c747;
    /* Primary Brand Color */
    color: #1a202c;
    font-weight: 500;
}

/* Brand Switcher in Sidebar */
.sidebar .brand-switcher {
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* --- Responsive Grid System --- */
.responsive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* --- Media Queries --- */

/* Desktop / Tablet Landscape */
@media (min-width: 1024px) {
    .app-container {
        flex-direction: row;
        /* Switch to Row for Sidebar */
    }

    .sidebar {
        display: flex;
        /* Show Sidebar */
    }

    .main-content {
        padding-bottom: 0;
        /* Remove bottom padding */
        padding-top: 20px;
        height: 100vh;
        overflow-y: auto;
    }

    .page-container {
        padding: 40px;
    }

    /* Hide Mobile Navigation */
    .bottom-nav {
        display: none !important;
    }

    /* Header Styles for Desktop */
    header {
        display: flex;
        /* Show header */
        justify-content: flex-end;
        /* Align to right */
        padding: 10px 40px;
        background: transparent;
    }

    /* Hide Mobile Header Elements on Desktop */
    header .logo,
    header .brand-switcher {
        display: none;
    }

    /* Show Deskop Profile */
    .desktop-profile {
        display: flex;
        align-items: center;
        gap: 15px;
        cursor: pointer;
        position: relative;
    }

    .desktop-profile img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    /* Ensure profile menu is positioned correctly relative to the new header location */
    .profile-menu {
        top: 60px;
        right: 40px;
    }

    /* Grid Expansions */
    .responsive-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .responsive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}