/* layout.css — App shell: sidebar + content + login */

/* ─── App Shell ────────────────────────────────────────────── */
#app {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--sidebar-border);
    position: relative;
}

/* Subtle top glow accent */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--sidebar-brand);
    opacity: 0.6;
}

/* ─── Sidebar Header ──────────────────────────────────────── */
.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--sidebar-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.sidebar-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}

.sidebar-header .sidebar-version {
    font-size: 0.6rem;
    color: var(--sidebar-text);
    opacity: 0.5;
    font-weight: 400;
    margin-left: auto;
    font-family: var(--font-mono);
}

/* ─── Sidebar Navigation ──────────────────────────────────── */
.sidebar-nav {
    padding: 8px 0;
    flex: 1;
}

.nav-section {
    padding: 16px 16px 6px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    margin: 1px 8px;
    color: var(--sidebar-text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: calc(100% - 16px);
    text-align: left;
    font-family: inherit;
    border-radius: var(--radius);
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-active-text);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

/* Nav icon placeholder */
.nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.nav-item.active .nav-icon { opacity: 1; }

/* Nav item badge (notification count) */
.nav-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
    min-width: 18px;
    text-align: center;
}

/* ─── Sidebar Footer ──────────────────────────────────────── */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-user {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.sidebar-user strong {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 6px;
    border-radius: var(--radius);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.theme-toggle:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

/* ─── Main Content ─────────────────────────────────────────── */
.content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
    background: var(--bg-primary);
    min-width: 0;
}

/* ─── Login Layout ─────────────────────────────────────────── */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--login-bg);
    position: relative;
}

/* Ambient light pattern */
.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--login-pattern);
    pointer-events: none;
}

/* Animated grid overlay */
.login-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
                       linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.login-card {
    position: relative;
    z-index: 1;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Brand mark at top of login */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.login-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 4px;
    font-size: 1.3rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .content { padding: 24px; }
}

@media (max-width: 768px) {
    .sidebar {
        width: 64px;
    }

    .sidebar-header h2,
    .sidebar-header .sidebar-version { display: none; }
    .nav-item span:not(.nav-icon) { display: none; }
    .nav-section { display: none; }
    .sidebar-user { display: none; }
    .nav-badge { display: none; }

    .nav-item {
        justify-content: center;
        margin: 1px 4px;
        padding: 10px;
        width: calc(100% - 8px);
    }

    .nav-icon { opacity: 1; font-size: 1.1rem; }

    .content { padding: 16px; }

    .login-card {
        margin: 16px;
        padding: 28px;
    }
}
