/* Calendar Styles */
.calendar-container {
    width: 100%;
    margin: 0 auto;
    font-family: yorkten-slab-normal, sans-serif;
    color: #666; /* dark-green */
    overflow: hidden; /* Prevent overflow */
    max-width: 100%; /* Ensure it doesn't exceed its container */
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    /* padding: 10px 0; */
}

.calendar-month-year {
    font-family: Estilo;
    font-size: 1.75rem;
    text-transform: uppercase;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-nav-btn {
    background-color: #F5F2E8; /* light-yellow */
    border: none;
    color: #666; /* dark-green */
    padding: 6px 12px;
    cursor: pointer;
    font-family: yorkten-slab-normal, sans-serif;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.calendar-nav-btn:hover {
    background-color: #D4B53B; /* yellow */
    color: white;
}

.calendar-nav-btn:disabled {
    background-color: #f5f2e8;
    color: #ccc;
    cursor: not-allowed;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    width: 100%;
    max-width: 100%; /* Ensure grid doesn't exceed container width */
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    padding: 6px;
    background-color: #F5F2E8; /* light-yellow */
    font-size: 0.9rem;
}

.calendar-day {
    aspect-ratio: 1/0.7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3px;
    border: 1px solid #F5F2E8; /* light-yellow */
    transition: background-color 0.3s;
    position: relative;
    box-sizing: border-box; /* Include padding in width calculation */
    min-width: 0; /* Allow cell to shrink below content size if needed */
}

.calendar-day:hover {
    background-color: #F5F2E8; /* light-yellow */
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day.today {
    background-color: #F5F2E8; /* light-yellow */
    font-weight: bold;
}

.calendar-day.past-day {
    opacity: 0.4;
}

.calendar-day.booked {
    background-color: #ED9963; /* salmon */
    color: white;
}

.calendar-day.booked:hover {
    background-color: #e58953; /* darker salmon */
}

.calendar-day.booked::after {
    content: "Booked";
    font-size: 0.65rem;
    position: absolute;
    bottom: 2px;
}

.calendar-day.partially-booked {
    background-image: linear-gradient(to bottom right, transparent 49.5%, #ED9963 50%);
    color: #666; /* dark-green - keep text color dark for readability */
}

.calendar-day.partially-booked:hover {
    background-image: linear-gradient(to bottom right, #F5F2E8 49.5%, #e58953 50%);
}

.calendar-day.partially-booked::after {
    content: "Partial";
    font-size: 0.65rem;
    position: absolute;
    bottom: 2px;
    color: white; /* Make text visible against the colored background */
}

/* Calendar 1 booking (top left) */
.calendar-day.cal1-booked {
    background-image: linear-gradient(to bottom right, #ED9963 49.5%, transparent 50%);
    color: #666; /* dark-green - keep text color dark for readability */
}

.calendar-day.cal1-booked:hover {
    background-image: linear-gradient(to bottom right, #e58953 49.5%, #F5F2E8 50%);
}

.calendar-day.cal1-booked::after {
    content: attr(data-cal1-name);
    font-size: 0.65rem;
    position: absolute;
    top: 5px;
    left: 5px;
    color: white; /* Make text visible against the colored background */
}

/* Calendar 2 booking (bottom right) */
.calendar-day.cal2-booked {
    background-image: linear-gradient(to bottom right, transparent 49.5%, #ED9963 50%);
    color: #666; /* dark-green - keep text color dark for readability */
}

.calendar-day.cal2-booked:hover {
    background-image: linear-gradient(to bottom right, #F5F2E8 49.5%, #e58953 50%);
}

.calendar-day.cal2-booked::after {
    content: attr(data-cal2-name);
    font-size: 0.65rem;
    position: absolute;
    bottom: 5px;
    right: 5px;
    color: white; /* Make text visible against the colored background */
}

.calendar-day.unavailable {
    background-color: #f5f5f5;
    color: #aaa;
    cursor: not-allowed;
}

.calendar-day-number {
    font-size: 1rem;
    margin-bottom: 3px;
}

.calendar-loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: #7699B8; /* blue */
}

.calendar-error {
    text-align: center;
    padding: 20px;
    color: #ED9963; /* salmon */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calendar-month-year {
        font-size: 1.3rem;
    }
    
    .calendar-day-number {
        font-size: 0.85rem;
    }
    
    .calendar-day.booked::after {
        font-size: 0.55rem;
    }
}

/* Additional responsive adjustments for when calendar is in a column */
@media (min-width: 768px) and (max-width: 991px) {
    .calendar-container {
        font-size: 0.9rem;
    }
    
    .calendar-month-year {
        font-size: 1.2rem;
    }
    
    .calendar-grid {
        gap: 2px;
    }
    
    .calendar-day {
        padding: 2px;
        aspect-ratio: 1/0.5;
    }
    
    .calendar-day-number {
        font-size: 0.75rem;
        margin-bottom: 1px;
    }
    
    .calendar-day.booked::after {
        font-size: 0.5rem;
    }
    
    .calendar-day-header {
        padding: 4px;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .calendar-grid {
        gap: 1px;
    }
    
    .calendar-day {
        padding: 1px;
        aspect-ratio: 1/0.7; /* Even more reduced height for mobile */
    }
    
    .calendar-day-header {
        padding: 3px;
        font-size: 0.8rem;
    }
    
    .calendar-day-number {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .calendar-day.booked::after {
        font-size: 0.45rem;
        bottom: 1px;
    }
}

/* Fix for calendar in layout with adjacent content */
@media (min-width: 992px) and (max-width: 1199px) {
    .calendar-grid {
        gap: 2px;
    }
    
    .calendar-day {
        aspect-ratio: 1/0.6;
        padding: 2px;
    }
    
    .calendar-day-number {
        font-size: 0.7rem;
    }
    
    .calendar-day.booked::after {
        font-size: 0.45rem;
    }
}
