:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --background-color: #f4f7f9;
    --card-background: #ffffff;
    --text-color: #333;
    --weekend-bg: #f8f9fa;
    --border-color: #dee2e6;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 10px;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

header { text-align: center; margin-bottom: 25px; }
h1 { font-size: 1.6em; color: var(--primary-color); margin-bottom: 5px; }
p { color: var(--secondary-color); margin-top: 0; }

.controls {
    background-color: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.input-group { display: flex; flex-direction: column; margin-bottom: 12px; }
.input-group-row { display: flex; gap: 15px; }
.input-group-row .input-group { width: 100%; }

label { font-size: 0.85em; font-weight: 500; margin-bottom: 5px; color: #555; }
input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    box-sizing: border-box;
    background-color: #fff;
}
input:focus, select:focus { outline: 2px solid var(--primary-color); border-color: transparent; }

.button-primary {
    width: 100%;
    padding: 14px;
    font-size: 1em;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.button-primary:hover { background-color: var(--primary-hover); }

#riepilogo-totali {
    text-align: center;
    background: var(--primary-color);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.totale-box span { font-size: 0.9em; opacity: 0.9; }
.totale-box strong { font-size: 1.5em; display: block; }

#days-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.day-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.day-card:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.day-card.weekend { background-color: var(--weekend-bg); }
.day-card.has-hours { border-left: 4px solid var(--primary-color); }
.day-card .day-number { font-size: 1.4em; font-weight: 600; }
.day-card .day-name { font-size: 0.75em; color: var(--secondary-color); }
.day-card .day-hours { font-size: 0.9em; font-weight: 500; color: var(--primary-color); min-height: 1.2em; }

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 15px;
    box-sizing: border-box;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    animation: modal-appear 0.3s ease;
}
@keyframes modal-appear { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.modal-content h2 { margin-top: 0; text-align: center; }
.time-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.modal-actions { display: flex; gap: 15px; margin-top: 20px; }
.modal-actions button { width: 100%; }
.button-secondary { background-color: var(--secondary-color); }

/* FLOATING ACTION BUTTON (FAB) */
.fab-container { position: fixed; right: 25px; bottom: 25px; z-index: 999; }
.fab {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.fab.open { transform: rotate(45deg); }
.fab-options {
    position: absolute;
    bottom: 65px;
    right: 5px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}
.fab-container.open .fab-options { opacity: 1; visibility: visible; transform: translateY(0); }
.fab-action {
    display: flex; align-items: center;
    background: var(--card-background);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    border: none;
    font-size: 0.9em;
    font-weight: 500;
}
.fab-action i { margin-left: 8px; }
#download-btn { color: #28a745; }
#share-btn { color: #17a2b8; }