/**
 * Popup Block - Frontend Styles
 * 
 * @package WPDashboard
 * @since 1.8.0
 */

/* Container principal */
.wp-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.wp-popup-wrapper.wp-popup-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Overlay */
.wp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    z-index: 0;
}

/* Container du popup */
.wp-dashboard-popup {
    position: fixed;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.wp-popup-visible .wp-dashboard-popup {
    transform: scale(1);
}

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

.wp-popup-visible .wp-dashboard-popup.popup-position-center {
    transform: translate(-50%, -50%) scale(1);
}

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

.wp-popup-visible .wp-dashboard-popup.popup-position-top {
    transform: translateX(-50%) translateY(0);
}

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

.wp-popup-visible .wp-dashboard-popup.popup-position-bottom {
    transform: translateX(-50%) translateY(0);
}

.wp-dashboard-popup.popup-position-bottom-right {
    bottom: 20px;
    right: 20px;
    transform: translateX(20px) translateY(20px);
}

.wp-popup-visible .wp-dashboard-popup.popup-position-bottom-right {
    transform: translateX(0) translateY(0);
}

.wp-dashboard-popup.popup-position-bottom-left {
    bottom: 20px;
    left: 20px;
    transform: translateX(-20px) translateY(20px);
}

.wp-popup-visible .wp-dashboard-popup.popup-position-bottom-left {
    transform: translateX(0) translateY(0);
}

/* Animations */
.wp-dashboard-popup.popup-animation-fade {
    animation: popupFadeIn 0.3s ease;
}

.wp-dashboard-popup.popup-animation-slide {
    animation: popupSlideIn 0.4s ease;
}

.wp-dashboard-popup.popup-animation-zoom {
    animation: popupZoomIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes popupZoomIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Bouton de fermeture */
.wp-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
    padding: 0;
}

.wp-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.wp-popup-close:active {
    transform: scale(0.95);
}

.wp-popup-close svg {
    width: 20px;
    height: 20px;
    color: #333;
}

/* Contenu du popup */
.wp-popup-content {
    padding: 40px 30px 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .wp-dashboard-popup {
        width: var(--mobile-width, 90%) !important;
        max-width: var(--mobile-width, 90%) !important;
        max-height: 85vh;
        left: 50% !important;
        right: auto !important;
    }
    
    .wp-dashboard-popup.popup-position-center {
        top: 50%;
        transform: translate(-50%, -50%) scale(0.9) !important;
    }
    
    .wp-popup-visible .wp-dashboard-popup.popup-position-center {
        transform: translate(-50%, -50%) scale(1) !important;
    }
    
    .wp-dashboard-popup.popup-position-top {
        top: 20px;
        transform: translateX(-50%) translateY(-20px) !important;
    }
    
    .wp-popup-visible .wp-dashboard-popup.popup-position-top {
        transform: translateX(-50%) translateY(0) !important;
    }
    
    .wp-dashboard-popup.popup-position-bottom,
    .wp-dashboard-popup.popup-position-bottom-right,
    .wp-dashboard-popup.popup-position-bottom-left {
        bottom: 20px;
        top: auto;
        transform: translateX(-50%) translateY(20px) !important;
    }
    
    .wp-popup-visible .wp-dashboard-popup.popup-position-bottom,
    .wp-popup-visible .wp-dashboard-popup.popup-position-bottom-right,
    .wp-popup-visible .wp-dashboard-popup.popup-position-bottom-left {
        transform: translateX(-50%) translateY(0) !important;
    }
    
    .wp-popup-content {
        padding: 35px 20px 20px;
    }
}

@media (max-width: 480px) {
    .wp-popup-close {
        width: 32px;
        height: 32px;
    }
    
    .wp-popup-close svg {
        width: 18px;
        height: 18px;
    }
}

/* Scrollbar personnalisée pour le popup */
.wp-dashboard-popup::-webkit-scrollbar {
    width: 8px;
}

.wp-dashboard-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 8px 8px 0;
}

.wp-dashboard-popup::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.wp-dashboard-popup::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Styles pour le contenu WordPress par défaut */
.wp-popup-content h1,
.wp-popup-content h2,
.wp-popup-content h3 {
    margin-top: 0;
}

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

/* Support pour les formulaires */
.wp-popup-content form {
    margin: 0;
}

.wp-popup-content input[type="text"],
.wp-popup-content input[type="email"],
.wp-popup-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wp-popup-content button[type="submit"],
.wp-popup-content input[type="submit"] {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.wp-popup-content button[type="submit"]:hover,
.wp-popup-content input[type="submit"]:hover {
    background: #135e96;
}


