/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-medium);
}

.modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-medium);
}

.modal-overlay.is-active .modal {
    transform: scale(1) translateY(0);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal__title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
}

.modal__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal__body {
    margin-bottom: 24px;
}

.modal__footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: var(--z-toast);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    animation: toast-in 0.3s ease;
    pointer-events: auto;
    max-width: 400px;
}

@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.is-leaving {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast__icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.toast__message {
    flex: 1;
    font-size: 0.95rem;
}

.toast__close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toast__close:hover {
    color: var(--text-primary);
}

/* Toast variants */
.toast--success {
    border-color: var(--accent-green);
}

.toast--success .toast__icon {
    color: var(--accent-green);
}

.toast--error {
    border-color: var(--accent-red);
}

.toast--error .toast__icon {
    color: var(--accent-red);
}

.toast--warning {
    border-color: var(--accent-orange);
}

.toast--warning .toast__icon {
    color: var(--accent-orange);
}

.toast--info {
    border-color: var(--accent-blue);
}

.toast--info .toast__icon {
    color: var(--accent-blue);
}

/* ============================================
   PHANTOM INDICATOR (soft, not blocking)
   ============================================ */

.phantom-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid var(--phantom-blue);
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-medium);
}

.phantom-indicator.is-visible {
    opacity: 1;
    visibility: visible;
}

.phantom-indicator__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-top-color: var(--phantom-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.phantom-indicator__text {
    color: var(--phantom-blue);
    font-weight: 600;
    font-size: 0.9rem;
}

.phantom-indicator__queue {
    padding: 4px 10px;
    background: rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--phantom-blue);
}

/* Mobile */
@media (max-width: 768px) {
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .toast {
        max-width: none;
    }
}
