/* --------------------------------------------------------------------------
   GLOBAL TOAST NOTIFICATION STYLES
   -------------------------------------------------------------------------- */

/* Toast Container (Top Right Stack) */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 100%;
}

@media (max-width: 600px) {
    #toast-container {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 90%;
        max-width: 400px;
    }
}

/* Toast Element */
.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 16px;
    background: var(--clr-surface, #ffffff);
    color: var(--clr-text, #333333);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-left: 5px solid;
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    overflow: hidden;
}

@media (max-width: 600px) {
    .toast {
        transform: translateY(100%);
    }
}

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

@media (max-width: 600px) {
    .toast.toast-visible {
        transform: translateY(0);
    }
}

/* Icons */
.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

/* Content */
.toast-content {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin-right: 16px;
}

/* Close Button */
.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 0;
    margin-top: -2px;
}

.toast-close:hover {
    opacity: 1;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toast-progress linear forwards;
}

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

/* Types */
.toast-success {
    border-left-color: #10b981;
}
.toast-success .toast-icon {
    color: #10b981;
}

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

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

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

/* --------------------------------------------------------------------------
   CONFIRM DIALOG OVERLAY
   -------------------------------------------------------------------------- */
.toast-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.toast-confirm-dialog {
    background: var(--clr-surface, #ffffff);
    color: var(--clr-text, #333333);
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.toast-confirm-dialog.visible {
    transform: scale(1);
}

.toast-confirm-icon {
    color: #f59e0b;
    margin-bottom: 16px;
    text-align: center;
}

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

.toast-confirm-content {
    text-align: center;
    margin-bottom: 24px;
}

.toast-confirm-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.toast-confirm-message {
    font-size: 15px;
    color: var(--clr-text-muted, #666666);
    line-height: 1.5;
}

.toast-confirm-actions {
    display: flex;
    gap: 12px;
}

.toast-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s, color 0.2s;
}

.toast-btn-cancel {
    background: var(--clr-bg-alt, #f1f5f9);
    color: var(--clr-text, #333333);
}

.toast-btn-cancel:hover {
    background: #e2e8f0;
}

.toast-btn-confirm {
    background: #ef4444;
    color: #ffffff;
}

.toast-btn-confirm:hover {
    background: #dc2626;
}

/* Dark Mode Overrides (Assumes data-theme="dark" on html/body) */
[data-theme="dark"] .toast {
    background: var(--clr-surface, #1e293b);
    color: var(--clr-text, #f8fafc);
}

[data-theme="dark"] .toast-confirm-dialog {
    background: var(--clr-surface, #1e293b);
    color: var(--clr-text, #f8fafc);
}

[data-theme="dark"] .toast-btn-cancel {
    background: var(--clr-bg-alt, #334155);
    color: var(--clr-text, #f8fafc);
}

[data-theme="dark"] .toast-btn-cancel:hover {
    background: #475569;
}
