body { 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

.cloud-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(to bottom, #87CEEB 0%, #B2E2F2 50%, #87CEEB 100%);
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 100px;
    opacity: 0.4;
    animation: float linear infinite;
    filter: blur(2px);
}

.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 100px;
}

.cloud-1 { width: 120px; height: 40px; top: 15%; animation-duration: 70s; }
.cloud-1::before { width: 60px; height: 60px; top: -30px; left: 15px; }
.cloud-1::after { width: 70px; height: 50px; top: -20px; right: 15px; }

.cloud-2 { width: 150px; height: 50px; top: 30%; animation-duration: 90s; animation-delay: -20s; }
.cloud-2::before { width: 70px; height: 70px; top: -35px; left: 20px; }
.cloud-2::after { width: 90px; height: 60px; top: -25px; right: 20px; }

.cloud-3 { width: 100px; height: 35px; top: 50%; animation-duration: 60s; animation-delay: -40s; }
.cloud-3::before { width: 50px; height: 50px; top: -25px; left: 10px; }
.cloud-3::after { width: 60px; height: 40px; top: -15px; right: 10px; }

.cloud-4 { width: 180px; height: 60px; top: 70%; animation-duration: 120s; animation-delay: -60s; }
.cloud-4::before { width: 90px; height: 90px; top: -45px; left: 25px; }
.cloud-4::after { width: 110px; height: 80px; top: -35px; right: 25px; }

.cloud-5 { width: 90px; height: 30px; top: 85%; animation-duration: 80s; animation-delay: -80s; }
.cloud-5::before { width: 45px; height: 45px; top: -22px; left: 8px; }
.cloud-5::after { width: 55px; height: 35px; top: -12px; right: 8px; }

@keyframes float {
    from { transform: translateX(-200px); }
    to { transform: translateX(110vw); }
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-cell {
    aspect-ratio: 1;
    min-height: 80px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.day-cell:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.day-cell.selected {
    border-color: #3b82f6;
    background: #dbeafe;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    color: #1e40af;
    font-weight: bold;
}
.day-cell.has-bookings::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background-color: #f59e0b;
    border-radius: 50%;
}

.day-cell.today {
    background-color: #fef3c7;
    font-weight: bold;
}

.day-cell.other-month {
    color: #9ca3af;
    background: #f9fafb;
    pointer-events: none;
}
.day-cell.viewing {
    position: relative;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Spinner */
.spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3b82f6;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0px rgba(239, 68, 68, 0.4); }
    100% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.calendar-container {
    transition: transform 0.5s ease-in-out;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    /* Reduce main container padding on mobile */
    .max-w-7xl.mx-auto {
        padding: 1rem; /* 16px */
    }

    /* Reduce main title size */
    #calendar-title {
        font-size: 1.875rem; /* 30px */
        line-height: 2.25rem;
    }
    
    /* Make month navigation more compact */
    #prev-month, #next-month {
        padding: 0.5rem 0.75rem; /* 8px 12px */
        font-size: 0.875rem; /* 14px */
    }
    #current-month {
        font-size: 1.25rem; /* 20px */
    }

    /* Reduce grid gap */
    .calendar-grid {
        gap: 4px;
    }

    /* Make calendar day cells smaller */
    .day-cell {
        min-height: auto; /* Let aspect ratio control height */
        padding: 4px;
        border-radius: 6px;
    }

    /* Reduce font size inside the cells */
    .day-cell span.text-lg {
        font-size: 0.875rem; /* 14px */
    }

    /* Reduce font size of day names (Ahad, Isnin, etc.) */
    .calendar-grid.mb-2 div {
        font-size: 0.65rem; /* 11px */
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    /* Make time slots stack in a single column on mobile */
    #time-slots-container {
        grid-template-columns: 1fr;
    }

    .day-cell.has-bookings::after {
        width: 4px;
        height: 4px;
        bottom: 4px;
    }
}
