/**
 * GenWave Theme Builder - Frontend Styles
 *
 * Styles for headers, footers, popups rendered on the frontend.
 *
 * @package GenWave_Agent
 * @since 1.1.0
 */

/* ==========================================================================
   Header & Footer
   ========================================================================== */

.gw-header,
.gw-footer {
    width: 100%;
    position: relative;
}

.gw-header {
    z-index: 1000;
}

.gw-footer {
    z-index: 500;
}

/* Sticky header support */
.gw-header.gw-sticky {
    position: sticky;
    top: 0;
}

/* Reset shortcodes.css styles for Theme Builder headers/footers */
.gw-header-inner,
.gw-footer-inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    display: block;
}

.gw-header-inner > .elementor,
.gw-footer-inner > .elementor {
    width: 100%;
}

/* ==========================================================================
   Popup System
   ========================================================================== */

.gw-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.gw-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.gw-popup-container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none;
}

.gw-popup-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow: auto;
    pointer-events: auto;
}

.gw-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    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: all 0.2s ease;
    z-index: 10;
    padding: 0;
}

.gw-popup-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

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

.gw-popup-body {
    width: 100%;
}

.gw-popup-body > .elementor {
    padding: 0 !important;
}

/* Popup Positions */
.gw-popup-position-center .gw-popup-container {
    align-items: center;
    justify-content: center;
}

.gw-popup-position-top-center .gw-popup-container {
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}

.gw-popup-position-bottom-center .gw-popup-container {
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 60px;
}

.gw-popup-position-top-left .gw-popup-container {
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 60px;
    padding-left: 60px;
}

.gw-popup-position-top-right .gw-popup-container {
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 60px;
    padding-right: 60px;
}

.gw-popup-position-bottom-left .gw-popup-container {
    align-items: flex-end;
    justify-content: flex-start;
    padding-bottom: 60px;
    padding-left: 60px;
}

.gw-popup-position-bottom-right .gw-popup-container {
    align-items: flex-end;
    justify-content: flex-end;
    padding-bottom: 60px;
    padding-right: 60px;
}

.gw-popup-position-full-screen .gw-popup-content {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
}

/* Popup Animations */
.gw-popup-animation-fade {
    animation: gwPopupFade 0.3s ease;
}

.gw-popup-animation-slide-up {
    animation: gwPopupSlideUp 0.3s ease;
}

.gw-popup-animation-slide-down {
    animation: gwPopupSlideDown 0.3s ease;
}

.gw-popup-animation-zoom {
    animation: gwPopupZoom 0.3s ease;
}

.gw-popup-animation-flip {
    animation: gwPopupFlip 0.5s ease;
}

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

@keyframes gwPopupSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes gwPopupZoom {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gwPopupFlip {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(20deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0);
    }
}

/* Hide popup on closing */
.gw-popup.gw-popup-closing .gw-popup-content {
    animation: gwPopupFadeOut 0.2s ease forwards;
}

@keyframes gwPopupFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* ==========================================================================
   Canvas Template
   ========================================================================== */

.gw-canvas-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.gw-main-content {
    flex: 1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .gw-popup-container {
        padding: 10px;
    }

    .gw-popup-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 12px;
    }

    .gw-popup-position-top-left .gw-popup-container,
    .gw-popup-position-top-right .gw-popup-container,
    .gw-popup-position-bottom-left .gw-popup-container,
    .gw-popup-position-bottom-right .gw-popup-container {
        padding: 10px;
    }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="rtl"] .gw-popup-close {
    right: auto;
    left: 10px;
}
