/*
 * SV POPUP - Main Plugin Styles
 * v1.9.0 - All styles, including modern video fix
 */

/* ================================== */
/* 1. POPUP SHELL (Overlay, Window, Close)
/* ================================== */
#sv-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* BLUR EFFECT */
    background-color: rgba(10, 20, 50, 0.3);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sv-popup-overlay.sv-popup-active {
    opacity: 1;
    visibility: visible;
}

.sv-popup-window {
    position: relative;
    z-index: 99999;
    transform: scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#sv-popup-overlay.sv-popup-active .sv-popup-window {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

/* Desktop base: big, 1000px wide modal */
.sv-popup-content {
    background-color: transparent;
    padding: 0;
    box-shadow: none;
    width: 95%;
    min-width: 1000px;
    max-width: 1000px;
    position: relative; /* anchor for close button */
}

/* "X" BUTTON */
.sv-popup-close {
    position: absolute;
    top: 8px;
    right: 50px;
    width: auto;
    height: auto;
    
    background-color: transparent;
    color: #ffffff;
    border-radius: 0;
    border: none;
    
    display: block;
    font-size: 1.6rem;
    line-height: 1;
    font-weight: 400;
    font-family: Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    z-index: 100;
    
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sv-popup-close:hover {
    transform: none;
    opacity: 1;
}

/* Base styles for content slotted from WP */
.sv-popup-content-inner {
    /* container for dynamic content */
}

/* Any direct child content from WP should not overflow horizontally */
.sv-popup-content-inner > * {
    max-width: 100%;
}

/* Body lock class to prevent scrolling */
body.sv-popup-body-lock {
    overflow: hidden;
}

/* ================================== */
/* 1b. MOBILE / TABLET OVERRIDES
/*     This is where we fix responsiveness
/* ================================== */
@media (max-width: 768px) {
    .sv-popup-window {
        width: 100%;
        padding: 0 10px;
    }

    /* Override desktop min-width so it can shrink */
    .sv-popup-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
    }

    .sv-popup-close {
        top: 12px;
        right: 12px; /* keeps the X inside the rounded box */
        font-size: 1.8rem;
    }
}

/* ================================== */
/* 2. CUSTOM CONVERSATION AI STYLES
/* ================================== */

/* Define the brand colors */
:root {
    --primary-blue: #09a8ff;
    --gradient-blue-start: #09a8ff;
    --gradient-blue-end: #0088d2;
    --dark-background: #101535;
    --border-color: #4328b7;
    --text-light: #e0e0e0;
    --text-dark: #333;
    --text-highlight: #09a8ff;
    --container-bg: #1a2040;
}

/* Main container for popup content */
.sv-convo-ai-container {
    max-width: 960px;
    margin: 0;
    padding: 9px;
    
    background-color: rgba(26, 32, 64, 0.85);
    
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    color: var(--text-light);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.sv-convo-ai-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at top left, rgba(67, 40, 183, 0.3) 0%, transparent 40%),
                radial-gradient(circle at bottom right, rgba(9, 168, 255, 0.2) 0%, transparent 40%);
    z-index: 0;
    opacity: 0.3;
}

.sv-convo-ai-content-wrapper {
    position: relative;
    z-index: 1;
}

.sv-convo-ai-container h1,
.sv-convo-ai-container h2,
.sv-convo-ai-container h3,
.sv-convo-ai-container h4,
.sv-convo-ai-container h5,
.sv-convo-ai-container h6 {
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
}

.sv-convo-ai-container h1 {
    font-size: 2.8em;
    color: white;
    margin-top: 0;
    letter-spacing: -1px;
}

.sv-convo-ai-container p {
    margin-bottom: 20px;
    font-size: 1.1em;
    color: var(--text-light);
}

.sv-convo-ai-key-benefits {
    list-style: none;
    padding: 0;
    margin-top: 30px;
}

.sv-convo-ai-key-benefits li {
    background-color: var(--dark-background);
    border-left: 5px solid var(--primary-blue);
    padding: 15px 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.sv-convo-ai-key-benefits li::before {
    content: '✓';
    color: var(--primary-blue);
    font-size: 1.5em;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
    transition: opacity 0.2s ease-in-out;
}
.sv-convo-ai-key-benefits li:hover::before {
    opacity: 1;
}

.sv-convo-ai-key-benefits li:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.sv-convo-ai-key-benefits li strong {
    color: var(--primary-blue);
    font-size: 1.2em;
    display: block;
    margin-bottom: 8px;
    margin-left: 30px; /* Offset for checkmark */
}
.sv-convo-ai-key-benefits li span {
    display: block;
    margin-left: 30px; /* Offset for checkmark */
}

/* Bottom text */
.sv-convo-ai-summary {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 1.15em;
    font-weight: 500;
}

/* CTA button */
.sv-convo-ai-cta-button {
    display: block;
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    margin: 30px auto 10px auto;
    padding: 14px 28px;
    background: linear-gradient(45deg, var(--gradient-blue-start), var(--gradient-blue-end));
    color: white;
    font-size: 1.1em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(9, 168, 255, 0.3);
    transition: all 0.3s ease;
}

.sv-convo-ai-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(9, 168, 255, 0.4);
    color: white;
}

/* Responsive text/container tweaks */
@media (max-width: 768px) {
    .sv-convo-ai-container {
        padding: 9px;
    }
    .sv-convo-ai-container h1 {
        font-size: 2em;
    }
    .sv-convo-ai-key-benefits li {
        padding: 15px 20px;
    }
    .sv-convo-ai-key-benefits li strong,
    .sv-convo-ai-key-benefits li span {
        margin-left: 25px;
    }
    .sv-convo-ai-key-benefits li::before {
        left: 5px;
    }
}

@media (max-width: 480px) {
    .sv-convo-ai-container h1 {
        font-size: 1.6em;
    }
    .sv-convo-ai-container p {
        font-size: 1em;
    }
    .sv-convo-ai-key-benefits li {
        font-size: 0.95em;
    }
    .sv-convo-ai-key-benefits li strong,
    .sv-convo-ai-key-benefits li span {
        margin-left: 20px;
    }
    .sv-convo-ai-key-benefits li::before {
        left: 5px;
        font-size: 1.2em;
    }
    .sv-convo-ai-summary {
        font-size: 1.05em;
    }
}

/* ================================== */
/* 3. RESPONSIVE VIDEO STYLES
/* ================================== */

/* Fallback: make any video/iframe responsive, even without wrapper */
.sv-popup-content-inner video,
.sv-popup-content-inner iframe,
.sv-popup-content-inner .wp-block-video video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 8px;
}

/* Optional wrapper class if you want a fixed aspect ratio */
.video-responsive {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
