/* ═══════════════════════════════════════════
   TrainControl — Modals
   ═══════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn var(--duration-fast) ease;
}

.modal-card {
    background: var(--bg-card-solid);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    width: min(420px, 90vw);
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp var(--duration-med) var(--ease-out);
}
.modal-card.modal-wide {
    width: min(520px, 90vw);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-lg) var(--gap-lg) var(--gap-sm);
}
.modal-header h2 {
    font-size: 1.1rem;
}

.btn-modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--duration-fast) ease;
}
.btn-modal-close:hover {
    background: rgba(0,0,0,0.1);
}

.modal-body {
    padding: var(--gap-md) var(--gap-lg);
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--gap-sm);
    padding: var(--gap-md) var(--gap-lg) var(--gap-lg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
