/**
 * THG Popup Frontend Styles
 */

/* Body class when popup is open (scroll allowed) */
body.thg-popup-open {
    /* Scroll allowed - no overflow restriction */
}

/* Overlay */
.thg-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thg-popup-overlay.thg-popup-visible {
    opacity: 1;
}

/* Container - Center position */
.thg-popup-container.thg-popup-position-center {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    width: 600px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.thg-popup-visible .thg-popup-container.thg-popup-position-center {
    transform: scale(1);
}

/* Container - Bottom position */
.thg-popup-container.thg-popup-position-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    width: 100%;
    max-width: 100%;
    background: #fff;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.2);
    overflow: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.thg-popup-visible .thg-popup-container.thg-popup-position-bottom {
    transform: translateY(0);
}

/* Close button */
.thg-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 5px;
    transition: color 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thg-popup-close:hover {
    color: #000;
}

.thg-popup-close:focus {
    outline: none;
}

/* Content area */
.thg-popup-content {
    padding: 30px;
}

.thg-popup-content iframe {
    max-width: 100%;
}

.thg-popup-content img {
    max-width: 100%;
    height: auto;
}

/* Typography reset for popup content */
.thg-popup-content h1,
.thg-popup-content h2,
.thg-popup-content h3,
.thg-popup-content h4,
.thg-popup-content h5,
.thg-popup-content h6 {
    margin-top: 0;
}

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

/* Responsive */
@media (max-width: 768px) {
    .thg-popup-container.thg-popup-position-center {
        width: 95%;
        max-height: 85vh;
    }

    .thg-popup-content {
        padding: 20px;
    }

    .thg-popup-close {
        top: 5px;
        right: 10px;
    }
}

/* Animation keyframes for smooth appearance */
@keyframes thg-popup-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes thg-popup-scale-in {
    from {
        transform: scale(0.9);
    }
    to {
        transform: scale(1);
    }
}

@keyframes thg-popup-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
