/* Variabili e impostazioni del tema */
:root {
    color-scheme: light dark;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --sidebar-open-bg: #393e8d;
}

/* Tema Light */
:root[data-theme="light"] {
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text: #0f172a;
    --border: #e2e8f0;
}

/* Tema Dark */
:root[data-theme="dark"] {
    --background: #0f172a;
    --card-bg: #1e293b;
    --text: #f8fafc;
    --border: #334155;
}

/* Tema System */
@media (prefers-color-scheme: light) {
    :root[data-theme="system"] {
        --background: #f8fafc;
        --card-bg: #ffffff;
        --text: #0f172a;
        --border: #e2e8f0;
    }
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] {
        --background: #0f172a;
        --card-bg: #1e293b;
        --text: #f8fafc;
        --border: #334155;
    }
}

/* Stili base globali */
body {
    font-family: 'Space Grotesk', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text);
    transition: background-color 0.3s, color 0.3s;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    width: 250px;
    height: 100%;
    background-color: var(--primary);
    color: #fff;
    padding: 20px;
    transition: transform 0.3s ease, background-color 0.3s ease-out;
    z-index: 1000;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar h2 {
    margin-bottom: 1rem;
    font-size: 1.5em;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin: 1rem 0;
}

.sidebar ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1em;
    cursor: pointer;
}

/* Pulsante sidebar */
.toggle-btn {
    position: fixed;
    top: 40px;
    left: -5px;
    transform: translateX(0);
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 1100;
    border-radius: 4px;
    font-size: 1.2em;
    transition: transform 0.3s ease, background-color 0.3s ease-out;
    clip-path: polygon(0% 0%, 80% 0%, 100% 50%, 80% 100%, 0% 100%);
}

.toggle-btn.moved {
    transform: translateX(290px);
}

/* Regole per tema dark */
:root[data-theme="dark"] .sidebar.open,
:root[data-theme="dark"] .toggle-btn.moved {
    background: var(--sidebar-open-bg);
}

/* Regole per tema system in modalità dark */
@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] .sidebar.open,
    :root[data-theme="system"] .toggle-btn.moved {
        background: var(--sidebar-open-bg);
    }
}

/* Overlay */
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 900;
}

#overlay.active {
    display: block;
}

/* Contenuto principale */
.main-content {
    margin: 20px;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

/* Selettore tema */
.global-theme-switcher {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 20px);
    right: max(20px, env(safe-area-inset-right));
    display: flex;
    gap: 8px;
    background: var(--card-bg);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.theme-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text);
    opacity: 0.5;
    transition: opacity 0.3s, background-color 0.3s;
}

.theme-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.theme-btn.active {
    opacity: 1;
    background: rgba(99, 102, 241, 0.1);
}

.theme-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Contenitore dell'orologio */
#arcaleian-clock {
    position: relative;
    display: inline-block;
    margin-top: 20px;
    width: 200px; /* Larghezza fissa (adatta al tuo font) */
}

/* Stile della data */
#arcaleian-clock .arcaleian-date {
    font-size: 0.9em;
    font-variant: small-caps;
    opacity: 0.5;
    position: absolute;
    right: -60px;   /* Allinea a destra del contenitore */
    top: 0;     /* Vicino all'ora */
}

/* Stile dell'orologio */
#arcaleian-clock .arcaleian-time {
    font-size: 4em;
    font-weight: bold;
    opacity: 0.75;
    display: block;
    text-align: left; /* Forza l'ora a sinistra */
    width: fit-content; /* Larghezza basata sul contenuto */
}

#arcaleian-clock .arcaleian-date .arcaleian-weekday {
    color: var(--primary); /* Cambia il colore del weekday */
    font-weight: bold;     /* Rende il weekday più visibile */
    opacity: 1.25;            /* Rimuovi l'opacità se necessario */
}

/* Informazioni di versione */
.version-info {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1em;
    opacity: 0.3;
    text-align: center;
    margin-top: 2rem;
}