/* =============================================
   ALVI Dochádzka — Layout v2 (Sidebar, Topbar, Main)
   Premium SaaS-grade layout
   ============================================= */

/* ── App Layout ────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--al-bg);
}

/* ── Sidebar ───────────────────────────────── */
.sidebar {
    width: var(--al-sidebar-w);
    background:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.10) 0%, transparent 50%),
        linear-gradient(180deg, #070b16 0%, #0c1425 30%, #0f172a 60%, #0b1220 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Sidebar glow line at top */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--al-primary), var(--al-purple), transparent);
    opacity: 0.6;
    z-index: 1;
}

.sidebar-brand {
    padding: 28px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
}

.sidebar-brand h1 {
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.3px;
}

.sidebar-brand .brand-logo {
    width: 40px; height: 40px;
    background: var(--al-gradient-primary);
    border-radius: var(--al-radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 900; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    position: relative;
}

.sidebar-brand .brand-logo::after {
    content: '';
    position: absolute; inset: -2px;
    border-radius: var(--al-radius);
    background: var(--al-gradient-primary);
    opacity: 0.3;
    filter: blur(8px);
    z-index: -1;
}

.sidebar-brand p {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
    padding: 20px 14px;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    color: #475569;
    padding: 20px 14px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    border-radius: var(--al-radius-sm);
    cursor: pointer;
    transition: var(--al-transition);
    font-size: 13.5px;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 3px;
    position: relative;
    user-select: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.12) 100%);
    color: #c7d2fe;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 24px;
    background: var(--al-gradient-primary);
    border-radius: 0 6px 6px 0;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.nav-item .nav-icon {
    width: 22px; text-align: center; font-size: 16px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.7;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--al-gradient-primary);
    color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--al-radius-full);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 18px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px; color: #64748b; font-weight: 500;
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #475569;
    transition: background 0.3s;
    flex-shrink: 0;
}

.status-dot.online {
    background: var(--al-success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2), 0 0 12px rgba(34, 197, 94, 0.4);
    animation: alPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-dot.offline { background: var(--al-danger); }

@keyframes alPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Main Area ─────────────────────────────── */
.main-area {
    flex: 1;
    margin-left: var(--al-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Main Content ──────────────────────────── */
.main-content {
    flex: 1;
    position: relative;
}

/* ── Top Bar ───────────────────────────────── */
.topbar {
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topbar-left {
    display: flex; align-items: center; gap: 16px;
}

.topbar-left h2 {
    font-size: 18px; font-weight: 800;
    letter-spacing: -0.5px; color: var(--al-text);
    background: linear-gradient(135deg, var(--al-text) 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-right {
    display: flex; align-items: center; gap: 12px;
}

.topbar-time {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 12px; color: var(--al-text-muted); font-weight: 500;
    background: var(--al-bg);
    padding: 6px 14px;
    border-radius: var(--al-radius-full);
    border: 1px solid var(--al-border);
    letter-spacing: 0.3px;
}

.topbar-user {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: 600; color: var(--al-text-secondary);
    padding: 4px 6px 4px 14px;
    border-radius: var(--al-radius-full);
    background: var(--al-bg);
    border: 1px solid var(--al-border);
    transition: var(--al-transition);
}

.topbar-user:hover { border-color: var(--al-primary-glow); }

.topbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--al-gradient-primary);
    color: #fff; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ── Page Content ──────────────────────────── */
.page-content {
    padding: 28px 32px 40px;
    animation: alPageIn 0.3s ease;
}

@keyframes alPageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hamburger */
.hamburger {
    display: none;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    cursor: pointer; border-radius: var(--al-radius-sm);
    border: 1px solid var(--al-border);
    background: transparent; font-size: 16px;
    transition: var(--al-transition);
    color: var(--al-text-muted);
}

.hamburger:hover {
    border-color: var(--al-primary);
    color: var(--al-primary);
    background: var(--al-primary-light);
}
