/**
 * Toast notifications and dialog styles
 */

/* ============================================================================
   TOAST CONTAINER
   ============================================================================ */

.toast-container {
    position: fixed;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 32px);
}

.toast-container.toast-bottom-right {
    bottom: 20px;
    right: 20px;
}

.toast-container.toast-bottom-left {
    bottom: 20px;
    left: 20px;
}

.toast-container.toast-top-right {
    top: 20px;
    right: 20px;
}

.toast-container.toast-top-left {
    top: 20px;
    left: 20px;
}

/* ============================================================================
   TOAST ELEMENT
   ============================================================================ */

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-container.toast-bottom-left .toast,
.toast-container.toast-top-left .toast {
    transform: translateX(-100%);
}

.toast.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-hiding {
    transform: translateX(100%);
    opacity: 0;
}

.toast-container.toast-bottom-left .toast.toast-hiding,
.toast-container.toast-top-left .toast.toast-hiding {
    transform: translateX(-100%);
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

/* Toast Action Button */
.toast-action {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-color);
    background: transparent;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.toast-action:hover {
    background: var(--accent-color);
    color: white;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    margin: -4px -4px -4px 0;
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-color);
    animation: toast-progress linear forwards;
    width: 100%;
    transform-origin: left;
}

.toast-success .toast-progress {
    background: #10b981;
}

.toast-error .toast-progress {
    background: #ef4444;
}

.toast-warning .toast-progress {
    background: #f59e0b;
}

.toast-info .toast-progress {
    background: #3b82f6;
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ============================================================================
   CONFIRM DIALOG
   ============================================================================ */

.confirm-dialog-modal {
    max-width: 400px;
}

.confirm-dialog-message {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.confirm-dialog-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.confirm-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

.confirm-dialog-actions button {
    min-width: 80px;
}

/* ============================================================================
   PROMPT DIALOG
   ============================================================================ */

.prompt-dialog-modal {
    max-width: 400px;
}

.prompt-dialog-message {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.prompt-dialog-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-dialog-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.prompt-dialog-input.input-error {
    border-color: #ef4444;
}

.prompt-dialog-validation {
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
}

.prompt-dialog-validation.hidden {
    display: none;
}

.prompt-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

.prompt-dialog-actions button {
    min-width: 80px;
}

/* ============================================================================
   ALERT DIALOG
   ============================================================================ */

.alert-dialog-modal {
    max-width: 400px;
}

.alert-dialog-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-dialog-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.alert-dialog-info .alert-dialog-icon {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.alert-dialog-success .alert-dialog-icon {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.alert-dialog-warning .alert-dialog-icon {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.alert-dialog-error .alert-dialog-icon {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.alert-dialog-message {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.alert-dialog-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.alert-dialog-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

.alert-dialog-actions button {
    min-width: 100px;
}

/* ============================================================================
   MOBILE RESPONSIVE
   ============================================================================ */

@media (max-width: 480px) {
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
        width: auto;
    }

    .toast-container.toast-bottom-right,
    .toast-container.toast-bottom-left {
        left: 16px;
        right: 16px;
    }

    .toast {
        transform: translateY(100%);
    }

    .toast.toast-visible {
        transform: translateY(0);
    }

    .toast.toast-hiding {
        transform: translateY(100%);
    }

    .confirm-dialog-modal,
    .prompt-dialog-modal,
    .alert-dialog-modal {
        margin: 16px;
        max-width: calc(100% - 32px);
    }

    .confirm-dialog-actions,
    .prompt-dialog-actions {
        flex-direction: column-reverse;
    }

    .confirm-dialog-actions button,
    .prompt-dialog-actions button {
        width: 100%;
    }
}

/* ============================================================================
   DARK THEME ADJUSTMENTS
   ============================================================================ */

[data-theme="dark"] .toast {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .toast-progress {
    opacity: 0.8;
}

[data-theme="dark"] .alert-dialog-info .alert-dialog-icon {
    background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .alert-dialog-success .alert-dialog-icon {
    background: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .alert-dialog-warning .alert-dialog-icon {
    background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .alert-dialog-error .alert-dialog-icon {
    background: rgba(239, 68, 68, 0.2);
}
