/* ============================================
   SYSTÈME DE NOTIFICATIONS - TOASTS & MODALS
   ============================================ */

/* Container pour les toasts */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(500px, 90vw);
    width: 100%;
}

/* Toast individuel */
.toast {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    pointer-events: all;
    min-height: 70px;
    border-left: 5px solid #4CAF50;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Types de toasts */
.toast-success {
    border-left-color: #4CAF50;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
}

.toast-error {
    border-left-color: #f44336;
    background: linear-gradient(135deg, #fff0f0 0%, #ffe0e0 100%);
    border-left-width: 6px;
    box-shadow: 0 12px 48px rgba(244, 67, 54, 0.3);
}

.toast-info {
    border-left-color: #2196F3;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.toast-warning {
    border-left-color: #FF9800;
    background: linear-gradient(135deg, #ffffff 0%, #fff8f0 100%);
}

.toast-achievement {
    border-left-color: #9C27B0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f0ff 100%);
}

.toast-reward {
    border-left-color: #FF4081;
    background: linear-gradient(135deg, #ffffff 0%, #fff0f8 100%);
}

/* Icône du toast */
.toast-icon {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
}

/* Message du toast */
.toast-message {
    flex: 1;
    font-size: 18px;
    line-height: 1.5;
    color: #333;
    font-weight: 600;
}

/* Bouton fermer du toast */
.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* Animations des toasts */
.toast-enter {
    transform: translateY(-100px);
    opacity: 0;
}

.toast-active {
    transform: translateY(0);
    opacity: 1;
}

.toast-exit {
    transform: translateY(-50px);
    opacity: 0;
}

/* ============================================
   MODALS
   ============================================ */

/* Container pour les modals - pointer-events: none allows clicks to pass through when empty */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000; /* Increased from 9999 to be above confetti canvas */
    pointer-events: none; /* Allows background clicks when no modal is active */
}

/* Overlay du modal */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: all;
    z-index: 10001;
    padding: 20px;
}

.notification-modal.modal-active {
    opacity: 1;
}

.notification-modal.modal-exit {
    opacity: 0;
}

/* Contenu du modal */
.notification-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-active .notification-modal-content {
    transform: scale(1);
}

.modal-exit .notification-modal-content {
    transform: scale(0.8);
}

/* Header du modal */
.modal-header {
    text-align: center;
    padding: 30px 30px 20px;
    position: relative;
}

.modal-icon {
    font-size: 80px;
    line-height: 1;
    margin-bottom: 15px;
    animation: celebrationPop 0.6s ease-out;
}

.celebration-icon {
    animation: celebrationPop 0.6s ease-out, pulse 2s infinite;
}

.achievement-icon {
    animation: celebrationPop 0.6s ease-out, bounce 1s infinite;
}

.modal-header h2 {
    font-size: 28px;
    color: #333;
    margin: 0;
    font-weight: 700;
}

/* Body du modal */
.modal-body {
    padding: 20px 30px 30px;
    text-align: center;
}

.reward-icon {
    font-size: 100px;
    line-height: 1;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.modal-body h3 {
    font-size: 24px;
    color: #333;
    margin: 0 0 15px;
    font-weight: 600;
}

.modal-body p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px;
}

/* Badge de points */
.points-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.bonus-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.points-badge .emoji {
    font-size: 22px;
}

/* Footer du modal */
.modal-footer {
    padding: 0 30px 30px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-footer .btn {
    min-width: 120px;
}

/* Bouton fermer du modal */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg);
}

/* Styles spécifiques aux modals de récompense */
.reward-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.reward-modal .modal-header h2,
.reward-modal .modal-body h3,
.reward-modal .modal-body p {
    color: white;
}

.reward-modal .modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.reward-modal .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Styles spécifiques aux modals d'achievement */
.achievement-modal {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.achievement-modal .modal-header h2,
.achievement-modal .modal-body h3,
.achievement-modal .modal-body p {
    color: white;
}

.achievement-modal .modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.achievement-modal .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Boutons */
.btn {
    padding: 12px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modal de confirmation */
.confirm-modal {
    background: white;
}

.confirm-modal .modal-header h2,
.confirm-modal .modal-body p {
    color: #333;
}

.confirm-modal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.confirm-modal .btn-secondary {
    background: #e0e0e0;
    color: #666;
}

/* Responsive */
@media (max-width: 600px) {
    .toast-container {
        width: 95%;
        top: 20px;
        transform: translateX(-50%);
        left: 50%;
    }

    .toast {
        padding: 12px 16px;
        min-height: 50px;
    }

    .toast-icon {
        font-size: 24px;
    }

    .toast-message {
        font-size: 14px;
    }

    .notification-modal-content {
        max-width: 95%;
    }

    .modal-header {
        padding: 20px 20px 15px;
    }

    .modal-icon {
        font-size: 60px;
    }

    .modal-header h2 {
        font-size: 22px;
    }

    .modal-body {
        padding: 15px 20px 20px;
    }

    .reward-icon {
        font-size: 70px;
    }

    .modal-body h3 {
        font-size: 20px;
    }

    .modal-body p {
        font-size: 14px;
    }

    .points-badge {
        font-size: 16px;
        padding: 10px 20px;
    }

    .modal-footer {
        padding: 0 20px 20px;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes celebrationPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
