/**
 * GRAPHIC VIEW — Home Page Popups Master CSS (Feature 10)
 * Modern, responsive, accessible styling across 320px to 1920px viewports.
 * Client Brand: Graphic View | Developed by: Web Era Solutions
 */

/* Backdrop Overlay */
.gv-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    background-color: rgba(11, 27, 61, var(--gv-popup-opacity, 0.55));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.gv-popup-backdrop.gv-popup-visible {
    opacity: 1;
    visibility: visible;
}

/* Modal Dialog Box */
.gv-popup-dialog {
    position: relative;
    width: 100%;
    max-width: min(580px, calc(100% - 28px));
    margin: auto;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 25px 60px -15px rgba(11, 27, 61, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.92) translateY(15px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000000;
}

.gv-popup-backdrop.gv-popup-visible .gv-popup-dialog {
    transform: scale(1) translateY(0);
}

/* Close Button (X) */
.gv-popup-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid rgba(11, 27, 61, 0.15);
    color: #0b1b3d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 50;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.gv-popup-close-btn:hover {
    background: #0f172a;
    color: #ffffff;
    transform: rotate(90deg) scale(1.08);
}

/* Header Image */
.gv-popup-header-img-wrap {
    width: 100%;
    max-height: 240px;
    overflow: hidden;
    background: #f8fafc;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.gv-popup-header-img {
    width: 100%;
    height: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
}

/* Split Layout */
.gv-popup-split-img-col {
    background: #f1f5f9;
    overflow: hidden;
    align-self: stretch;
}

.gv-popup-split-img {
    width: 100%;
    height: 100%;
    min-height: 340px;
    object-fit: cover;
    display: block;
}

/* Typography & Content */
.gv-popup-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.45rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: inherit;
}

.gv-popup-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
}

.gv-popup-desc {
    font-size: 0.9rem;
    line-height: 1.55;
}

/* Coupon & Offer Code Box */
.gv-popup-offer-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(16, 185, 129, 0.06);
    border: 1.5px dashed #10B981;
    border-radius: 12px;
}

.gv-popup-offer-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #065f46;
    margin-right: 6px;
}

.gv-popup-offer-code {
    font-family: monospace;
    font-weight: 800;
    font-size: 1.1rem;
    color: #047857;
    letter-spacing: 1px;
}

/* Buttons */
.gv-popup-cta-btn {
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gv-popup-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
}

.gv-popup-secondary-btn {
    transition: all 0.2s ease;
}

.btn-gv-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #10b981 100%);
    color: #ffffff;
    border: none;
}

.btn-gv-gradient:hover {
    color: #ffffff;
    opacity: 0.92;
}

/* Terms Note */
.gv-popup-terms {
    font-size: 11px;
    line-height: 1.4;
}

/* Mobile full-screen / adjustments */
@media (max-width: 576px) {
    .gv-popup-backdrop {
        padding: 10px;
    }

    .gv-popup-dialog {
        width: 100% !important;
        max-width: calc(100% - 20px) !important;
        max-height: 92vh;
        border-radius: 16px !important;
        margin: auto !important;
    }

    .gv-popup-dialog .p-4 {
        padding: 16px 14px !important;
    }

    .gv-popup-layout-fullscreen_mobile {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

    .gv-popup-heading {
        font-size: 1.15rem !important;
        line-height: 1.25 !important;
    }

    .gv-popup-subtitle {
        font-size: 12px !important;
    }

    .gv-popup-desc {
        font-size: 12.5px !important;
        margin-bottom: 12px !important;
    }

    .gv-popup-header-img-wrap {
        max-height: 140px;
    }

    .gv-popup-header-img {
        max-height: 140px;
    }

    .gv-popup-offer-pill {
        max-width: 100% !important;
        padding: 8px 10px;
        flex-direction: column;
        gap: 6px;
        align-items: stretch !important;
    }

    .gv-popup-cta-btn, .gv-popup-secondary-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
}

/* Scroll locking while popup is open */
body.gv-popup-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .gv-popup-backdrop,
    .gv-popup-dialog,
    .gv-popup-close-btn,
    .gv-popup-cta-btn {
        transition: none !important;
        transform: none !important;
    }
}
