.task-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.task-item {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 0.5rem;
    padding: 0.8rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-item.dragging {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.1);
    border: 2px dashed var(--white);
}

.task-item.completed .task-content {
    text-decoration: line-through;
    opacity: 0.7;
}

.drag-handle {
    cursor: grab;
    opacity: 0.5;
    user-select: none;
    
    /* AGGIUNTA FONDAMENTALE PER MOBILE */
    touch-action: none; /* Dice al browser: "Qui non scrollare" */
    padding: 10px; /* Aumenta l'area cliccabile per il dito */
}

.task-content {
    flex-grow: 1;
    outline: none;
    border-bottom: 1px solid transparent;
}

.task-content:focus {
    border-bottom: 1px solid var(--white);
}

.btn-delete {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
}

.btn-delete:hover {
    opacity: 1;
    color: #ffcccc;
}

/* Modal Base */
dialog {
    background: var(--primary-bg);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    /* Transizione fluida */
    transition: opacity 0.3s allow-discrete, display 0.3s allow-discrete, overlay 0.3s allow-discrete;
    opacity: 0;
    
    /* RIMOSSO overflow: hidden per permettere al menu a tendina di uscire se necessario */
}

dialog[open] {
    opacity: 1;
}

/* Glassmorphism Backdrop */
dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    transition: backdrop-filter 0.3s;
}

/* Layout Interno */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    opacity: 0.8;
}

#settings-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 350px;
    overflow-y: overlay; /* Usa overlay per sovrapporre la barra */
    padding-right: 5px; /* Spazio per non coprire il testo */
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

legend {
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

/* Inputs styling */
.input-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group input {
    width: 70px;
    padding: 8px;
    border-radius: 6px;
    border: none;
    background: rgba(0,0,0,0.15);
    color: var(--white);
    text-align: right;
    font-size: 1rem;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.range-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.range-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="range"] {
    flex-grow: 1;
    accent-color: var(--accent); /* Colore nativo del browser che si adatta al tema */
}

/* Footer & Buttons */
.modal-footer {
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-text-danger {
    background: none;
    border: none;
    color: #ffadad;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.8;
}

.btn-text-danger:hover {
    opacity: 1;
    text-decoration: underline;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* Piccola variante per il bottone save */
.main-action-btn.small {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    transform: translateY(0); /* Rimuove l'effetto 3d eccessivo del bottone start */
}

/* Stats Counter */
.daily-stats {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.daily-stats:hover {
    opacity: 1;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* --- ICON SYSTEM --- */
.icon {
    width: 24px;
    height: 24px;
    fill: currentColor; /* Eredita il colore dal genitore (bianco) */
    display: inline-block;
    vertical-align: middle;
    pointer-events: none; /* Evita che il click targetti l'SVG invece del bottone */
}

/* Icona più piccola per le liste */
.icon.small {
    width: 20px;
    height: 20px;
}

/* --- BUTTON STYLES UPDATES --- */

/* Bottone generico per icone nell'header/sezioni */
.icon-btn-large {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.icon-btn-large:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Fix per il bottone delete nelle task */
.btn-delete {
    display: flex; /* Centra l'SVG */
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.btn-delete:hover {
    background: rgba(255, 0, 0, 0.2); /* Sfondo rosso leggero */
    color: #ffadad; /* Icona diventa rosata */
}

/* Aggiustamento header container */
header .container nav {
    display: flex;
    align-items: center;
}

/* Aggiungi questo in components.css */
select {
    padding: 8px;
    border-radius: 6px;
    border: none;
    background: rgba(0,0,0,0.15);
    color: var(--white);
    font-family: inherit;
    cursor: pointer;
    text-align: right; /* Allinea il testo a destra come gli input numerici */
}

select option {
    background: #333; /* Fallback scuro per le opzioni del sistema operativo */
    color: white;
}

/* Custom Number Stepper */
.number-stepper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1); /* Sfondo leggero */
    border-radius: 8px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.number-stepper input[type="number"] {
    background: transparent;
    border: none;
    text-align: center;
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    width: 50px; /* Larghezza fissa per stabilità */
    padding: 8px 0;
    appearance: textfield;
    -moz-appearance: textfield; /* Nasconde frecce Firefox */
}

/* Nasconde frecce Chrome/Safari/Edge */
.number-stepper input::-webkit-outer-spin-button,
.number-stepper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.step-btn {
    background: transparent;
    border: none;
    color: var(--white);
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
    border-radius: 6px;
}

.step-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.step-btn:active {
    transform: scale(0.95);
}

/* --- CUSTOM SELECT COMPONENT (COMPACT & GLASS) --- */

.custom-select {
    position: relative;
    /* RIDOTTO: Da 100% a 160px per essere più compatto */
    width: 160px; 
    font-family: inherit;
    z-index: 1;
}

/* FIX SOVRAPPOSIZIONE: Quando aperto, deve stare sopra a tutto */
.custom-select.open {
    z-index: 1000;
}

/* 1. Il Bottone (Trigger) */
.select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Si adatta ai 160px del genitore */
    padding: 10px 14px; /* Padding leggermente ridotto per compattezza */
    
    /* STILE VETRO CHIARO (Identico agli altri pulsanti) */
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    border-radius: 8px;
    color: var(--white);
    font-size: 0.95rem; /* Testo leggermente più piccolo */
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-trigger:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.select-trigger .arrow {
    width: 16px;
    height: 16px;
    opacity: 0.7;
    transition: transform 0.3s ease;
    flex-shrink: 0; /* Evita che la freccia si schiacci */
    margin-left: 8px;
}

.custom-select.open .arrow {
    transform: rotate(180deg);
}

/* 2. Il Menu a Tendina (Lista Opzioni) */
.select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%; /* Stessa larghezza del trigger (160px) */
    
    /* SFONDO CHIARO TRASPARENTE (Uniforme al resto) */
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    /* BLUR FORTE PER LEGGIBILITÀ */
    backdrop-filter: blur(25px); 
    -webkit-backdrop-filter: blur(25px);
    
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    
    list-style: none;
    padding: 4px;
    
    /* Animazione */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Quando è aperto */
.custom-select.open .select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 3. Le Opzioni */
.select-options li {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--white);
    font-size: 0.9rem;
    transition: background 0.2s;
    margin-bottom: 2px;
    white-space: nowrap; /* Evita che il testo vada a capo */
    overflow: hidden;
    text-overflow: ellipsis; /* Puntini se il testo è troppo lungo */
}

/* Hover e Selected */
.select-options li:hover,
.select-options li.selected {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

/* --- SETTINGS CLOSE BUTTON STYLE --- */

#btn-close-settings {
    /* Dimensione e Spaziatura */
    width: 36px;
    height: 36px;
    padding: 0;
    
    /* Centratura Icona */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Stile Base */
    border-radius: 8px; /* Stesso raggio degli altri input */
    background: transparent; /* Invisibile di base */
    color: var(--white);
    transition: background 0.2s ease;
}

/* Hover Effect: Stesso "Glass" degli altri pulsanti */
#btn-close-settings:hover {
    background: rgba(255, 255, 255, 0.15); 
}

/* Active Effect: Click */
#btn-close-settings:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
}

/* --- CUSTOM SETTINGS SCROLLBAR (Full Split Style) --- */

/* 2. Dimensioni e Track (Identico alla Main Page) */
#settings-form::-webkit-scrollbar {
    width: 14px; 
}

#settings-form::-webkit-scrollbar-track {
    background: transparent;
}

/* 3. CONFIGURAZIONE PULSANTI (Split Top/Bottom) */
#settings-form::-webkit-scrollbar-button {
    display: block;
    height: 16px;
    width: 14px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

/* Nascondi i pulsanti doppi/inutili */
#settings-form::-webkit-scrollbar-button:vertical:start:increment,
#settings-form::-webkit-scrollbar-button:vertical:end:decrement {
    display: none;
}

/* FRECCIA SU (Solo in alto) */
#settings-form::-webkit-scrollbar-button:vertical:start:decrement {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 15l-6-6-6 6'/%3E%3C/svg%3E");
}

/* FRECCIA GIÙ (Solo in basso) */
#settings-form::-webkit-scrollbar-button:vertical:end:increment {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* 4. Il Cursore (Thumb) */
#settings-form::-webkit-scrollbar-thumb {
    border-radius: 8px;
    border: 3px solid transparent; 
    background-clip: content-box;
    transition: background-color 0.2s;
}


/* --- 5. COLORI DINAMICI (Ereditati dal Body) --- */

/* === POMODORO (Rosso) === */
body[data-mode="pomodoro"] #settings-form::-webkit-scrollbar-thumb,
body[data-mode="pomodoro"] #settings-form::-webkit-scrollbar-button {
    background-color: rgba(255, 100, 100, 0.3);
}
body[data-mode="pomodoro"] #settings-form::-webkit-scrollbar-thumb:hover,
body[data-mode="pomodoro"] #settings-form::-webkit-scrollbar-button:hover {
    background-color: rgba(255, 100, 100, 0.8);
}
body[data-mode="pomodoro"] #settings-form::-webkit-scrollbar-thumb:active,
body[data-mode="pomodoro"] #settings-form::-webkit-scrollbar-button:active {
    background-color: rgba(255, 100, 100, 1);
}


/* === SHORT BREAK (Verde Acqua) === */
body[data-mode="short-break"] #settings-form::-webkit-scrollbar-thumb,
body[data-mode="short-break"] #settings-form::-webkit-scrollbar-button {
    background-color: rgba(70, 200, 180, 0.3);
}
body[data-mode="short-break"] #settings-form::-webkit-scrollbar-thumb:hover,
body[data-mode="short-break"] #settings-form::-webkit-scrollbar-button:hover {
    background-color: rgba(70, 200, 180, 0.8);
}
body[data-mode="short-break"] #settings-form::-webkit-scrollbar-thumb:active,
body[data-mode="short-break"] #settings-form::-webkit-scrollbar-button:active {
    background-color: rgba(70, 200, 180, 1);
}


/* === LONG BREAK (Blu) === */
body[data-mode="long-break"] #settings-form::-webkit-scrollbar-thumb,
body[data-mode="long-break"] #settings-form::-webkit-scrollbar-button {
    background-color: rgba(70, 150, 255, 0.3);
}
body[data-mode="long-break"] #settings-form::-webkit-scrollbar-thumb:hover,
body[data-mode="long-break"] #settings-form::-webkit-scrollbar-button:hover {
    background-color: rgba(70, 150, 255, 0.8);
}
body[data-mode="long-break"] #settings-form::-webkit-scrollbar-thumb:active,
body[data-mode="long-break"] #settings-form::-webkit-scrollbar-button:active {
    background-color: rgba(70, 150, 255, 1);
}

/* --- 2. VOLUME SLIDER (Total Freeze) --- */

/* 1. La Barra (Track) */
input[type="range"] {
    -webkit-appearance: none; /* Rimuove stile nativo */
    appearance: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    
    /* BLOCCA QUALSIASI MOVIMENTO */
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
    margin: 0; /* Evita spostamenti strani */
}

/* Rimuove l'outline blu del focus su Chrome */
input[type="range"]:focus {
    outline: none;
}

/* 2. Il Pallino (Thumb) - Chrome/Safari/Edge */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    margin-top: -6px; /* Centra il pallino sulla barra (se usi runnable-track standard) */
    
    /* BLOCCA LO ZOOM AL PASSAGGIO DEL MOUSE */
    transform: none !important; 
    transition: none !important;
    box-shadow: none !important;
}

/* Stato Hover del Pallino (Forziamo le dimensioni fisse) */
input[type="range"]::-webkit-slider-thumb:hover {
    transform: none !important;
    scale: 1 !important; /* Forza scala 1:1 */
    box-shadow: none !important;
}

/* 3. La Pista (Track) - Chrome/Safari */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    
    /* BLOCCA ANIMAZIONI SULLA PISTA */
    transform: none !important;
    transition: none !important;
}

/* 4. Supporto Firefox (Thumb) */
input[type="range"]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border: none;
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    
    /* BLOCCA ZOOM */
    transform: none !important;
    transition: none !important;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: none !important;
    scale: 1 !important;
}

/* --- 3. CUSTOM CHECKBOX (Auto Start Breaks) --- */

/* Nascondiamo la checkbox nativa del browser */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    
    /* Dimensioni Aumentate */
    width: 26px;
    height: 26px;
    
    /* Stile Glass identico agli altri input */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    
    /* Posizionamento per la spunta */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    
    /* Assicuriamoci che non si schiacci */
    flex-shrink: 0;
}

/* Effetto Hover */
input[type="checkbox"]:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Stato CHECKED (Selezionato) */
input[type="checkbox"]:checked {
    background: rgba(255, 255, 255, 0.25); /* Più chiaro quando attivo */
    border-color: rgba(255, 255, 255, 0.5);
}

/* La Spunta (Checkmark) disegnata con CSS */
input[type="checkbox"]:checked::after {
    content: '';
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0; /* Crea una "L" */
    transform: rotate(45deg) translateY(-2px); /* Ruota la "L" per fare una spunta */
}

/* --- CONFIRMATION MODAL (Mini Popup) --- */

#confirm-modal {
    /* Dimensioni */
    width: 90%;
    max-width: 320px;
    padding: 24px;
    
    /* Stile Scuro Glass */
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--white);
    
    /* Evita scrollbar indesiderate */
    overflow: hidden; 
}

#confirm-modal[open] {
    opacity: 1;
}

/* Backdrop sopra ai settings */
#confirm-modal::backdrop {
    background: rgba(0, 0, 0, 0.6); /* Più scuro per focalizzare l'attenzione */
    backdrop-filter: blur(2px);
}

#confirm-modal h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3rem;
    color: #fff;
}

#confirm-modal p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Bottoni affiancati */
.modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Pulsante Annulla (Glass Neutro) */
.btn-glass {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Pulsante Conferma (Danger Red Glass) */
.btn-danger-glass {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 50, 50, 0.3); /* Bordo rosso sottile */
    background: rgba(255, 0, 0, 0.15); /* Sfondo rosso trasparente */
    color: #ffcccc; /* Testo rosato chiaro */
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger-glass:hover {
    background: rgba(255, 0, 0, 0.25);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2); /* Glow rosso */
    color: white;
}

/* --- RESPONSIVE FIXES --- */

@media (max-width: 768px) {
    /* Su Mobile, la X di chiusura deve essere sempre visibile (non solo hover) */
    #btn-close-settings {
        background: rgba(255, 255, 255, 0.1); /* Sfondo visibile di default */
        border: 1px solid rgba(255, 255, 255, 0.05); /* Bordo sottile */
    }
    
    /* Opzionale: La rendiamo anche leggermente più grande per il dito */
    #btn-close-settings {
        width: 40px;
        height: 40px;
    }
}

/* --- MOBILE: NASCONDI SCROLLBAR SETTINGS --- */
@media (max-width: 768px) {
    /* Nasconde visivamente la barra nel form */
    #settings-form::-webkit-scrollbar {
        display: none;
    }
    
    /* Assicura compatibilità */
    #settings-form {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* --- SETTINGS SHORTCUTS SECTION --- */

.settings-divider {
    /* 1. Impedisci a Flexbox di schiacciarla */
    flex-shrink: 0; 
    
    /* 2. Dimensioni forzate */
    display: block;
    width: 100%;
    height: 1px; /* Altezza minima */
    
    /* 3. Stile Visivo (Usa border-top invece di background per sicurezza) */
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.5); /* Opacità aumentata */
    
    /* 4. Spaziatura */
    margin: 20px 0;
}

/* Titolo della sezione */
.shortcuts-container h3 {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Griglia per allineare tutto */
.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.1); /* Sfondo leggermente scuro per staccare */
    padding: 15px;
    border-radius: 12px;
}

/* La singola riga (Azione a sinistra, Tasti a destra) */
.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Stile dei tasti fisici */
.shortcut-item kbd {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1); /* Effetto 3D del tasto */
    margin: 0 2px;
}

/* Nascondi questa sezione su Mobile (visto che non hanno tastiera fisica) */
@media (max-width: 768px) {
    .shortcuts-container, 
    .settings-divider {
        display: none;
    }
}

/* --- TASK HEADER & OPTIONS MENU --- */

.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative; /* Importante per z-index */
    z-index: 10;
}

.task-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Bottone Quadrato Glass */
.glass-btn-square {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.glass-btn-square:hover,
.glass-btn-square.active {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Wrapper per posizionamento relativo del menu */
.task-options-wrapper {
    position: relative;
}

/* IL MENU DROPDOWN */
.dropdown-menu {
    position: absolute;
    top: 110%;
    right: 0;       
    left: auto;
    width: 200px;
    
    /* CAMBIAMENTO: Sfondo chiaro ghiacciato invece di scuro */
    background: rgba(255, 255, 255, 0.15); 
    
    /* Blur più forte per rendere leggibile il testo sopra lo sfondo */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    /* Bordo più luminoso */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 6px;
    
    /* Ombra più morbida ma presente per staccarlo dallo sfondo */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    
    /* Animazione Apertura */
    transform-origin: top left;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    z-index: 100;
}

/* Stato Nascosto */
.dropdown-menu.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
    pointer-events: none;
    visibility: hidden;
}

/* FIX SICUREZZA VISIBILITÀ MENU */
.dropdown-menu:not(.hidden) {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

/* --- MENU ITEMS (Singole voci) --- */

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    
    /* Testo bianco puro di base */
    color: white; 
    font-weight: 500;
    font-size: 0.9rem;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease; /* Transizione fluida */
}

/* 1. HOVER GENERICO (Per "Clear finished tasks") */
/* Si illumina di bianco */
.menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(2px); /* Piccolo movimento a destra per feedback */
}

/* 2. STILE DESTRUCTIVE BASE (Per "Clear all tasks") */
/* Ora è bianco puro (white) esattamente come "Clear finished tasks" */
.menu-item.destructive {
    color: #fff; 
}

/* 3. HOVER DESTRUCTIVE */
/* Anche l'hover è identico: sfondo ghiaccio chiaro */
.menu-item.destructive:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    transform: translateX(2px);
    box-shadow: none;
}

/* Icone all'interno del menu */
.menu-item svg {
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* --- CUSTOM CONFIRM MODAL --- */

/* Stile base del dialog (se non lo hai già) */
.glass-modal {
    background: transparent;
    border: none;
    padding: 0;
    margin: auto;
    color: white;
}

/* Sfondo scuro dietro il modale (Backdrop) */
.glass-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Il box di vetro interno */
.modal-content {
    background: transparent; /* Il background lo gestisce il dialog padre ora */
    /* RIMOSSO: backdrop-filter qui (lo fa il padre) */
    border: none;
    border-radius: 16px;
    padding: 0; /* Il padding lo gestisce il padre */
    
    /* FIX DEL PROBLEMA: Larghezza adattabile, non fissa */
    width: 100%; /* Era 300px -> Questo causava lo scrollbar! */
    max-width: 100%;
    
    text-align: center;
    box-shadow: none; /* L'ombra la fa il padre */
}

/* Bottone Pericolo (Rosso Glass) */
.glass-btn-danger {
    background: rgba(255, 50, 50, 0.2);
    border: 1px solid rgba(255, 50, 50, 0.3);
    color: #ffcccc;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.glass-btn-danger:hover {
    background: rgba(255, 50, 50, 0.4);
    color: white;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
}

/* Bottone Normale (riutilizza il tuo stile o usa questo) */
.glass-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- TASK CONFIRM MODAL (Fix stile scuro) --- */

#task-confirm-modal {
    /* Dimensioni identiche all'altro popup */
    width: 90%;
    max-width: 320px;
    padding: 24px;
    
    /* Stile Scuro Solido (Copiato dal Reset Modal) */
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--white);
    
    /* Centratura e pulizia */
    margin: auto;
    overflow: hidden; /* Niente scrollbar! */
    
    /* Animazione */
    transition: opacity 0.2s allow-discrete, display 0.2s allow-discrete;
    opacity: 0;
}

#task-confirm-modal[open] {
    opacity: 1;
    display: block;
}

/* Rimuoviamo lo sfondo interno duplicato */
#task-confirm-modal .modal-content {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    width: 100%;
    padding: 0;
}

/* --- ZEN MODE MODAL (Fix stile scuro) --- */

#zen-ad-modal {
    /* Dimensioni */
    width: 90%;
    max-width: 400px; /* Un po' più largo per il testo dell'ad */
    padding: 30px;
    
    /* Stile Scuro Solido (Identico agli altri) */
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--white);
    
    /* Centratura */
    margin: auto;
    overflow: hidden;
    
    /* Animazione */
    transition: opacity 0.2s allow-discrete, display 0.2s allow-discrete;
    opacity: 0;
}

#zen-ad-modal[open] {
    opacity: 1;
    display: block;
}

/* Rimuoviamo lo sfondo interno duplicato */
#zen-ad-modal .modal-content {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    width: 100%;
    padding: 0;
}

/* --- ZEN EXIT MODAL (Stile Scuro) --- */

#zen-exit-modal {
    width: 90%;
    max-width: 350px;
    padding: 24px;
    
    /* Stile Scuro Solido */
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--white);
    
    margin: auto;
    overflow: hidden;
    
    transition: opacity 0.2s allow-discrete, display 0.2s allow-discrete;
    opacity: 0;
}

#zen-exit-modal[open] {
    opacity: 1;
    display: block;
}

#zen-exit-modal .modal-content {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    width: 100%;
    padding: 0;
}

/* --- INFO MODAL (Stile Scuro Generico) --- */

#info-modal {
    width: 90%;
    max-width: 320px;
    padding: 24px;
    
    /* Stile Scuro Solido */
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: var(--white);
    
    margin: auto;
    overflow: hidden;
    
    transition: opacity 0.2s allow-discrete, display 0.2s allow-discrete;
    opacity: 0;
}

#info-modal[open] {
    opacity: 1;
    display: block;
}

#info-modal .modal-content {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    width: 100%;
    padding: 0;
}