/* ============================================
   FIDES TOAST NOTIFICATION SYSTEM
   Professional notification component
   ============================================ */

/* Toast Container - Fixed position */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

/* Individual Toast */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: var(--border-radius, 12px);
    box-shadow: 0 10px 40px rgba(26, 39, 68, 0.15),
                0 4px 12px rgba(26, 39, 68, 0.08);
    border-left: 4px solid var(--fides-accent, #5170ff);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

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

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

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

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

.toast-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1a2744);
    margin-bottom: 4px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary, #495057);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted, #6c757d);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
    margin-top: -4px;
    margin-right: -8px;
}

.toast-close:hover {
    background: var(--gray-100, #f4f6f8);
    color: var(--text-primary, #1a2744);
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--fides-accent, #5170ff);
    border-radius: 0 0 0 var(--border-radius, 12px);
    animation: toast-progress linear forwards;
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ========== TOAST VARIANTS ========== */

/* Success Toast */
.toast-success {
    border-left-color: var(--fides-success, #22c55e);
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.toast-success .toast-progress {
    background: var(--fides-success, #22c55e);
}

/* Error Toast */
.toast-error {
    border-left-color: var(--fides-danger, #dc3545);
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.toast-error .toast-progress {
    background: var(--fides-danger, #dc3545);
}

/* Warning Toast */
.toast-warning {
    border-left-color: #f59e0b;
}

.toast-warning .toast-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

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

/* Info Toast */
.toast-info {
    border-left-color: var(--fides-accent, #5170ff);
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.toast-info .toast-progress {
    background: var(--fides-accent, #5170ff);
}

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

.toast-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 41, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.toast-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(26, 39, 68, 0.25);
    max-width: 420px;
    width: 90%;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.toast-modal-overlay.show .toast-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.toast-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 0 24px;
}

.toast-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.toast-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #1a2744);
    line-height: 1.3;
}

.toast-modal-body {
    padding: 16px 24px 24px 24px;
}

.toast-modal-message {
    font-size: 14px;
    color: var(--text-secondary, #495057);
    line-height: 1.6;
    margin-left: 72px;
}

.toast-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--gray-50, #fafbfc);
    border-top: 1px solid var(--gray-200, #e9ecef);
}

.toast-modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.toast-modal-btn-secondary {
    background: #ffffff;
    color: var(--text-secondary, #495057);
    border: 1px solid var(--gray-300, #dee2e6);
}

.toast-modal-btn-secondary:hover {
    background: var(--gray-100, #f4f6f8);
    border-color: var(--gray-400, #adb5bd);
}

.toast-modal-btn-primary {
    background: var(--fides-accent, #5170ff);
    color: #ffffff;
}

.toast-modal-btn-primary:hover {
    background: var(--fides-accent-light, #7690ff);
    transform: translateY(-1px);
}

.toast-modal-btn-danger {
    background: var(--fides-danger, #dc3545);
    color: #ffffff;
}

.toast-modal-btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Modal Variants */
.toast-modal-success .toast-modal-icon {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.toast-modal-error .toast-modal-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.toast-modal-warning .toast-modal-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.toast-modal-info .toast-modal-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

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

@media (max-width: 480px) {
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .toast {
        padding: 14px 16px;
    }

    .toast-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .toast-title {
        font-size: 14px;
    }

    .toast-message {
        font-size: 12px;
    }

    .toast-modal {
        width: 95%;
        margin: 16px;
    }

    .toast-modal-message {
        margin-left: 0;
        margin-top: 8px;
    }
}
