/**
 * Styles CSS pour le module Popup Configurable
 * Fichier : views/css/popup.css
 */

/* Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Container principal */
.popup-container {
    position: relative;
    border: 2px solid;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.popup-container.popup-show {
    transform: scale(1);
}

/* Positionnement */
.popup-center {
    margin: auto;
}

.popup-top {
    align-self: flex-start;
    margin-top: 50px;
}

.popup-bottom {
    align-self: flex-end;
    margin-bottom: 50px;
}

.popup-left {
    margin-right: auto;
    margin-left: 50px;
}

.popup-right {
    margin-left: auto;
    margin-right: 50px;
}

/* Bouton de fermeture */
.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    z-index: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.popup-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.popup-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Contenu */
.popup-content {
    padding: 20px;
    word-wrap: break-word;
}

.popup-header {
    margin-bottom: 15px;
    padding-right: 40px; /* Espace pour le bouton de fermeture */
}

.popup-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}

.popup-body {
    line-height: 1.6;
}

.popup-body p {
    margin-bottom: 15px;
}

.popup-body img {
    max-width: 100%;
    height: auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Classes d'animation */
.popup-fadeIn .popup-container {
    animation: fadeIn 0.5s ease-out;
}

.popup-slideIn .popup-container {
    animation: slideIn 0.5s ease-out;
}

.popup-zoomIn .popup-container {
    animation: zoomIn 0.5s ease-out;
}

.popup-bounceIn .popup-container {
    animation: bounceIn 0.6s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .popup-container {
        width: 95% !important;
        max-width: 95%;
        margin: 10px;
        max-height: 80vh;
    }
    
    .popup-content {
        padding: 15px;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .popup-header {
        padding-right: 35px;
    }
    
    .popup-left,
    .popup-right {
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .popup-top {
        margin-top: 20px;
    }
    
    .popup-bottom {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .popup-container {
        width: 98% !important;
        margin: 5px;
        max-height: 85vh;
    }
    
    .popup-content {
        padding: 12px;
    }
    
    .popup-title {
        font-size: 18px;
    }
    
    .popup-close {
        font-size: 24px;
        width: 26px;
        height: 26px;
        top: 8px;
        right: 12px;
    }
}

/* Styles pour les boutons dans le contenu */
.popup-body .btn,
.popup-body button {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px 5px 0 0;
    border: none;
    border-radius: 4px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.popup-body .btn:hover,
.popup-body button:hover {
    background-color: #0056b3;
}

.popup-body .btn-secondary {
    background-color: #6c757d;
}

.popup-body .btn-secondary:hover {
    background-color: #545b62;
}

/* Animation de fermeture */
.popup-overlay.popup-closing {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Préchargement des animations */
.popup-overlay * {
    box-sizing: border-box;
}

/* Accessibilité */
.popup-overlay:focus-within .popup-container {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Support pour les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .popup-container,
    .popup-close,
    .popup-overlay {
        animation: none !important;
        transition: none !important;
    }
}