/* --- Notify.js Base Styles --- */
:root {
    --notify-z-index: 1050;
    --notify-spacing: 1rem;
    --notify-max-width: 380px;
    --notify-border-radius: 0.75rem;
    --notify-box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Colors */
    --notify-bg-success: rgba(16, 185, 129, 0.8);
    --notify-color-success: #fff;
    --notify-progress-success: #fff;

    --notify-bg-error: rgba(239, 68, 68, 0.8);
    --notify-color-error: #fff;
    --notify-progress-error: #fff;

    --notify-bg-warning: rgba(245, 158, 11, 0.8);
    --notify-color-warning: #fff;
    --notify-progress-warning: #fff;

    --notify-bg-info: rgba(59, 130, 246, 0.8);
    --notify-color-info: #fff;
    --notify-progress-info: #fff;

    --notify-bg-loading: rgba(107, 114, 128, 0.8);
    --notify-color-loading: #fff;
    --notify-progress-loading: #a78bfa;

    --notify-bg-default: rgba(55, 65, 81, 0.8);
    --notify-color-default: #fff;
    --notify-progress-default: #fff;
}

/* --- Dark Mode Support --- */
@media (prefers-color-scheme: dark) {
    :root {
        --notify-bg-success: rgba(22, 163, 74, 0.85);
        --notify-bg-error: rgba(220, 38, 38, 0.85);
        --notify-bg-warning: rgba(217, 119, 6, 0.85);
        --notify-bg-info: rgba(37, 99, 235, 0.85);
        --notify-bg-loading: rgba(75, 85, 99, 0.85);
        --notify-bg-default: rgba(31, 41, 55, 0.85);
    }
}

/* --- Container Positioning --- */
.notify-container {
    position: fixed;
    z-index: var(--notify-z-index);
    display: flex;
    flex-direction: column;
    gap: var(--notify-spacing);
    pointer-events: none;
    width: 100%;
    max-width: var(--notify-max-width);
}
.notify-container-top-right { top: var(--notify-spacing); right: var(--notify-spacing); align-items: flex-end; }
.notify-container-top-left { top: var(--notify-spacing); left: var(--notify-spacing); align-items: flex-start; }
.notify-container-top-center { top: var(--notify-spacing); left: 50%; transform: translateX(-50%); align-items: center; }
.notify-container-bottom-right { bottom: var(--notify-spacing); right: var(--notify-spacing); align-items: flex-end; }
.notify-container-bottom-left { bottom: var(--notify-spacing); left: var(--notify-spacing); align-items: flex-start; }
.notify-container-bottom-center { bottom: var(--notify-spacing); left: 50%; transform: translateX(-50%); align-items: center; }
.notify-container-center { top: 50%; left: 50%; transform: translate(-50%, -50%); align-items: center; }

/* --- Toast Base --- */
.notify-toast {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: var(--notify-max-width);
    border-radius: var(--notify-border-radius);
    box-shadow: var(--notify-box-shadow);
    padding: 1rem;
    pointer-events: all;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.notify-toast:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.2);
}

/* --- Toast Types --- */
.notify-toast.notify-success { background-color: var(--notify-bg-success); color: var(--notify-color-success); }
.notify-toast.notify-error { background-color: var(--notify-bg-error); color: var(--notify-color-error); }
.notify-toast.notify-warning { background-color: var(--notify-bg-warning); color: var(--notify-color-warning); }
.notify-toast.notify-info { background-color: var(--notify-bg-info); color: var(--notify-color-info); }
.notify-toast.notify-loading { background-color: var(--notify-bg-loading); color: var(--notify-color-loading); }
.notify-toast:not([class*="notify-"]) { background-color: var(--notify-bg-default); color: var(--notify-color-default); }

/* --- Toast Content --- */
.notify-icon { flex-shrink: 0; margin-right: 0.75rem; }
.notify-icon svg { width: 1.5rem; height: 1.5rem; }
.notify-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; margin-right: 0.75rem; object-fit: cover; border: 2px solid rgba(255,255,255,0.5); }
.notify-content { flex-grow: 1; }
.notify-message { font-size: 0.95rem; line-height: 1.5; word-break: break-word; }
.notify-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.notify-close:hover { opacity: 1; }

/* --- Actions --- */
.notify-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }
.notify-action-btn {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.notify-action-btn:hover { background: rgba(255, 255, 255, 0.3); }

/* --- Progress Bar --- */
.notify-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
}
.notify-progress-bar { height: 100%; width: 100%; }
.notify-success .notify-progress-bar { background-color: var(--notify-progress-success); }
.notify-error .notify-progress-bar { background-color: var(--notify-progress-error); }
.notify-warning .notify-progress-bar { background-color: var(--notify-progress-warning); }
.notify-info .notify-progress-bar { background-color: var(--notify-progress-info); }
.notify-loading .notify-progress-bar { background-color: var(--notify-progress-loading); }
.notify-toast:not([class*="notify-"]) .notify-progress-bar { background-color: var(--notify-progress-default); }

/* --- Animations --- */
.notify-toast {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.notify-toast.notify-show {
    opacity: 1;
    transform: scale(1);
}
.notify-toast.notify-hide {
    animation: notify-fade-out 0.4s ease-out forwards;
}
.notify-container[class*="-right"] .notify-toast { transform-origin: right center; }
.notify-container[class*="-left"] .notify-toast { transform-origin: left center; }
.notify-container[class*="-center"] .notify-toast { transform-origin: center center; }

.notify-container[class*="top-"] .notify-toast.notify-show { animation: notify-slide-in-down 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; }
.notify-container[class*="bottom-"] .notify-toast.notify-show { animation: notify-slide-in-up 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) forwards; }

.notify-toast.notify-error.notify-show { animation: notify-slide-in-down 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) forwards, notify-shake 0.5s 0.4s ease; }

.notify-spinner { animation: notify-spin 1s linear infinite; }

@keyframes notify-slide-in-down {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes notify-slide-in-up {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes notify-fade-out {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}
@keyframes notify-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}
@keyframes notify-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .notify-toast, .notify-toast:hover {
        transition: opacity 0.3s ease;
        animation: none !important;
        transform: none !important;
    }
    .notify-toast.notify-show { opacity: 1; }
    .notify-toast.notify-hide { opacity: 0; }
}

/* --- Responsive Design --- */
@media (max-width: 480px) {
    .notify-container {
        width: auto;
        left: var(--notify-spacing);
        right: var(--notify-spacing);
        max-width: none;
        transform: none !important;
        align-items: stretch !important;
    }
}