/* assets/css/calendar-style.css (Updated for Mobile) */

.dihotel-calendar-wrapper {
    max-width: 900px;
    margin: 20px auto;
    font-family: Arial, sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}

.dihotel-calendar-wrapper .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dihotel-calendar-wrapper .calendar-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.dihotel-calendar-wrapper .calendar-header button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}
.dihotel-calendar-wrapper .calendar-header button:hover {
    background-color: #005a87;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    border: 1px solid #e0e0e0;
    min-height: 100px;
    padding: 8px;
    background-color: #f9f9f9;
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-day .day-number {
    font-weight: bold;
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

.calendar-day.day-header {
    background-color: #f0f0f0;
    font-weight: bold;
    text-align: center;
    min-height: auto;
    padding: 10px 5px;
    color: #333;
}

.calendar-day.empty {
    background-color: transparent;
    border: none;
}

.calendar-day.disabled {
    background-color: #ececec;
    color: #aaa;
}
.calendar-day.disabled .day-number {
    color: #b0b0b0;
}
.calendar-day.disabled .day-content {
    color: #b0b0b0;
}
.calendar-day.disabled::after {
    content: 'Hết phòng';
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    font-style: italic;
    color: #999;
}


.day-content {
    font-size: 18px;
    font-weight: bold;
    color: #2e7d32; /* Green */
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    line-height: 1.1;
}
.day-content .rooms-text {
    font-size: 12px;
    font-weight: normal;
    color: #666;
}

/* Spinner for loading state */
.calendar-grid.loading {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- BACKEND STYLES --- */
.dihotel-admin-calendar .calendar-month {
    margin-bottom: 30px;
}
.dihotel-admin-calendar .calendar-day {
    min-height: 120px;
}
.dihotel-admin-calendar .day-content {
    align-items: flex-start;
    justify-content: flex-start;
}
.booking-entry {
    display: block;
    background-color: #0073aa;
    color: #fff;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-bottom: 4px;
    text-decoration: none;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.booking-entry:hover {
    background-color: #005a87;
    color: #fff;
}


/*
==============================================
=== BẮT ĐẦU PHẦN TỐI ƯU HÓA CHO DI ĐỘNG ===
==============================================
*/
@media (max-width: 767px) {
    .dihotel-calendar-wrapper {
        padding: 10px;
    }

    .dihotel-calendar-wrapper .calendar-header h3 {
        font-size: 1.1em;
    }
    
    .dihotel-calendar-wrapper .calendar-header button {
        padding: 6px 12px;
    }

    .calendar-grid {
        gap: 2px; /* Giảm khoảng cách giữa các ô */
    }

    .calendar-day {
        min-height: 65px; /* Giảm chiều cao tối thiểu */
        padding: 4px;     /* Giảm padding */
    }

    .calendar-day.day-header {
        font-size: 10px; /* Chữ nhỏ hơn cho T2, T3... */
        font-weight: bold;
        padding: 6px 2px;
    }

    .calendar-day .day-number {
        font-size: 11px; /* Chữ nhỏ hơn cho số ngày */
    }

    .day-content {
        font-size: 14px; /* Chữ nhỏ hơn cho số phòng còn lại */
    }

    .day-content .rooms-text {
        font-size: 9px; /* Chữ "phòng" nhỏ hơn */
    }

    .calendar-day.disabled::after {
        font-size: 10px; /* Chữ "Hết phòng" nhỏ hơn */
        bottom: 5px;
    }
    
    .dihotel-admin-calendar .calendar-day {
        min-height: 80px;
    }
    .booking-entry {
        font-size: 10px;
        padding: 2px 4px;
    }
}