/* --- Keep all previous CSS --- */

/* Add styles for the new section */
#notes-section {
    margin-top: 20px; /* Space above notes section */
    padding: 15px;
    border: 1px solid #ddd; /* Consistent border */
    border-radius: 5px; /* Consistent radius */
    background-color: #ffffe0; /* Light yellow background */
}

#notes-section h5 {
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    color: #555; /* Darker text for heading */
    font-size: 1.1em;
}

#notes-textarea {
    width: 100%; /* Take full width */
    border: 1px solid #e6e6ca; /* Slightly darker yellow border */
    border-radius: 5px; /* Rounded corners */
    padding: 10px; /* Internal spacing */
    font-family: inherit; /* Use body font */
    font-size: 0.95em;
    resize: vertical; /* Allow vertical resizing */
    min-height: 60px; /* Minimum height */
    background-color: #fff; /* Make textarea background white for contrast */
    color: #333;
}

#notes-textarea::placeholder {
    color: #999;
    font-style: italic;
}


/* --- Rest of the previous CSS --- */

/* Ensure box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    background-color: #f4f4f4;
    background: url('rethink-target-heart-rate-number-ftr.jpg');
    background-repeat: repeat-y;
    background-size: cover;
    height:100%;
}

#calendar-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 600px;
    text-align: center;
}

#calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

#calendar-header button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    flex-shrink: 0;
}

#calendar-header button:hover {
    background: #0056b3;
}

#calendar-header h2#month-year {
    flex-grow: 1;
    margin: 0 15px;
    font-size: 1.4em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


#calendar-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 20px;
}

#calendar-grid th,
#calendar-grid td {
    border: 1px solid #ddd;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    height: 60px;
    position: relative;
    font-size: 1em;
    overflow: hidden;
}

#calendar-grid td > span.day-number {
    display: inline-block;
    padding: 10px;
    width: 100%;
    height: 100%;
    line-height: 40px;
}


#calendar-grid th {
    background-color: #eee;
    font-weight: bold;
    padding: 10px 5px;
    height: auto;
}

.calendar-day {
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.calendar-day:hover:not(.empty-cell) {
    background-color: #e9e9e9 !important;
    color: #333 !important;
}
.calendar-day.selected-day:hover {
     background-color: #d0f0d0 !important;
}


.empty-cell {
    background-color: #f9f9f9;
    cursor: default;
}
.empty-cell:hover {
     background-color: #f9f9f9;
}


.day-call { background-color: #dc3545 !important; color: white !important; }
.day-normal { background-color: #007bff !important; color: white !important; }
.day-off { background-color: #ffffff !important; color: #555 !important; border: 1px dashed #ccc;}


.selected-day {
    border: 3px solid #28a745 !important;
    background-clip: padding-box;
}

.selected-day > span.day-number {
    font-weight: bold;
}


#day-controls {
    margin-top: 0;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f8f8;
}

#day-controls.hidden {
    display: none;
}

#day-controls h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #555;
}

.control-button {
    padding: 8px 15px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    color: white;
    transition: opacity 0.2s ease;
}
.control-button:hover {
    opacity: 0.85;
}

.btn-call { background-color: #dc3545; }
.btn-normal { background-color: #007bff; }
.btn-off { background-color: #eee; color: #333; border: 1px solid #ccc;}


#monthly-summary {
    margin-top: 0; /* Already have margin from grid */
    /* margin-bottom: 20px; Let notes section handle top margin */
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f8f8;
    text-align: left;
}

#monthly-summary h4 {
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    color: #333;
}

#monthly-summary p {
    margin: 8px 0;
    color: #555;
    font-size: 0.95em;
}

#monthly-summary span {
    font-weight: bold;
    color: #000;
    display: inline-block;
    min-width: 30px;
    text-align: right;
    padding-right: 5px;
}
#monthly-summary span.value {
     min-width: 80px;
}