/* ===== SYSTÈME DE POP-UPS PROFESSIONNEL ===== */

/* Conteneur principal */
.popup-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
    width: 100%;
}

/* Pop-up individuelle */
.popup {
    position: relative;
    background: rgba(0, 0, 17, 0.95);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transform: translateX(120%) !important;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
}

.popup-visible {
    transform: translateX(0) !important;
    opacity: 1;
}

.popup-hiding {
    transform: translateX(120%) !important;
    opacity: 0;
}

/* Contenu de la pop-up */
.popup-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    position: relative;
    z-index: 2;
}

/* Icône */
.popup-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    padding: 0;
    box-sizing: border-box;
}

.popup-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Corps de la pop-up */
.popup-body {
    flex: 1;
    min-width: 0;
}

.popup-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.popup-message {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    /* ✅ JAMAIS couper les mots - règles strictes */
    word-break: normal; /* Ne pas couper les mots */
    overflow-wrap: break-word; /* Couper seulement les très longs mots sans espaces */
    hyphens: none; /* Désactiver les césures automatiques */
    -webkit-hyphens: none;
    -moz-hyphens: none;
    white-space: normal; /* Permettre les retours à la ligne naturels */
    text-wrap: pretty; /* Améliorer les retours à la ligne */
}

/* ✅ Règles supplémentaires pour éviter la coupure des mots */
.popup-message {
    /* Utiliser une largeur minimale pour forcer les retours à la ligne intelligents */
    min-width: 0;
    max-width: 100%;
    /* S'assurer que les mots ne sont jamais coupés */
    word-spacing: normal;
    letter-spacing: normal;
}

/* Bouton de fermeture */
.popup-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: -2px;
}

.popup-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Barre de progression (pour durée d'affichage) */
.popup-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 255, 136, 0.3);
    width: 100%;
    transform-origin: left;
    animation: popupProgress linear forwards;
}

/* Pause de la barre de progression au survol */
.popup:hover .popup-progress {
    animation-play-state: paused;
}

@keyframes popupProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Types de pop-ups */
.popup-success {
    border-color: rgba(0, 255, 136, 0.4);
    background: linear-gradient(135deg, rgba(0, 0, 17, 0.98) 0%, rgba(0, 20, 40, 0.95) 100%);
}

.popup-success .popup-icon {
    /* Le conteneur n'a pas d'animation, juste positionnement */
}

.popup-success .popup-icon svg {
    width: 100%;
    height: 100%;
    transform-origin: center center;
}

.popup-success .popup-icon img {
    transform-origin: center center;
}

/* ===== ANIMATIONS SUCCESS (centralisées - s'appliquent partout) ===== */

/* Animation de rotation continue du cercle - beaucoup plus lent */
/* S'applique à tous les SVG de succès (popups de droite ET centrales) */
svg #check-circle,
svg #discord-check-circle {
    transform-origin: 50px 50px;
    animation: successCircleRotate 8s linear infinite;
}

/* Animation d'écriture du V avec stroke-dasharray (simule l'écriture) */
/* S'applique à tous les SVG de succès (popups de droite ET centrales) */
svg #check-mark-stroke,
svg #discord-check-mark-stroke {
    stroke: #ffffff;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

svg #check-mark,
svg #discord-check-mark {
    fill: #ffffff;
}

/* Keyframes centralisés - utilisés par toutes les popups de succès */
@keyframes successCircleRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Animation d'écriture du V : commence en haut de la branche gauche, descend, puis remonte pour la branche droite */
@keyframes successCheckWrite {
    0% {
        stroke-dashoffset: 100;
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

/* Animation pour remplir le V après l'écriture */
@keyframes successCheckFill {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.popup-success .popup-progress {
    background: linear-gradient(90deg, #00ff88, #00ccff);
}

.popup-error {
    border-color: rgba(255, 71, 87, 0.4);
    background: linear-gradient(135deg, rgba(0, 0, 17, 0.98) 0%, rgba(20, 0, 0, 0.95) 100%);
}

.popup-error .popup-icon {
    /* Rond supprimé - logo SVG uniquement */
}

.popup-error .popup-progress {
    background: linear-gradient(90deg, #ff4757, #ff6b7a);
}

.popup-info {
    border-color: rgba(0, 200, 255, 0.4);
    background: linear-gradient(135deg, rgba(0, 0, 17, 0.98) 0%, rgba(0, 10, 30, 0.95) 100%);
}

.popup-info .popup-icon {
    /* Rond supprimé - logo SVG uniquement */
}

.popup-info .popup-progress {
    background: linear-gradient(90deg, #00c8ff, #0099cc);
}

.popup-warning {
    border-color: rgba(255, 193, 7, 0.4);
    background: linear-gradient(135deg, rgba(0, 0, 17, 0.98) 0%, rgba(30, 20, 0, 0.95) 100%);
}

.popup-warning .popup-icon {
    /* Rond supprimé - logo SVG uniquement */
}

.popup-warning .popup-progress {
    background: linear-gradient(90deg, #ffc107, #ff9800);
}

/* Responsive */
@media (max-width: 768px) {
    .popup-container {
        top: 80px; /* Au-dessus du header mobile (60px) + marge */
        right: 16px;
        left: auto; /* Ne pas prendre toute la largeur */
        max-width: calc(100% - 32px); /* Largeur max avec marges */
        width: auto;
        z-index: 10001; /* Au-dessus du header mobile (z-index: 1000) */
    }

    .popup {
        min-width: 280px;
        max-width: 350px; /* Largeur max raisonnable sur mobile */
        width: auto;
    }

    .popup-content {
        padding: 0.9rem 1rem;
    }

    .popup-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .popup-message {
        font-size: 0.9rem;
        /* ✅ Même règles sur mobile : jamais couper les mots */
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: none;
        -webkit-hyphens: none;
        -moz-hyphens: none;
    }
}

/* Ajustements pour très petits écrans */
@media (max-width: 480px) {
    .popup-container {
        top: 70px; /* Réduire un peu pour petits écrans */
        right: 12px;
        left: auto;
        max-width: calc(100% - 24px);
    }

    .popup {
        min-width: 260px;
        max-width: 320px; /* Encore plus étroit sur petits écrans */
    }

    .popup-content {
        padding: 0.8rem 0.9rem;
    }

    .popup-icon {
        width: 24px;
        height: 24px;
    }

    .popup-message {
        font-size: 0.85rem;
        /* ✅ Même règles sur petits écrans : jamais couper les mots */
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: none;
        -webkit-hyphens: none;
        -moz-hyphens: none;
    }
}

/* Animation d'entrée personnalisée */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Support pour les pop-ups empilées */
.popup-container .popup:nth-child(1) {
    z-index: 10005;
}

.popup-container .popup:nth-child(2) {
    z-index: 10004;
}

.popup-container .popup:nth-child(3) {
    z-index: 10003;
}

.popup-container .popup:nth-child(4) {
    z-index: 10002;
}

.popup-container .popup:nth-child(5) {
    z-index: 10001;
}

/* ===== POP-UP DE CONFIRMATION ===== */
.popup-confirm {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    min-width: 400px !important;
    max-width: 500px !important;
    width: 90% !important;
    z-index: 10001 !important;
}

.popup-confirm .popup-progress {
    background: linear-gradient(90deg, #ffc107, #ff9800);
}

.popup-confirm.popup-visible {
    transform: translate(-50%, -50%) !important;
}

.popup-confirm.popup-hiding {
    transform: translate(-50%, -50%) scale(0.9) !important;
    opacity: 0 !important;
}

/* Actions de la pop-up de confirmation */
.popup-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0 1.25rem 1rem 1.25rem;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.popup-btn {
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 100px;
}

.popup-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.popup-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.popup-btn-confirm {
    background: linear-gradient(135deg, #ff4757, #ff6b6b);
    color: #ffffff;
    border: 1px solid rgba(255, 71, 87, 0.4);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.popup-btn-confirm:hover {
    background: linear-gradient(135deg, #ff6b6b, #ff8a95);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 71, 87, 0.4);
}

.popup-btn:active {
    transform: translateY(0);
}

/* Responsive pour les pop-ups de confirmation */
@media (max-width: 768px) {
    .popup-confirm {
        min-width: auto !important;
        max-width: 90% !important;
        width: 90% !important;
    }
    
    .popup-actions {
        flex-direction: column-reverse;
    }
    
    .popup-btn {
        width: 100%;
    }
}



