/* ═══════════════════════════════════════════════════════════
   Webradio Manager v2 — Layout Principal
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    display: flex;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════ SIDEBAR ═══════════ */

.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    height: calc(100vh - var(--footer-h));
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--duration) var(--ease);
}

.sidebar-header {
    padding: var(--sp-md) var(--sp-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.sidebar-header-right {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color var(--duration) var(--ease);
}

.sidebar-close:hover {
    color: var(--text-primary);
}

.hamburger {
    display: none;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 640px) {
    .hamburger {
        display: flex;
    }
    .sidebar-close {
        display: inline-flex;
    }
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 98;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--duration) var(--ease);
    }
    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.logo-text {
    font-size: var(--fs-md);
    font-weight: 400;
    color: var(--text-secondary);
}

.logo-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

.logo-version {
    font-size: var(--fs-xs);
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-sm) 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    padding: var(--sp-sm) var(--sp-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: all var(--duration) var(--ease);
    border-left: 3px solid transparent;
}

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

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-item.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

/* ═══════════ MAIN CONTENT ═══════════ */

.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--footer-h));
    overflow: hidden;
    position: relative;
}

.view {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-lg);
    flex-direction: column;
    gap: var(--sp-md);
}

.view.active {
    display: flex;
}

.main-scroll {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: var(--sp-lg);
}

/* ═══════════ FOOTER ═══════════ */

.footer {
    height: var(--footer-h);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--sp-md);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
}

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

.live-indicator {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-disabled);
}

.live-indicator.live .live-dot {
    background: var(--danger);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.live-indicator.live {
    color: var(--danger);
}

.stream-status {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
}

.stream-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-disabled);
}

.stream-status.online .status-dot {
    background: var(--success);
}

/* Sidebar footer — bouton connexion/déconnexion */
.sidebar-footer {
    padding: var(--sp-md);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
}

.sidebar-logout {
    width: 100%;
    justify-content: flex-start;
    opacity: 0.85;
}

.sidebar-logout:hover {
    opacity: 1;
}
