/* Container Reset */
.section .container {
    display: block !important;
}

/* Header & Control Bar */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 15px;
    flex-wrap: wrap;
}

#headerDate {
    display: block !important;
    width: auto;
    margin-left: 0;
    border-radius: 8px;
    font-size: 1.5rem;
    padding: 6px 20px !important;
}

/* Compact Calendar Card */
.calendar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px;
    width: 100%;
}

.day-label {
    text-align: center;
    font-weight: 800;
    font-size: 0.7rem;
    color: var(--brand-color);
    padding-bottom: 5px;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    transition: transform 0.1s, background 0.2s;
    font-size: 0.9rem;
    cursor: default;
}

/* Editor Specific Pointer */
body:has(.modal-overlay) .calendar-day {
    cursor: pointer;
}

.calendar-day:hover {
    border-color: var(--brand-light);
}

.calendar-day.available {
    background: #e2fbe8 !important;
    border-color: #2e8540 !important;
    color: #2e8540 !important;
    font-weight: 800;
}

.time-preview {
    font-size: 0.55rem;
    font-weight: normal;
    margin-top: 3px;
    font-family: monospace;
}

/* OneUI Bottom Sheet */
.modal-overlay {
    position: fixed;
    top: 0; /* Changed from bottom: -100% */
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0); /* Invisible background initially */
    backdrop-filter: blur(0px);
    display: flex;
    align-items: flex-end;
    z-index: 2000;
    
    /* The Magic Sauce */
    visibility: hidden;
    pointer-events: none;
    transition: background 0.3s, backdrop-filter 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    visibility: visible;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

.sheet {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 24px 24px 0 0;
    padding: 1.5rem 2rem 2.5rem 2rem;
    
    /* Animation for the sheet itself */
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .sheet {
    transform: translateY(0);
}

.handle {
    width: 35px;
    height: 5px;
    background: var(--border-color);
    border-radius: 10px;
    margin: -10px auto 1.5rem;
}

.slider-group { margin-bottom: 20px; }
.slider-group label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }

input[type=range] {
    width: 100%;
    accent-color: var(--brand-color);
}

.modal-actions { display: flex; gap: 10px; margin-top: 2rem; }
.btn-danger { background: #af2e3c !important; }
.btn-cancel { border: none; background: none; font-weight: 700; color: var(--text-muted); cursor: pointer; padding: 0 10px; }

@media (max-width: 600px) {
    .calendar-grid { gap: 4px; }
    .calendar-day { font-size: 0.8rem; }
    .modal-actions { flex-direction: column; }
}