:root {
    /* Error Theme */
    --error-main: #dc2626;
    --error-bg: #fef2f2;
    --error-text: #7f1d1d;
    
    /* Success Theme */
    --success-main: #16a34a;
    --success-bg: #f0fdf4;
    --success-text: #14532d;
    
    /* Warning Theme */
    --warning-main: #d97706;
    --warning-bg: #fffbeb;
    --warning-text: #78350f;

    /* Info Theme */
    --info-main: #2563eb;
    --info-bg: #eff6ff;
    --info-text: #1e3a8a;

    --gray-50: #f9fafb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #f3f4f6;
    font-family: -apple-system, system-ui, sans-serif;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    min-height: 100vh;
}

/* --- Modal Backdrop & Positioning --- */
.notification-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 1000;
    padding: 1rem;
    pointer-events: none;
}

.notification-backdrop.active { display: flex; }

/* Positioning Classes */
.pos-center { align-items: center; justify-content: center; background-color: rgba(0,0,0,0.4); pointer-events: auto; }
.pos-top-right { align-items: flex-start; justify-content: flex-end; }
.pos-bottom-right { align-items: flex-end; justify-content: flex-end; }

/* --- Modal Container --- */
.notif-container {
    background-color: white;
    width: 95%; /* Responsive default */
    max-width: 450px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
}

/* Draggable state styling */
.notif-container.ui-draggable-dragging {
    transition: none;
    opacity: 0.9;
}

.active .notif-container {
    opacity: 1;
    transform: translateY(0);
}

/* --- Theme Styling --- */
.notif-header { 
    padding: 1rem 1.25rem; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: move; /* Indicate draggability */
}
.header-content { display: flex; align-items: center; gap: 0.75rem; pointer-events: none; }
.notif-title { font-weight: 700; font-size: 1rem; }

.icon-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; }

/* Types */
.type-error .icon-circle { background-color: var(--error-main); }
.type-error .notif-header { background-color: var(--error-bg); }
.type-error .notif-title { color: var(--error-text); }

.type-success .icon-circle { background-color: var(--success-main); }
.type-success .notif-header { background-color: var(--success-bg); }
.type-success .notif-title { color: var(--success-text); }

.type-warning .icon-circle { background-color: var(--warning-main); }
.type-warning .notif-header { background-color: var(--warning-bg); }
.type-warning .notif-title { color: var(--warning-text); }

/* Body & List */
.notif-body { padding: 1.25rem; }
.notif-message { color: var(--gray-600); font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.4; }

.notif-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 200px; overflow-y: auto; }
.list-item { 
    padding: 0.6rem; 
    border-radius: 6px; 
    font-size: 0.85rem; 
    display: flex; 
    gap: 0.5rem;
    border-left: 3px solid transparent;
}

.type-error .list-item { background: var(--error-bg); border-left-color: var(--error-main); color: var(--error-text); }
.type-success .list-item { background: var(--success-bg); border-left-color: var(--success-main); color: var(--success-text); }
.type-warning .list-item { background: var(--warning-bg); border-left-color: var(--warning-main); color: var(--warning-text); }

.field-label { font-weight: 700; }

.notif-footer { padding: 1rem; background: var(--gray-50); display: flex; gap: 0.5rem; }
.btn-notif { 
    flex: 1; 
    padding: 0.75rem; 
    border-radius: 6px; 
    border: 1px solid var(--gray-300); 
    background: white; 
    font-weight: 600; 
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.btn-notif:hover { background: var(--gray-50); }
.btn-notif.primary { background: var(--gray-900); color: white; border: none; }
.btn-notif.primary:hover { background: #000; }

.close-x { background: none; border: none; cursor: pointer; color: var(--gray-400); font-size: 1.2rem; padding: 4px; pointer-events: auto; }

/* Auto-dismiss timer bar */
.timer-bar {
    height: 3px;
    background: rgba(0,0,0,0.1);
    width: 0%;
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .notif-container {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        top: auto !important;
        right: 0 !important;
        width: 100% !important;
        transform: translateY(100%);
    }
    .active .notif-container { transform: translateY(0); }
    .notification-backdrop { padding: 0; }
    .pos-top-right, .pos-bottom-right { align-items: flex-end; }
}