/**
 * Bquery Premium Popup - Styles Frontend
 * 
 * Styles premium pour le popup promotionnel
 * Design responsive et animations fluides
 * 
 * @package Bquery_Premium_Popup
 * @version 1.0.0
 */

/* ==========================================
   Reset et base
   ========================================== */
.jpp-overlay,
.jpp-overlay * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==========================================
   Overlay
   ========================================== */
.jpp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.jpp-overlay.jpp-visible {
    opacity: 1;
    visibility: visible;
}

/* Classe utilitaire pour cacher */
.jpp-hidden {
    display: none !important;
}

/* ==========================================
   Popup Container
   ========================================== */
.jpp-popup {
    position: relative;
    width: 100%;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
}

.jpp-popup-inner {
    padding: 40px;
}

/* ==========================================
   Bouton de fermeture
   ========================================== */
.jpp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

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

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

.jpp-close svg {
    width: 20px;
    height: 20px;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.jpp-close:hover svg {
    opacity: 1;
}

/* ==========================================
   Contenu texte
   ========================================== */
.jpp-popup-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.jpp-popup-content {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.jpp-popup-content p {
    margin-bottom: 12px;
}

.jpp-popup-content p:last-child {
    margin-bottom: 0;
}

.jpp-popup-content a {
    color: inherit;
    text-decoration: underline;
}

.jpp-popup-content ul,
.jpp-popup-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.jpp-popup-content li {
    margin-bottom: 8px;
}

/* ==========================================
   Contenu image
   ========================================== */
.jpp-popup-image-wrapper {
    margin: -40px -40px 24px -40px;
    overflow: hidden;
}

.jpp-popup-image-wrapper a {
    display: block;
}

.jpp-popup-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.jpp-popup-image-wrapper a:hover .jpp-popup-image {
    transform: scale(1.02);
}

/* ==========================================
   Mode Image en fond
   ========================================== */
.jpp-popup-image-mode {
    position: relative;
    padding: 0 !important;
    overflow: hidden;
    background: transparent !important;
    line-height: 0;
}

.jpp-popup-bg-image {
    display: block;
    width: 100%;
    height: auto;
}

.jpp-popup-image-mode .jpp-popup-inner {
    position: relative;
    background: transparent !important;
    z-index: 5;
    line-height: 1.5;
    text-align: center;
}

.jpp-popup-image-mode .jpp-cta-wrapper {
    margin: 0;
}

.jpp-popup-image-mode .jpp-close {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    z-index: 10;
}

.jpp-popup-image-mode .jpp-close:hover {
    background: #ffffff;
}

/* ==========================================
   Bouton CTA
   ========================================== */
.jpp-cta-wrapper {
    text-align: center;
    margin-top: 24px;
}

.jpp-cta-button {
    display: inline-block;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.jpp-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.jpp-cta-button:active {
    transform: translateY(0);
}

.jpp-cta-button:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ==========================================
   Animations - Fade
   ========================================== */
.jpp-animation-fade {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.jpp-overlay.jpp-visible .jpp-animation-fade {
    opacity: 1;
}

.jpp-overlay.jpp-closing .jpp-animation-fade {
    opacity: 0;
}

/* ==========================================
   Animations - Slide
   ========================================== */
.jpp-animation-slide {
    opacity: 0;
    transform: translateY(-50px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.jpp-overlay.jpp-visible .jpp-animation-slide {
    opacity: 1;
    transform: translateY(0);
}

.jpp-overlay.jpp-closing .jpp-animation-slide {
    opacity: 0;
    transform: translateY(-30px);
}

/* ==========================================
   Animations - Scale
   ========================================== */
.jpp-animation-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.jpp-overlay.jpp-visible .jpp-animation-scale {
    opacity: 1;
    transform: scale(1);
}

.jpp-overlay.jpp-closing .jpp-animation-scale {
    opacity: 0;
    transform: scale(0.9);
}

/* ==========================================
   Responsive - Tablettes
   ========================================== */
@media screen and (max-width: 768px) {
    .jpp-overlay {
        padding: 16px;
    }

    .jpp-popup-inner {
        padding: 32px 24px;
    }

    .jpp-popup-title {
        font-size: 24px;
    }

    .jpp-popup-content {
        font-size: 15px;
    }

    .jpp-popup-image-wrapper {
        margin: -32px -24px 20px -24px;
    }

    .jpp-cta-button {
        padding: 12px 28px;
        font-size: 15px;
    }

    .jpp-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

}

/* ==========================================
   Responsive - Mobile
   ========================================== */
@media screen and (max-width: 480px) {
    .jpp-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .jpp-popup {
        border-radius: 16px 16px 0 0 !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .jpp-popup-inner {
        padding: 28px 20px 32px;
    }

    .jpp-popup-title {
        font-size: 22px;
        padding-right: 30px;
    }

    .jpp-popup-content {
        font-size: 14px;
        line-height: 1.6;
    }

    .jpp-popup-image-wrapper {
        margin: -28px -20px 16px -20px;
    }

    .jpp-cta-wrapper {
        margin-top: 20px;
    }

    .jpp-cta-button {
        display: block;
        width: 100%;
        padding: 14px 24px;
        text-align: center;
    }

    .jpp-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .jpp-close svg {
        width: 16px;
        height: 16px;
    }

    /* Animation slide depuis le bas sur mobile */
    .jpp-animation-slide {
        transform: translateY(100%);
    }

    .jpp-overlay.jpp-visible .jpp-animation-slide {
        transform: translateY(0);
    }

    .jpp-overlay.jpp-closing .jpp-animation-slide {
        transform: translateY(100%);
    }

    .jpp-popup-image-mode .jpp-cta-button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ==========================================
   Accessibilité - Réduction de mouvement
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .jpp-overlay,
    .jpp-popup,
    .jpp-animation-fade,
    .jpp-animation-slide,
    .jpp-animation-scale,
    .jpp-close,
    .jpp-cta-button,
    .jpp-popup-image {
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================
   Mode sombre (si le site le supporte)
   ========================================== */
@media (prefers-color-scheme: dark) {
    .jpp-close {
        background: rgba(255, 255, 255, 0.1);
    }

    .jpp-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* ==========================================
   Print - Masquer le popup à l'impression
   ========================================== */
@media print {
    .jpp-overlay {
        display: none !important;
    }
}
