/* =============================================
   LAYOUT.CSS — Sidebar & Header Layout
   Shared by main.php and admin.php layouts
   ============================================= */

/* ===== CSS ROOT VARIABLES ===== */
:root {
    --bg-color: #09090b;
    --sidebar-color: #0c0c0e;
    --card-bg: #18181b;
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-primary: #14b8a6;
    --accent-hover: #0d9488;
    --glow-primary: rgba(20, 184, 166, 0.15);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --admin-accent: #f59e0b;
    --sidebar-width: 260px;
    --header-height: 64px;
}

/* ===== BASE ===== */
body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-color);
    border-right: 1px solid var(--card-border);
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}
.sidebar-nav {
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow-y: auto;
}
.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0.75rem 0.5rem;
}
.nav-label:first-child { margin-top: 0; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.nav-link.active { background: rgba(255,255,255,0.06); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.nav-link i { font-size: 1.1rem; opacity: 0.7; }

/* ===== TOP HEADER ===== */
.top-header {
    position: fixed;
    top: 0; right: 0;
    height: var(--header-height);
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1030;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Main layout classes */
.sidebar-visible .top-header { left: var(--sidebar-width); }
.sidebar-hidden .top-header { left: 0; }
/* Admin layout (always has sidebar) */
.admin-layout .top-header { left: var(--sidebar-width); }

.header-brand {
    display: flex; align-items: center; gap: 0.5rem;
    text-decoration: none; color: var(--text-primary);
    font-weight: 700; font-size: 1.25rem;
}
.header-brand-mobile {
    display: none; align-items: center; gap: 0.5rem;
    text-decoration: none; color: var(--text-primary);
    font-weight: 700; font-size: 1.15rem;
}

/* ===== ADMIN BADGE ===== */
.admin-badge {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.2);
    color: var(--admin-accent);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== MAIN CONTENT AREA ===== */
.main-content {
    padding-top: var(--header-height);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}
.sidebar-visible .main-content { margin-left: var(--sidebar-width); }
.sidebar-hidden .main-content { margin-left: 0; }
.admin-layout .main-content { margin-left: var(--sidebar-width); }

.content-inner {
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== USER DROPDOWN ===== */
.user-dropdown {
    background: rgba(255,255,255,0.03); border: 1px solid var(--card-border);
    border-radius: 8px; padding: 0.35rem 0.75rem;
    display: flex; align-items: center; gap: 0.75rem;
    cursor: pointer; transition: all 0.2s;
}
.user-dropdown:hover { background: rgba(255,255,255,0.06); }
.user-avatar { width: 28px; height: 28px; border-radius: 6px; background: var(--accent-primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; }
.user-avatar-admin { background: var(--admin-accent); }

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 1035;
    backdrop-filter: blur(4px);
}
.sidebar-overlay.show { display: block; }

/* ===== AUTH PAGES ===== */
.auth-container {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 1.5rem;
    background: var(--bg-color); position: relative; overflow: hidden;
}
.auth-glow {
    position: absolute; width: 600px; height: 600px;
    background: radial-gradient(circle, var(--glow-primary), transparent 70%);
    border-radius: 50%; top: -300px; right: -300px;
    opacity: 0.4; pointer-events: none;
}

/* ===== MOBILE ===== */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); width: 280px; }
    .sidebar.show { transform: translateX(0); }
    .top-header { left: 0 !important; }
    .main-content { margin-left: 0 !important; }
    .header-brand-mobile { display: flex; }
    .admin-layout .main-content { margin-left: 0; }
}
@media (max-width: 576px) {
    .content-inner { padding: 1.25rem 1rem; }
}
