/**
 * Freestyle Popup Builder - Base Styles
 */

.freestyle-popup-wrapper {
    display: inline-block;
    margin: 10px 0;
}

.freestyle-popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.freestyle-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.freestyle-popup-btn:active {
    transform: translateY(0);
}

.freestyle-popup-btn svg {
    flex-shrink: 0;
}

.freestyle-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    padding-top: 40px; /* Minimum distance from top */
    padding-bottom: 40px; /* Symmetric spacing */
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling if content too tall */
}

.freestyle-popup-overlay.no-overlay {
    background: transparent;
    pointer-events: none;
}

.freestyle-popup-overlay.no-overlay .freestyle-popup-content {
    pointer-events: auto;
}

.freestyle-popup-overlay.no-overlay .freestyle-popup-close {
    pointer-events: auto;
}

.freestyle-popup-overlay.active {
    display: flex;
}

.freestyle-popup-content {
    position: relative;
}

.freestyle-popup-close {
    position: absolute;
    top: -50px;
    right: -10px;
    background: white;
    color: black;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000000;
}

.freestyle-popup-close:hover {
    background: #ff4444;
    color: white;
    transform: rotate(90deg);
}

.freestyle-popup-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: black;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.freestyle-popup-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

.freestyle-popup-scale-wrapper {
    display: block;
    width: fit-content;
    margin: 0 auto;
    transform-origin: center center;
    position: relative; /* For close button positioning */
}

.freestyle-popup-custom-container {
    position: relative;
    width: 800px;
    height: 600px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.freestyle-popup-custom-container .popup-element {
    position: absolute;
    padding: 10px;
}

.freestyle-popup-custom-container .text-element {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 16px;
    text-align: left;
}

.freestyle-popup-custom-container .image-element img {
    max-width: 100%;
    height: auto;
    display: block;
}

.freestyle-popup-custom-container .video-element iframe {
    display: block;
    width: 100%;
    height: 100%;
}

.freestyle-popup-custom-container .video-element video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.freestyle-popup-custom-container .element-controls {
    display: none !important;
}

.popup-element.video-element {
    position: absolute;
}

.fp-video-poster {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.fp-video-poster:hover > div {
    background: rgba(0,0,0,0.85) !important;
}

