/* modals.css */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: var(--space-lg);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    width: 100%;
    max-width: 650px;
    box-shadow: var(--shadow-xl);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: bounceIn 0.4s ease;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--primary), var(--secondary)) 1;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.close-btn {
    background: var(--bg-primary);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

#scheduleTableModal .modal-content {
    width: min(1200px, 100%) !important;
    max-width: calc(100vw - var(--space-lg) * 2) !important;
}

@media (max-width: 640px) {
    .modal {
        padding: calc(var(--space-md) + env(safe-area-inset-top)) var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom));
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        padding: var(--space-lg);
        border-radius: var(--radius-lg);
    }
}
