/* ================================================
   SYSTÈME DE POPUPS
   ================================================ */

/* Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.active {
    display: block;
    opacity: 1;
}

/* Container Principal */
.popup-container {
    position: fixed;
    z-index: 9999;
    display: none;
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.popup-container.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

/* Positions */
.popup-container.position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
}

.popup-container.position-center.active {
    transform: translate(-50%, -50%) scale(1);
}

.popup-container.position-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
}

.popup-container.position-top.active {
    transform: translateX(-50%) translateY(0);
}

.popup-container.position-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
}

.popup-container.position-bottom.active {
    transform: translateX(-50%) translateY(0);
}

/* Tailles */
.popup-container.size-small {
    max-width: 400px;
    width: 90%;
}

.popup-container.size-medium {
    max-width: 600px;
    width: 90%;
}

.popup-container.size-large {
    max-width: 800px;
    width: 90%;
}

/* Popup Content */
.popup-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    animation: popupBounce 0.5s ease-out;
}

@keyframes popupBounce {
    0% {
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Bouton de fermeture */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* Image */
.popup-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

/* Body */
.popup-body {
    padding: 30px;
}

/* Title */
.popup-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

/* Content */
.popup-text {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
}

/* Button */
.popup-button {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Types de Popup */

/* Info */
.popup-content.type-info .popup-body {
    border-top: 5px solid #17a2b8;
}

.popup-content.type-info .popup-button {
    background: #17a2b8;
    color: #fff;
}

.popup-content.type-info .popup-button:hover {
    background: #138496;
}

/* Warning */
.popup-content.type-warning .popup-body {
    border-top: 5px solid #ffc107;
}

.popup-content.type-warning .popup-button {
    background: #ffc107;
    color: #000;
}

.popup-content.type-warning .popup-button:hover {
    background: #e0a800;
}

/* Success */
.popup-content.type-success .popup-body {
    border-top: 5px solid #28a745;
}

.popup-content.type-success .popup-button {
    background: #28a745;
    color: #fff;
}

.popup-content.type-success .popup-button:hover {
    background: #218838;
}

/* Promotion */
.popup-content.type-promotion .popup-body {
    border-top: 5px solid #9c27b0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.popup-content.type-promotion .popup-title {
    color: #fff;
}

.popup-content.type-promotion .popup-text {
    color: rgba(255, 255, 255, 0.9);
}

.popup-content.type-promotion .popup-button {
    background: #fff;
    color: #667eea;
}

.popup-content.type-promotion .popup-button:hover {
    background: #f0f0f0;
}

/* Announcement */
.popup-content.type-announcement .popup-body {
    border-top: 5px solid #007bff;
}

.popup-content.type-announcement .popup-button {
    background: #007bff;
    color: #fff;
}

.popup-content.type-announcement .popup-button:hover {
    background: #0056b3;
}

/* Responsive */
@media (max-width: 768px) {
    .popup-container {
        width: 95% !important;
        max-width: none !important;
    }

    .popup-container.position-top {
        top: 10px;
    }

    .popup-container.position-bottom {
        bottom: 10px;
    }

    .popup-body {
        padding: 20px;
    }

    .popup-title {
        font-size: 20px;
    }

    .popup-text {
        font-size: 14px;
    }

    .popup-image {
        max-height: 200px;
    }
}

/* Animation d'entrée pour l'overlay */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-overlay.active {
    animation: fadeIn 0.3s ease;
}

/* Effet de pulse pour attirer l'attention */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(23, 162, 184, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
    }
}

.popup-button.pulse {
    animation: pulse 2s infinite;
}

/* Performance */
.popup-container,
.popup-overlay {
    will-change: opacity, transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
