/* layout.css - Header, Nav, Main, Footer */

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 var(--space-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(15, 37, 68, 0.3);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xl);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.header-brand svg {
    width: 28px;
    height: 28px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.entity-selector {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.entity-selector:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.entity-selector:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.header-settings {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.header-settings:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Main Layout */
.main-layout {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* Sidebar Navigation */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #0f2544 0%, #152d50 100%);
    border-right: none;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 2px 0 12px rgba(15, 37, 68, 0.15);
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.nav {
    padding: var(--space-sm) 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 9px var(--space-lg);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 400;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 500;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.5;
    flex-shrink: 0;
}

.nav-item:hover svg {
    opacity: 0.8;
}

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

.nav-section {
    padding: var(--space-md) var(--space-lg) var(--space-xs);
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: var(--space-lg);
    min-width: 0;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.page-title {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text);
}

.page-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Footer / Status Bar */
.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-left: 220px;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.03);
}

.footer-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
}

.status-indicator.warning {
    background-color: var(--warning);
}

.status-indicator.error {
    background-color: var(--danger);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content,
    .footer {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 var(--space-md);
    }
    
    .main-content {
        padding: var(--space-md);
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
}
