/* ========================================
   SYSTÈME DE NOTIFICATIONS KOALOO - STYLE iOS
   ======================================== */

/* Container principal des notifications iOS */
.notification-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1rem;
    /* Force le positionnement en haut sur mobile */
    top: env(safe-area-inset-top, 0);
}

/* Sur desktop (ordinateur), positionner en haut à gauche */
@media (min-width: 769px) {
    .notification-container {
        align-items: flex-start;
        right: auto;
        padding: 1rem;
        top: 1rem;
        left: 1rem;
    }
    
    .notification {
        max-width: 400px;
        width: auto;
    }
}

/* Styles de base des notifications iOS */
.notification {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 1rem 1.25rem;
    margin: 0.5rem 0;
    max-width: 400px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(20px);
    animation: notificationSlideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    /* Force le style iOS partout */
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    color: #1d1d1f;
}

/* Effet glassmorphism iOS */
.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    z-index: -1;
}

/* Icône de la notification */
.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contenu de la notification */
.notification-content {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-primary);
}

/* Bouton de fermeture */
.notification-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.notification-close:hover {
    background: var(--text-muted);
    color: white;
}

/* Types de notifications iOS */
.notification.success {
    background: rgba(52, 199, 89, 0.95);
    color: white;
}

.notification.success .notification-icon {
    color: white;
}

.notification.success::before {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.4), rgba(52, 199, 89, 0.1));
}

.notification.error {
    background: rgba(255, 59, 48, 0.95);
    color: white;
}

.notification.error .notification-icon {
    color: white;
}

.notification.error::before {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.4), rgba(255, 59, 48, 0.1));
}

.notification.info {
    background: rgba(0, 122, 255, 0.95);
    color: white;
}

.notification.info .notification-icon {
    color: white;
}

.notification.info::before {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.4), rgba(0, 122, 255, 0.1));
}

.notification.warning {
    background: rgba(255, 149, 0, 0.95);
    color: white;
}

.notification.warning .notification-icon {
    color: white;
}

.notification.warning::before {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.4), rgba(255, 149, 0, 0.1));
}

/* Mode sombre iOS */
[data-theme="dark"] .notification {
    background: rgba(28, 28, 30, 0.95);
    color: #ffffff;
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .notification::before {
    background: linear-gradient(135deg, rgba(28, 28, 30, 0.4), rgba(28, 28, 30, 0.1));
}

[data-theme="dark"] .notification.success {
    background: rgba(52, 199, 89, 0.95);
}

[data-theme="dark"] .notification.error {
    background: rgba(255, 59, 48, 0.95);
}

[data-theme="dark"] .notification.info {
    background: rgba(0, 122, 255, 0.95);
}

[data-theme="dark"] .notification.warning {
    background: rgba(255, 149, 0, 0.95);
}

/* Animations iOS */
@keyframes notificationSlideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes notificationSlideUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.notification.sliding-up {
    animation: notificationSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Notifications iOS style (alternative) */
.notification.ios-style {
    background: rgba(255, 255, 255, 0.4);
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}

.notification.ios-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.6);
    z-index: -1;
}

[data-theme="dark"] .notification.ios-style {
    background: rgba(28, 28, 30, 0.95);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive - Force le style iOS sur mobile */
@media (max-width: 768px) {
    .notification-container {
        padding: 0 0.75rem;
        /* Force le positionnement en haut sur mobile */
        top: 0;
        top: env(safe-area-inset-top, 0);
    }

    .notification {
        max-width: calc(100% - 1.5rem);
        padding: 0.875rem 1rem;
        /* Style iOS forcé sur mobile */
        border-radius: 12px;
        font-size: 0.875rem;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .notification-container {
        padding: 0 0.5rem;
        /* Force le positionnement en haut sur mobile */
        top: 0;
        top: env(safe-area-inset-top, 0);
    }

    .notification {
        max-width: calc(100% - 1rem);
        padding: 0.75rem 0.875rem;
        font-size: 0.875rem;
        /* Style iOS forcé sur mobile */
        border-radius: 10px;
        margin: 0.25rem 0;
    }

    .notification-icon {
        width: 18px;
        height: 18px;
    }

    .notification-close {
        width: 20px;
        height: 20px;
    }
}

/* Force le style iOS sur tous les appareils */
@media (max-width: 1024px) {
    .notification {
        /* Style iOS forcé partout */
        background: rgba(255, 255, 255, 0.95);
        border: none;
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        backdrop-filter: blur(20px);
        font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    }
}

/* Force le positionnement en haut sur TOUS les appareils */
.notification-container {
    top: 0 !important;
    top: env(safe-area-inset-top, 0) !important;
}

/* Force le style iOS partout */
.notification {
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    backdrop-filter: blur(20px) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif !important;
    color: #1d1d1f !important;
}

/* Support pour les préférences de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    .notification {
        animation: none;
    }

    .notification.sliding-up {
        animation: none;
    }
}