/**
 * Toast Notification Styles
 * Apple-style toast notification component with backdrop blur
 */

:root {
    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --border: rgba(0, 0, 0, 0.1);
    --text: #1c1c1e;
    --text-sec: #6e6e73;
}

[data-theme="dark"],
[data-bs-theme="dark"] {
    --border: rgba(255, 255, 255, 0.15);
    --text: #f5f5f7;
    --text-sec: #a1a1a6;
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apple-toast {
    min-width: 300px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
    transition: all 0.5s var(--spring-bounce);
    color: var(--text);
    pointer-events: none;
}

.apple-toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Dark mode toast styling */
[data-theme="dark"] .apple-toast,
[data-bs-theme="dark"] .apple-toast {
    background: rgba(28, 28, 30, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    color: var(--text);
}

.toast-message {
    font-size: 13px;
    color: var(--text-sec);
    display: block;
}

/* Toast type colors */
.apple-toast.success .toast-icon {
    background-color: #34c759;
}

.apple-toast.error .toast-icon {
    background-color: #ff3b30;
}

.apple-toast.warning .toast-icon {
    background-color: #ff9500;
}

.apple-toast.info .toast-icon {
    background-color: #0071e3;
}

.apple-toast.loading .toast-icon {
    background-color: #0071e3;
}

.toast-spinner {
    animation: toast-spin 0.8s linear infinite;
}

@keyframes toast-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile toast adjustments */
@media (max-width: 480px) {
    #toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .apple-toast {
        min-width: auto;
        width: 100%;
    }
}

/* Confirm dialog */
.nanhkiet-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nanhkiet-confirm-overlay.nanhkiet-confirm-show {
    opacity: 1;
    visibility: visible;
}

.nanhkiet-confirm-box {
    min-width: 320px;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: scale(0.9);
    transition: transform 0.3s var(--spring-bounce);
    color: var(--text);
}

.nanhkiet-confirm-overlay.nanhkiet-confirm-show .nanhkiet-confirm-box {
    transform: scale(1);
}

[data-theme="dark"] .nanhkiet-confirm-box,
[data-bs-theme="dark"] .nanhkiet-confirm-box {
    background: rgba(28, 28, 30, 0.98);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.nanhkiet-confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.nanhkiet-confirm-icon svg {
    width: 24px;
    height: 24px;
}

.nanhkiet-confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.nanhkiet-confirm-message {
    font-size: 14px;
    color: var(--text-sec);
    line-height: 1.5;
}

.nanhkiet-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

.nanhkiet-confirm-btn {
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.nanhkiet-confirm-btn:hover {
    opacity: 0.9;
}

.nanhkiet-confirm-btn:active {
    transform: scale(0.98);
}

.nanhkiet-confirm-btn--secondary {
    background: #e2e3e5;
    color: #41464b;
}

.nanhkiet-confirm-btn--primary {
    background: #0d6efd;
    color: #fff;
}

.nanhkiet-confirm-btn--danger {
    background: #dc3545;
    color: #fff;
}