/* BASE */
body {
    font-family: 'Inter', sans-serif;
    background: #eceff1;
    display: flex;
    justify-content: center;
    padding: 40px;
    transition: background 0.4s ease, color 0.4s ease;
}

/* DARK MODE (pastello scuro elegante) */
body.dark {
    background: #1a2235;
    color: #f2f2f2;
}

body.dark .wrapper {
    background: #222a3d;
    border-color: #3a4258;
}

body.dark .planner td {
    background: #2a3147;
    border-color: #4a4f63;
    color: #f2f2f2;
}

body.dark .planner th {
    background: #2f3650 !important;
    color: #ffffff;
    border-bottom-color: #4a4f63;
}

body.dark .topbar {
    background: #2f3650 !important;
    color: #ffffff;
}

body.dark .notes-panel {
    border-left: 1px solid #4a4f63;
}

body.dark #monthNotes {
    background: #2a3147;
    color: #ffffff;
    border-color: #4a4f63;
}

body.dark .today {
    background: #3b4766 !important;
    border: 2px solid #6fa8dc !important;
    box-shadow: 0 0 0 2px rgba(111,168,220,0.25);
}

/* CONTENITORE */
.wrapper {
    background: white;
    padding: 30px;
    width: 1050px;
    border-radius: 16px;
    border: 1px solid #d0d0d0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: background 0.4s ease, border-color 0.4s ease;
}

/* LAYOUT */
.layout {
    display: flex;
    gap: 24px;
}

.calendar-area {
    flex: 3;
}

.notes-panel {
    flex: 1.2;
    border-left: 1px solid #e0e0e0;
    padding-left: 18px;
    transition: border-color 0.4s ease;
}

.notes-panel h2 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 8px;
}

.notes-panel p {
    font-size: 13px;
    color: #666;
    margin-top: 0;
    margin-bottom: 8px;
}

#monthNotes {
    width: 100%;
    height: 260px;
    border-radius: 10px;
    border: 1px solid #ccc;
    padding: 10px;
    font-size: 14px;
    resize: vertical;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* TOPBAR */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 18px;
    border-radius: 12px;
    color: #333;
    transition: background 0.4s ease, color 0.4s ease;
}

.nav-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.topbar h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-transform: capitalize;
}

.nav-buttons button {
    background: rgba(255,255,255,0.5);
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.nav-buttons button:hover {
    background: rgba(255,255,255,0.85);
}

/* COLORI PASTELLO PER I MESI (HEADER) */
.month-color-0 { background: #A7C7E7; }
.month-color-1 { background: #F5B7C8; }
.month-color-2 { background: #B7E4C7; }
.month-color-3 { background: #F7E6A6; }
.month-color-4 { background: #C8E6C9; }
.month-color-5 { background: #FFE0B2; }
.month-color-6 { background: #FFECB3; }
.month-color-7 { background: #FFD6A5; }
.month-color-8 { background: #D7CCC8; }
.month-color-9 { background: #FFCCBC; }
.month-color-10 { background: #CFD8DC; }
.month-color-11 { background: #D1C4E9; }

/* GIORNI SETTIMANA */
.weekdays-color-0 th { background: #A7C7E7; }
.weekdays-color-1 th { background: #F5B7C8; }
.weekdays-color-2 th { background: #B7E4C7; }
.weekdays-color-3 th { background: #F7E6A6; }
.weekdays-color-4 th { background: #C8E6C9; }
.weekdays-color-5 th { background: #FFE0B2; }
.weekdays-color-6 th { background: #FFECB3; }
.weekdays-color-7 th { background: #FFD6A5; }
.weekdays-color-8 th { background: #D7CCC8; }
.weekdays-color-9 th { background: #FFCCBC; }
.weekdays-color-10 th { background: #CFD8DC; }
.weekdays-color-11 th { background: #D1C4E9; }

/* TABELLA */
.planner {
    width: 100%;
    border-collapse: collapse;
}

.planner th {
    padding: 16px 0;
    font-size: 15px;
    color: #333;
    font-weight: 700;
    border-bottom: 2px solid #ddd;
    letter-spacing: 1px;
}

.planner td {
    height: 110px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    vertical-align: top;
    padding: 10px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.planner td:hover {
    background: #f0f0f0;
}

.day-number {
    font-size: 18px;
    font-weight: 600;
}

/* GIORNO DI OGGI */
.today {
    border: 2px solid #ff7043;
    background: #fffaf6;
}

/* PALLINO */
.note-dot {
    width: 10px;
    height: 10px;
    background: #ff5252;
    border-radius: 50%;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

/* POPUP */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 350px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    border: 1px solid #ccc;
}

.hidden {
    display: none;
}
