/* assets/css/layout.css */
/* Global Container System */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--bg-main);
}

.public-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    width: 100%;
}

.container {
    width: 100%;
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Master Structure */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    padding: var(--spacing-md); 
    padding-bottom: calc(var(--navbar-height) + var(--spacing-lg)); /* Enough room for bottom nav */
    max-width: 100vw;
}

/* Sidebar Structure - Slides in on Mobile */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0; /* Let the browser natively anchor the height to the viewport */
    width: var(--sidebar-width);
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom, 15px)); /* Android/iOS bottom safe zone */
    z-index: 1050;
    border-right: 1px solid var(--border-glass);
    overflow: hidden; /* Prevent outer scroll so inner menu flex scrolling works */
    background: var(--bg-secondary);
    transition: var(--transition-base);
    transform: translateX(-100%);
    visibility: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
}

.sidebar-header {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    /* In screenshots, branding or profile sits here nicely */
}

/* User profile block inside sidebar */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-glass);
}
.sidebar-profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
}
.sidebar-profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.sidebar-profile-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.sidebar-profile-role {
    font-size: 0.75rem;
    color: var(--accent-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--spacing-md);
}

/* Hide scrollbar for cleaner look but keep functionality */
.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
}

.sidebar-menu a i {
    width: 24px;
    text-align: left;
    margin-right: var(--spacing-sm);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.sidebar-menu a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-menu a.active {
    background: rgba(14, 165, 233, 0.15); /* Soft blue background for active item */
    color: var(--text-primary);
}
.sidebar-menu a.active i {
    color: var(--accent-primary);
}

/* Bottom Logout in Sidebar */
.sidebar-logout {
    margin-top: auto;
    padding-top: var(--spacing-lg);
}

/* Header Handling */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    width: 100%;
    padding: var(--spacing-xs) 0;
}

.top-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
    font-weight: 700;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Fixed Bottom Mobile Navigation */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background: rgba(15, 17, 26, 0.85); /* Glassy nav bar */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 0 var(--spacing-md);
    border-top: 1px solid rgba(255,255,255,0.05); /* Soft top border glow */
}

.bottom-nav-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    gap: 4px;
    flex: 1;
    height: 100%;
    position: relative; /* For the active dot */
}

.bottom-nav-menu a i {
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

.bottom-nav-menu a.active,
.bottom-nav-menu a:hover {
    color: var(--accent-primary);
}

.bottom-nav-menu a.active i {
    color: var(--accent-primary);
}

.bottom-nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: 8px; /* Position under the icon/text */
    width: 4px;
    height: 4px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--accent-glow);
}
