/* ZyWeb — mode clair / sombre */

html {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

/* —— Variables mode clair —— */
html[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --bg-elevated: #e2e8f0;
    --border: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --accent: #0891b2;
    --vote: #d97706;
    --vote-hover: #f59e0b;
    --shadow: 0 8px 32px rgba(15, 23, 42, .08);
    --bg-deep: #f8fafc;
    --glow-primary: rgba(99, 102, 241, .12);
    --glow-accent: rgba(8, 145, 178, .08);
}

html[data-theme="light"] body {
    background-image:
        radial-gradient(ellipse 90% 55% at 50% -15%, var(--glow-primary), transparent 55%),
        radial-gradient(ellipse 50% 35% at 100% 20%, var(--glow-accent), transparent),
        radial-gradient(ellipse 40% 30% at 0% 80%, rgba(245, 158, 11, .04), transparent);
}

html[data-theme="light"] .site-header {
    background: rgba(248, 250, 252, .9);
}

html[data-theme="light"] .site-header.is-scrolled {
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 4px 24px rgba(15, 23, 42, .08);
    border-bottom-color: var(--border);
}

html[data-theme="light"] .logo-text {
    background: linear-gradient(135deg, #0f172a 30%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .main-nav.open {
    background: rgba(255, 255, 255, .98);
}

html[data-theme="light"] .nav-toggle {
    background: var(--bg-card);
}

html[data-theme="light"] ::selection {
    background: rgba(79, 70, 229, .25);
    color: #0f172a;
}

html[data-theme="light"] .server-row:hover {
    background: rgba(99, 102, 241, .06);
}

html[data-theme="light"] .alert-danger {
    color: #b91c1c;
    background: rgba(239, 68, 68, .1);
}

html[data-theme="light"] .server-status.is-offline {
    color: #b91c1c;
    background: rgba(239, 68, 68, .08);
}

html[data-theme="light"] .auth-panel {
    background: linear-gradient(145deg, rgba(99, 102, 241, .08), rgba(8, 145, 178, .05));
}

html[data-theme="light"] .page-hero {
    background: linear-gradient(180deg, rgba(99, 102, 241, .06) 0%, transparent 100%);
}

html[data-theme="light"] .site-footer {
    background: linear-gradient(180deg, transparent, rgba(241, 245, 249, .95));
}

html[data-theme="light"] .podium-card,
html[data-theme="light"] .featured-card {
    box-shadow: 0 4px 20px rgba(15, 23, 42, .06);
}

/* Admin / client */
html[data-theme="light"] .admin-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

html[data-theme="light"] .admin-overlay {
    background: rgba(15, 23, 42, .35);
}

html[data-theme="light"] .admin-topbar,
html[data-theme="light"] .data-table th {
    background: var(--bg-card);
}

html[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(99, 102, 241, .05);
}

html[data-theme="light"] .dns-status-item.is-ok {
    background: rgba(16, 185, 129, .08);
}

html[data-theme="light"] .dns-status-item.is-missing {
    background: rgba(245, 158, 11, .08);
}

/* Bouton thème */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .2s, transform .2s, background .2s;
}

.theme-toggle:hover {
    border-color: var(--primary);
    transform: scale(1.04);
}

.theme-icon {
    font-size: 1.1rem;
    line-height: 1;
}

html[data-theme="dark"] .theme-icon-sun,
html:not([data-theme]) .theme-icon-sun {
    display: none;
}

html[data-theme="light"] .theme-icon-moon {
    display: none;
}

.header-inner .theme-toggle {
    margin-left: auto;
    margin-right: .5rem;
}

.main-nav.open ~ .theme-toggle,
.header-inner:has(.main-nav.open) .theme-toggle {
    z-index: 101;
}

.admin-topbar .theme-toggle {
    width: 38px;
    height: 38px;
}

@media (max-width: 768px) {
    .header-inner .theme-toggle {
        order: 2;
        margin-right: .35rem;
        margin-left: 0;
    }
    .header-inner .nav-toggle {
        order: 3;
    }
}
