/* ============================================================
   LAYOUT.CSS — Header, Sidebar, Nav, App Shell, Responsive
   Dark futuristic theme — consistent across all pages
   ============================================================ */

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* ── Header / Nav Bar ── */
.header {
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 60px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem;
    height: 100%;
    max-width: 100%;
}

/* ── Logo ── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 1px;
    white-space: nowrap;
}
.nav-logo i {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 6px var(--primary-color));
}
.nav-logo:hover { color: var(--primary-color); }

/* Legacy .logo class support */
.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
    font-weight: 900;
}
.logo h1 {
    font-size: 1rem;
    font-weight: 900;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: 1px;
}
.logo i { font-size: 1.5rem; color: var(--primary-color); filter: drop-shadow(0 0 6px var(--primary-color)); }

/* ── Hamburger Button ── */
.btn-icon-only {
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: filter 0.2s;
}
.btn-icon-only:hover { filter: drop-shadow(0 0 6px var(--primary-color)); }
.btn-icon-only:focus { box-shadow: none; outline: none; }

/* ── Sub-Header (Dashboard stats bar) ── */
.sub-header {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 190;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 0.4rem 1.5rem;
    flex-wrap: wrap;
}

.sub-header-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.sub-header-stat .stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sub-header-stat .stat-value {
    color: var(--primary-color);
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    font-size: 0.85rem;
}

.sub-header-stat .stat-value.status-online {
    color: var(--success-color);
}

.sub-header-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

/* ── Header Stats (inside header, hidden on mobile) ── */
.header-stats { display: flex; gap: 1.5rem; }
.stat-item { text-align: center; }
.stat-label { display: block; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { display: block; font-size: 0.9rem; font-weight: 700; color: var(--primary-color); font-family: 'Orbitron', monospace; }
.status-online { color: var(--success-color) !important; }

/* ── Main Layout ── */
.main-content {
    display: flex;
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ── Sidebar (legacy, not used in offcanvas mode) ── */
.sidebar {
    width: 250px;
    background: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

/* ── Offcanvas Sidebar ── */
.offcanvas {
    background: var(--secondary-bg) !important;
    color: var(--text-primary) !important;
    border-right: 1px solid var(--border-color) !important;
    max-width: 300px !important;
    width: 80vw !important;
}
.offcanvas-title {
    font-family: 'Orbitron', monospace !important;
    letter-spacing: 1px;
    color: var(--primary-color) !important;
}
.offcanvas-header {
    border-bottom: 1px solid var(--border-color) !important;
    background: rgba(77, 171, 247, 0.05);
}
.btn-close-white { filter: invert(1) !important; }

/* ── Nav Menu (inside offcanvas) ── */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}
.nav-item:hover {
    background: var(--menu-bg-hover);
    border-color: var(--border-color);
    color: var(--primary-color);
}
.nav-item.active {
    background: rgba(77, 171, 247, 0.12);
    color: var(--primary-color);
    border-color: rgba(77, 171, 247, 0.4);
    font-weight: 600;
}
.nav-item i { font-size: 1rem; width: 18px; text-align: center; }

/* ── Content Area ── */
.content-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* ── Page Header Box (consistent across all pages) ── */
@keyframes pageHeaderReveal {
    from { opacity: 0; clip-path: inset(0 100% 0 0); }
    to   { opacity: 1; clip-path: inset(0 0% 0 0); }
}

.page-header-box {
    background: linear-gradient(135deg, rgba(77,171,247,0.07) 0%, rgba(124,58,237,0.05) 100%);
    border: 1px solid rgba(77,171,247,0.25);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.page-header-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--accent));
    border-radius: 10px 0 0 10px;
}
.page-header-box .section-header h2 {
    font-family: 'Orbitron', monospace;
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    white-space: normal;
    word-break: break-word;
    animation: pageHeaderReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.page-header-box .section-header h2 i {
    animation: none;
    display: inline-block;
}
.page-header-box .section-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    animation: pageHeaderReveal 0.8s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.section-header { margin-bottom: 1.5rem; }
.section-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    color: var(--primary-color);
    font-family: 'Orbitron', monospace;
}
.section-header p { color: var(--text-secondary); font-size: 0.9rem; }

/* ── Profile Dropdown ── */
.dropdown-menu {
    background: var(--secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
    min-width: 200px;
}
.dropdown-item {
    color: var(--text-primary) !important;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: background 0.15s;
}
.dropdown-item:hover {
    background: var(--menu-bg-hover) !important;
    color: var(--primary-color) !important;
}
.dropdown-item.text-danger { color: var(--danger-color) !important; }
.dropdown-item.text-danger:hover { background: rgba(245, 108, 108, 0.1) !important; }
.dropdown-item.text-warning { color: var(--warning-color) !important; }
.dropdown-item-text { color: var(--text-secondary) !important; font-size: 0.85rem; padding: 0.4rem 1rem; }
.dropdown-divider { border-color: var(--border-color) !important; }

/* ── Auth Modal ── */
.modal-content {
    background: var(--secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}
.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    background: rgba(77, 171, 247, 0.05);
}
.modal-footer {
    border-top: 1px solid var(--border-color) !important;
}
.modal-title { color: var(--primary-color) !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .header-content { padding: 0 0.75rem; }
    .nav-logo { font-size: 0.9rem; }
    .nav-logo i { font-size: 1.3rem; }
    .content-area { padding: 1rem 0.75rem; }
    .sub-header { gap: 1rem; padding: 0.35rem 0.75rem; font-size: 0.75rem; }
    .sub-header-stat .stat-label { font-size: 0.65rem; }
    .sub-header-stat .stat-value { font-size: 0.75rem; }
    .sub-header-divider { display: none; }
}

@media (max-width: 480px) {
    .nav-logo span.logo-text { display: none; }
    .sub-header { gap: 0.75rem; }
}
