/* ============================================================
   modal.css — Modal, toast, context menu, inline edit styles
   ============================================================ */

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal-backdrop);
    animation: fadeInBackdrop 0.2s ease;
}

@keyframes fadeInBackdrop {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    min-width: 400px;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: var(--z-modal);
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translate(-50%, -48%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.modal.modal-wide {
    max-width: 680px;
    width: 90vw;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

.modal-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: 18px;
    transition: all var(--transition-fast);
}
.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: var(--space-6);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--text-sm);
    color: var(--text-primary);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
    max-width: 360px;
}

.toast.removing {
    animation: toastSlideOut 0.2s ease forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(24px); }
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent-success); }
.toast.error .toast-icon   { color: var(--accent-danger); }
.toast.warning .toast-icon { color: var(--accent-warning); }
.toast.info .toast-icon    { color: var(--accent-info); }

/* ── Context Menu ────────────────────────────────────────── */
.context-menu {
    position: fixed;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-1);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    min-width: 180px;
    animation: fadeIn 0.1s ease;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.context-menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.context-menu-item.danger {
    color: var(--accent-danger);
}
.context-menu-item.danger:hover {
    background: var(--accent-danger-bg);
}

.context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-1) var(--space-2);
}

.context-menu-label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    padding: var(--space-2) var(--space-3) var(--space-1);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Inline Edit ─────────────────────────────────────────── */
.inline-edit-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    color: var(--text-primary);
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    box-shadow: 0 0 0 3px var(--accent-primary-bg);
    outline: none;
    width: auto;
    min-width: 120px;
}
