/**
 * Axis Modal/Popup Styles
 * 
 * Styling for Bricks popup templates (type="popup")
 * Bricks handles all popup logic - we just style it to match our design system
 * 
 * Bricks popup structure:
 * - .brx-popup (overlay wrapper - Bricks controlled)
 * - .brx-popup-content (content box - Bricks controlled)
 * 
 * Usage: Simply create a popup template in Bricks and these styles apply
 * 
 * @package Axis Mental Health
 * @since 1.0.0
 */

/* ==========================================================================
   HIDE POPUP TEMPLATES WHEN NOT IN POPUP WRAPPER
   ========================================================================== */

/* Hide popup sections when rendered inline (not in .brx-popup wrapper) */
section.popup-small:not(.brx-popup *),
section.popup-medium:not(.brx-popup *),
section.popup-large:not(.brx-popup *),
section.popup-xlarge:not(.brx-popup *) {
    display: none !important;
}

/* ==========================================================================
   POPUP OVERLAY (Bricks native class)
   ========================================================================== */

.brx-popup {
    /* Bricks handles positioning, display, z-index */
    /* Add backdrop blur for modern feel */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    /* top: 0; */
    /* margin-top: -20px; */
}

/* Darken overlay slightly */
.brx-popup::before {
    background: rgba(30, 42, 56, 0.6) !important;
}

/* ==========================================================================
   POPUP CONTENT BOX (Bricks native class)
   ========================================================================== */

.brx-popup-content {
    background: var(--axis-white);
    border-radius: var(--axis-radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    /* For close button positioning */
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--axis-space-8);
}

/* Width variants based on section class inside */
.brx-popup-content:has(.popup-small) {
    width: 400px;
}

.brx-popup-content:has(.popup-medium) {
    width: 700px;
}

.brx-popup-content:has(.popup-large) {
    width: 800px;
}

.brx-popup-content:has(.popup-xlarge) {
    width: 1000px;
}

/* ==========================================================================
   CLOSE BUTTON
   ========================================================================== */

.popup-close-btn {
    position: absolute !important;
    top: var(--axis-space-2) !important;
    right: var(--axis-space-4) !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: var(--axis-gray-500) !important;
    font-size: 44px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    z-index: 10 !important;
    transition: all 0.2s ease !important;
}

.popup-close-btn:hover {
    color: var(--axis-dark) !important;
    /* background: var(--axis-gray-100) !important; */
    /* border-radius: var(--axis-radius-md) !important; */
    box-shadow: none !important;
}

.popup-close-btn:focus {
    /* outline: 2px solid var(--axis-primary) !important; */
    /* outline-offset: 2px !important; */
}

/* ==========================================================================
   CONTENT ADJUSTMENTS
   ========================================================================== */

/* Remove card styling when forms are in popups */
.brx-popup-content .axis-consultation-form-wrapper.axis-card,
.brx-popup-content .axis-card {
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
}

/* Tighten heading spacing in popups */
.brx-popup-content .axis-card__heading,
.brx-popup-content h2 {
    margin-bottom: var(--axis-space-4);
}

/* ==========================================================================
   MOBILE OPTIMIZATIONS
   ========================================================================== */

@media (max-width: 767px) {
    .brx-popup-content {
        width: 92vw !important;
        max-width: 95vw;
        padding: var(--axis-space-6);
    }

    .brx-popup-content .axis-card__heading {
        font-size: var(--axis-text-xl);
    }
}

/* Small mobile: nearly fullscreen */
@media (max-width: 479px) {
    .brx-popup-content {
        width: 95vw !important;
        max-height: 95vh;
        border-radius: var(--axis-radius-md);
        padding: var(--axis-space-5);
    }
}