/**
 * Modern Toast Notification Styling
 * Slide-in van bovenaf met mooie container styling
 */

.admin-notification {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 90%;
    z-index: 10000 !important;
    padding: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
    background: transparent;
    border: none;
    animation: slideInFromTop 0.5s ease-out forwards;
    will-change: transform, opacity;
    /* Safe area support */
    --notification-top: calc(90px + env(safe-area-inset-top, 0px));
}

/* Modern container styling */
.admin-notification-container {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 60px;
    max-width: 600px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    border: none;
}

@media (max-width: 768px) {
    .admin-notification-container {
        max-width: 100%;
    }
}

/* Color bar aan de zijkant (links) - verborgen */
.notification-color-bar {
    display: none;
}

/* Content area */
.notification-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #ffffff;
}

/* Icon styling */
.notification-icon {
    font-size: 1.5em;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text content */
.notification-text {
    flex: 1;
    min-width: 0;
}

.notification-title {
    margin: 0 0 5px 0;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary, #000000);
}

.notification-message {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
    color: var(--text-secondary, #666666);
    word-wrap: break-word;
}

.notification-timestamp {
    margin-top: 8px;
    font-size: 0.85em;
    opacity: 0.8;
    color: var(--text-tertiary, #94a3b8);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Close button */
.notification-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.2em;
    cursor: pointer;
    padding: 8px 12px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Type-specific colors */
.admin-notification.alert-info {
    --notification-color-1: #3b82f6;
    --notification-color-2: #2563eb;
    --notification-icon-bg: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.admin-notification.alert-info .notification-content {
    border: 2px solid #3b82f6;
    border-radius: 16px;
}

.admin-notification.alert-warning {
    --notification-color-1: #f59e0b;
    --notification-color-2: #d97706;
    --notification-icon-bg: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.admin-notification.alert-warning .notification-content {
    border: 2px solid #f59e0b;
    border-radius: 16px;
}

.admin-notification.alert-error {
    --notification-color-1: #ef4444;
    --notification-color-2: #dc2626;
    --notification-icon-bg: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.admin-notification.alert-error .notification-content {
    border: 2px solid #ef4444;
    border-radius: 16px;
}

/* Animaties */
@keyframes slideInFromTop {
    0% {
        top: -200px;
        opacity: 0;
    }
    100% {
        top: var(--notification-top);
        opacity: 1;
    }
}

@keyframes slideOutToTop {
    0% {
        top: var(--notification-top);
        opacity: 1;
    }
    100% {
        top: -200px;
        opacity: 0;
    }
}

.admin-notification.dismissing {
    animation: slideOutToTop 0.4s ease-in forwards;
}

/* Progress bar voor auto-dismiss (optioneel) - UITGESCHAKELD */
.notification-progress {
    display: none;
}

/* PWA Update Toast - Bottom Style */
.pwa-update-toast {
    position: fixed;
    top: auto !important;
    bottom: -100px; /* Start off-screen */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 300px;
    max-width: 90%;
    z-index: 2147483000 !important;
    animation: slideInFromBottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    /* Safe area support for bottom */
    --notification-bottom: calc(20px + env(safe-area-inset-bottom, 20px));
}

.pwa-update-toast .notification-content {
    border-radius: 50px !important; /* Pil-vorm */
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.3) !important; /* Lichte blauwe rand */
    justify-content: center;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-update-toast .notification-title {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    color: #2563eb; /* Blauwe tekst kleur */
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-update-toast .notification-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #2563eb;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.pwa-update-toast .notification-message {
    display: none; /* Alleen titel tonen voor clean look */
}

/* Dark mode overrides voor PWA toast */
.dark-mode .pwa-update-toast .notification-content {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
    color: #fff;
}

.dark-mode .pwa-update-toast .notification-title {
    color: #60a5fa; /* Lichtere blauw voor dark mode */
}

.dark-mode .pwa-update-toast .notification-title::before {
    background-color: #60a5fa;
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7);
    animation: pulse-blue-dark 2s infinite;
}

@keyframes pulse-blue-dark {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(96, 165, 250, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);
    }
}

@keyframes slideInFromBottom {
    0% {
        bottom: -100px;
        opacity: 0;
    }
    100% {
        bottom: var(--notification-bottom);
        opacity: 1;
    }
}

@keyframes slideOutToBottom {
    0% {
        bottom: var(--notification-bottom);
        opacity: 1;
    }
    100% {
        bottom: -100px;
        opacity: 0;
    }
}

.pwa-update-toast.dismissing {
    animation: slideOutToBottom 0.4s ease-in forwards;
}


/* Dark mode support */
.dark-mode .admin-notification-container {
    background: transparent;
    border-color: transparent;
}

.dark-mode .notification-title {
    color: #ffffff;
}

.dark-mode .notification-message {
    color: #e0e0e0;
}

.dark-mode .notification-timestamp {
    color: #b0b0b0;
}

.dark-mode .notification-close {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.dark-mode .notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .admin-notification {
        width: 100%;
        max-width: none;
        /* Mobile heeft iets meer ruimte nodig */
        --notification-top: calc(95px + env(safe-area-inset-top, 0px));
        /* Zorg dat notificatie altijd zichtbaar is op mobiel */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        z-index: 99999 !important;
    }
    
    .pwa-update-toast {
        width: auto;
        max-width: 90%;
        position: fixed !important;
        bottom: -100px;
        /* Reset top/display overrides from admin-notification */
        top: auto !important;
    }
    
    @keyframes slideInFromTop {
        0% {
            top: -200px;
            opacity: 0;
        }
        100% {
            top: var(--notification-top);
            opacity: 1;
        }
    }
    
    @keyframes slideOutToTop {
        0% {
            top: var(--notification-top);
            opacity: 1;
        }
        100% {
            top: -200px;
            opacity: 0;
        }
    }
    
    .notification-content {
        padding: 15px 20px;
        gap: 15px;
    }
    
    .notification-icon {
        font-size: 1.5em;
    }
    
    .notification-title {
        font-size: 1em;
    }
    
    .notification-message {
        font-size: 0.95em;
    }
}

/* Extra ruimte voor PWA mode (standalone display) */
@media (display-mode: standalone) {
    .admin-notification {
        /* Zorg dat notificatie altijd zichtbaar is in PWA */
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        z-index: 99999 !important;
        --notification-top: calc(95px + env(safe-area-inset-top, 0px));
    }

    .pwa-update-toast {
        /* Specifieke override voor PWA toast om onderin te blijven */
        top: auto !important;
        bottom: -100px;
    }
    
    @keyframes slideInFromTop {
        0% {
            top: -200px;
            opacity: 0;
        }
        100% {
            top: var(--notification-top);
            opacity: 1;
        }
    }
    
    @keyframes slideOutToTop {
        0% {
            top: var(--notification-top);
            opacity: 1;
        }
        100% {
            top: -200px;
            opacity: 0;
        }
    }
}

/* Combinatie: mobiel EN PWA */
@media (max-width: 768px) and (display-mode: standalone) {
    .admin-notification {
        --notification-top: calc(95px + env(safe-area-inset-top, 0px));
    }
}

/* Smooth entrance voor users zonder motion preference */
@media (prefers-reduced-motion: reduce) {
    .admin-notification {
        animation: fadeIn 0.3s ease-out forwards;
    }
    
    .pwa-update-toast {
        animation: fadeInBottom 0.3s ease-out forwards;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
            top: var(--notification-top);
        }
    }

    @keyframes fadeInBottom {
        from {
            opacity: 0;
            bottom: -20px;
        }
        to {
            opacity: 1;
            bottom: var(--notification-bottom);
        }
    }
}
