/* Jeff's Architecture - Skin Layout
   File: skins/default/css/layout.css
*/

/* --- GLOBAL CONTAINERS --- */

/* Standard Page Wrapper */
.container {
    width: 95%; 
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Fluid Container (Admin/Charts) */
.container-fluid {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* App Wrapper (Sticky Footer Setup) */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Keeping the gap as a backup */
    gap: 2rem; 
}

/* --- HEADER NAVIGATION --- */
header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-card);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Logo */
.logo {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Navigation Controls (Right Side) */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* HAMBURGER MENU (Desktop & Mobile) */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background-color: var(--bg-surface-2);
    border-color: var(--primary);
    color: var(--primary);
}

/* The Drawer */
.nav-collapsible {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%; 
    right: 0;
    width: 260px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-top: none;
    box-shadow: var(--shadow-float);
    border-radius: 0 0 0 var(--radius-md);
    padding: 1rem;
    margin-top: 0.75rem; 
    z-index: 100;
}

/* JS Toggle Class */
.nav-collapsible.active {
    display: block;
    animation: slideDown 0.2s ease-out;
}

.nav-collapsible ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-collapsible a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: var(--radius-md);
}

.nav-collapsible a:hover, 
.nav-collapsible a.active {
    background-color: var(--bg-surface-2);
    color: var(--text-main);
    padding-left: 1.25rem; 
}

/* Header Buttons */
.header-auth-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* --- ADMIN LAYOUT (Split Screen) --- */
.admin-layout-wrapper {
    display: flex;
    /* Ensure it fills the remaining height in the flex wrapper */
    flex: 1; 
    background-color: var(--bg-body);
}

.admin-sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color); /* Visual separation from header */
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding-top: 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.sidebar-header {
    padding: 0 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.sidebar-label {
    font-family: var(--font-head);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.admin-main {
    flex-grow: 1;
    padding: 0 2rem; /* Side padding only, top handled by wrapper gap */
    overflow-x: hidden; 
}

/* --- MESSENGER LAYOUT --- */
.messenger-view {
    flex: 1;
}

/* --- FOOTER --- */
.app-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem 0; 
    
    /* SPACING FIX: Forced top margin instead of auto */
    margin-top: 4rem; 
    
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- ANIMATIONS --- */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 900px) {
    .admin-layout-wrapper {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1rem;
        border-radius: 0;
    }
    
    .admin-main {
        padding: 1rem;
    }
}