body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    margin: auto;
}

h1 {
    text-align: center;
    color: #007bff;
    margin-bottom: 25px;
}

/* --- Date Navigator at Top --- */
.date-navigator-top { /* Renamed for clarity, combines prev/next day with current date and edit button */
    display: grid;
    grid-template-columns: auto 1fr auto auto; /* Prev, Date, Next, Edit button */
    align-items: center;
    gap: 10px; /* Space between items */
    margin-bottom: 25px;
}

.date-navigator-top button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    transition: background-color 0.2s ease;
}

.date-navigator-top button:hover {
    background-color: #0056b3;
}

#currentDateDisplay {
    margin: 0;
    font-size: 1.5em;
    color: #555;
    text-align: center;
}

#editNoteBtn {
    background-color: #ffc107; /* Yellow for edit */
    color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

#editNoteBtn.saving {
    background-color: #28a745; /* Green for saving */
    color: white;
}

#editNoteBtn:hover {
    background-color: #e0a800;
}

#editNoteBtn.saving:hover {
    background-color: #218838;
}

.hidden {
    display: none !important;
}

/* --- Note Input --- */
#noteInput {
    width: calc(100% - 20px);
    min-height: 180px; /* Increased height for main feature */
    padding: 10px;
    margin-bottom: 30px; /* Space before calendar */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    resize: vertical;
    box-sizing: border-box;
    background-color: #fff; /* Default editable background */
    transition: background-color 0.3s ease;
}

#noteInput:read-only {
    background-color: #f9f9f9; /* Lighter background for locked state */
    cursor: default; /* Indicate not editable */
    border-color: #e0e0e0; /* Lighter border for locked state */
}

/* --- Calendar Styling --- */
.calendar-wrapper {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
}

.calendar-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.calendar-header button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#calendarMonthYear {
    margin: 0;
    font-size: 1.2em;
    font-weight: normal;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #fff;
    padding: 10px;
}

.day-name {
    text-align: center;
    font-weight: bold;
    padding: 8px 0;
    color: #555;
    font-size: 0.9em;
}

.calendar-day {
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-size: 1.1em;
    color: #333;
    position: relative;
}

.calendar-day:hover:not(.empty) {
    background-color: #e0f2f7;
    transform: scale(1.05);
}

.calendar-day.empty {
    background-color: #f8f8f8;
    color: #ccc;
    cursor: default;
}

.calendar-day.today {
    background-color: #e0f2f7;
    border: 2px solid #007bff;
    font-weight: bold;
}

.calendar-day.selected {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.calendar-day.has-notes::after {
    content: '•';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    color: #28a745;
    font-size: 1.5em;
    line-height: 0;
}
.calendar-day.selected.has-notes::after {
    color: #fff;
}