/* ============================================================
   AI Girlfriend – Ready-Girlfriend Detail Popup
   Premium full-screen modal for selection flow
   ============================================================ */

/* ── Runtime variables ──────────────────────────────────────── */
:root {
    --gfp-accent:        #c446ff;
    --gfp-accent-2:      #e91e63;
    --gfp-bg:            rgba(8, 5, 18, 0.98);
    --gfp-surface:       rgba(28, 18, 48, 0.80);
    --gfp-border:        rgba(195, 70, 255, 0.16);
    --gfp-text:          #f0e8ff;
    --gfp-muted:         rgba(200, 175, 240, 0.58);
    --gfp-hero-w:        400px;
    --gfp-radius:        26px;
    --gfp-z:             99999;
}

/* ── Overlay ─────────────────────────────────────────────────── */
.aigf-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--gfp-z);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.28s ease;
}
.aigf-popup-overlay.is-open {
    pointer-events: all;
    opacity: 1;
}

/* Blurred glass backdrop */
.aigf-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 2, 12, 0.85);
    backdrop-filter: blur(14px) saturate(0.75);
    -webkit-backdrop-filter: blur(14px) saturate(0.75);
    cursor: pointer;
}

/* ── Shell ───────────────────────────────────────────────────── */
.aigf-popup-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 900px;
    max-height: 88vh;
    border-radius: var(--gfp-radius);
    overflow: hidden;
    background: var(--gfp-bg);
    border: 1px solid var(--gfp-border);
    box-shadow:
        0 0 0 1px rgba(195, 70, 255, 0.06),
        0 0 80px rgba(140, 30, 200, 0.22),
        0 50px 120px rgba(0, 0, 0, 0.75);
    transform: scale(0.86) translateY(28px);
    opacity: 0;
    transition:
        transform 0.44s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity   0.28s ease;
}
.aigf-popup-overlay.is-open .aigf-popup-shell {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Ambient glow drifts */
.aigf-popup-shell::before,
.aigf-popup-shell::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.aigf-popup-shell::before {
    width: 55%;
    height: 55%;
    top: -30%;
    left: -15%;
    background: radial-gradient(circle, rgba(156, 39, 176, 0.10) 0%, transparent 70%);
    animation: gfpDrift 9s ease-in-out infinite alternate;
}
.aigf-popup-shell::after {
    width: 48%;
    height: 48%;
    bottom: -28%;
    right: -8%;
    background: radial-gradient(circle, rgba(233, 30, 99, 0.09) 0%, transparent 70%);
    animation: gfpDrift 11s ease-in-out infinite alternate-reverse;
}
@keyframes gfpDrift {
    to { transform: translate(18px, -22px) scale(1.12); }
}

/* ── Close button ────────────────────────────────────────────── */
.aigf-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.50);
    color: rgba(255, 255, 255, 0.65);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.25s;
    backdrop-filter: blur(6px);
}
.aigf-popup-close:hover {
    background: rgba(195, 70, 255, 0.38);
    color: #fff;
    transform: scale(1.12) rotate(90deg);
}

/* ── Hero panel (left) ───────────────────────────────────────── */
.aigf-popup-hero {
    flex: 0 0 var(--gfp-hero-w);
    position: relative;
    overflow: hidden;
    background: #060310;
    min-height: 520px;
}

/* 3-D tilt wrapper — JS writes perspective transform here */
.aigf-popup-tilt-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}

.aigf-popup-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: opacity 0.4s ease;
}
.aigf-popup-hero-img.is-loading { opacity: 0; }

/* Bottom gradient for legibility */
.aigf-popup-hero-grad {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(8, 5, 18, 0.88) 100%);
    pointer-events: none;
}

/* ── Discount badge ──────────────────────────────────────────── */
.aigf-popup-discount {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 10;
    background: linear-gradient(135deg, #8e1ac8 0%, #e01060 100%);
    border-radius: 18px;
    padding: 10px 16px;
    box-shadow:
        0 0 28px rgba(195, 70, 255, 0.55),
        0 6px 18px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 104px;
    animation: gfpPulseBadge 2.8s ease-in-out infinite;
}
@keyframes gfpPulseBadge {
    0%, 100% { box-shadow: 0 0 28px rgba(195, 70, 255, 0.55), 0 6px 18px rgba(0,0,0,0.45); }
    50%       { box-shadow: 0 0 42px rgba(195, 70, 255, 0.80), 0 6px 18px rgba(0,0,0,0.45); }
}

.aigf-popup-discount-pct {
    font-size: 21px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Real-time countdown */
.aigf-popup-countdown {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
}
.aigf-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}
.aigf-cd-unit span {
    font-weight: 700;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.aigf-cd-unit em {
    font-style: normal;
    font-size: 8px;
    opacity: 0.75;
    margin-top: 1px;
}
.aigf-cd-sep {
    font-weight: 700;
    opacity: 0.7;
    margin-top: -3px;
}
.aigf-popup-countdown.is-hidden { display: none; }

/* ── Body (right panel) ──────────────────────────────────────── */
.aigf-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 28px 26px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(195, 70, 255, 0.28) transparent;
    position: relative;
    z-index: 1;
}
.aigf-popup-body::-webkit-scrollbar { width: 4px; }
.aigf-popup-body::-webkit-scrollbar-track { background: transparent; }
.aigf-popup-body::-webkit-scrollbar-thumb {
    background: rgba(195, 70, 255, 0.28);
    border-radius: 2px;
}

/* ── Loading spinner ─────────────────────────────────────────── */
.aigf-popup-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: var(--gfp-muted);
    font-size: 14px;
    gap: 12px;
}
.aigf-popup-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(195, 70, 255, 0.25);
    border-top-color: var(--gfp-accent);
    border-radius: 50%;
    animation: gfpSpin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes gfpSpin { to { transform: rotate(360deg); } }

/* ── Header (name + tagline) ─────────────────────────────────── */
.aigf-popup-header { margin-bottom: 18px; }

.aigf-popup-name {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 5px;
    background: linear-gradient(130deg, #ecdeff 0%, #d066ff 60%, #ff4d94 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.aigf-popup-tagline {
    font-size: 13px;
    color: var(--gfp-muted);
    margin: 0;
    letter-spacing: 0.04em;
}

/* ── Stats row ───────────────────────────────────────────────── */
.aigf-popup-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
/* Stagger entry */
.aigf-popup-overlay.is-open .aigf-popup-stats { animation: gfpFadeUp 0.5s ease both 0.18s; }

.aigf-stat {
    flex: 1;
    background: var(--gfp-surface);
    border: 1px solid var(--gfp-border);
    border-radius: 14px;
    padding: 11px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(10px);
}
.aigf-stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--gfp-accent);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.aigf-stat--rating .aigf-stat-value { color: #ffd040; }
.aigf-stat-label {
    font-size: 9px;
    color: var(--gfp-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}
.aigf-stat-stars {
    font-size: 11px;
    color: #ffd040;
    letter-spacing: 1px;
    line-height: 1;
}

/* ── Chemistry arc ───────────────────────────────────────────── */
.aigf-popup-chemistry {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 16px;
    padding: 14px 14px 10px;
    background: var(--gfp-surface);
    border: 1px solid var(--gfp-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}
.aigf-popup-overlay.is-open .aigf-popup-chemistry { animation: gfpFadeUp 0.5s ease both 0.26s; }

.aigf-arc-svg {
    width: 150px;
    height: 80px;
    overflow: visible;
    display: block;
}
.aigf-arc-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 9;
    stroke-linecap: round;
}
.aigf-arc-fill {
    fill: none;
    stroke: url(#gfpArcGrad);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.aigf-arc-label {
    position: absolute;
    bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    pointer-events: none;
}
.aigf-arc-score {
    font-size: 24px;
    font-weight: 800;
    color: var(--gfp-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.aigf-arc-sub {
    font-size: 9px;
    color: var(--gfp-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
}

/* ── Content sections ────────────────────────────────────────── */
.aigf-popup-section {
    margin-bottom: 16px;
    animation: gfpFadeUp 0.45s ease both;
}
.aigf-popup-overlay.is-open .aigf-popup-section:nth-child(1) { animation-delay: 0.32s; }
.aigf-popup-overlay.is-open .aigf-popup-section:nth-child(2) { animation-delay: 0.38s; }
.aigf-popup-overlay.is-open .aigf-popup-section:nth-child(3) { animation-delay: 0.44s; }
.aigf-popup-overlay.is-open .aigf-popup-section:nth-child(4) { animation-delay: 0.50s; }

@keyframes gfpFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aigf-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--gfp-muted);
    font-weight: 700;
    margin: 0 0 9px;
}

.aigf-popup-bio {
    font-size: 13.5px;
    line-height: 1.68;
    color: rgba(215, 195, 255, 0.78);
    margin: 0;
}

/* Trait chips */
.aigf-popup-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.aigf-popup-trait {
    padding: 5px 13px;
    border-radius: 30px;
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(196, 70, 255, 0.10);
    border: 1px solid rgba(196, 70, 255, 0.28);
    color: rgba(220, 175, 255, 0.92);
    letter-spacing: 0.02em;
}

/* Interest chips */
.aigf-popup-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.aigf-popup-interest {
    padding: 5px 13px;
    border-radius: 30px;
    font-size: 11.5px;
    font-weight: 500;
    background: rgba(233, 30, 99, 0.09);
    border: 1px solid rgba(233, 30, 99, 0.24);
    color: rgba(255, 180, 210, 0.90);
}

/* Reviews */
.aigf-popup-reviews {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 190px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(195, 70, 255, 0.18) transparent;
}
.aigf-popup-reviews::-webkit-scrollbar { width: 3px; }
.aigf-popup-reviews::-webkit-scrollbar-thumb { background: rgba(195, 70, 255, 0.25); border-radius: 2px; }

.aigf-review {
    background: var(--gfp-surface);
    border: 1px solid var(--gfp-border);
    border-radius: 12px;
    padding: 11px 13px;
}
.aigf-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}
.aigf-review-name   { font-size: 12px; font-weight: 700; color: var(--gfp-text); }
.aigf-review-stars  { font-size: 11px; color: #ffd040; letter-spacing: 1px; }
.aigf-review-text   { font-size: 12.5px; color: rgba(200, 182, 230, 0.78); line-height: 1.5; margin: 0; }

/* CTA spacer */
.aigf-popup-cta-spacer { height: 88px; }

/* ── Sticky CTA bar ──────────────────────────────────────────── */
.aigf-popup-cta-bar {
    position: absolute;
    bottom: 0;
    padding: 14px 26px 20px;
    background: linear-gradient(to top, rgba(8, 5, 18, 0.99) 55%, transparent);
    z-index: 5;
    flex-shrink: 0;
}
.aigf-popup-cta-btn {
    width: 100%;
    padding: 15px 24px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 15.5px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #9820c2 0%, #e91e63 100%);
    box-shadow:
        0 0 36px rgba(180, 50, 255, 0.42),
        0 8px 26px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.018em;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    position: relative;
    overflow: hidden;
}
/* Inner shimmer */
.aigf-popup-cta-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, transparent 55%);
    pointer-events: none;
}
.aigf-popup-cta-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.015);
    box-shadow:
        0 0 52px rgba(180, 50, 255, 0.60),
        0 14px 34px rgba(0, 0, 0, 0.55);
    filter: brightness(1.07);
}
.aigf-popup-cta-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}
.aigf-popup-cta-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
/* Loading state dots */
.aigf-popup-cta-btn.is-loading .aigf-cta-text::after {
    content: '';
    animation: gfpDots 1.1s steps(4, end) infinite;
}
@keyframes gfpDots {
    0%  { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}
.aigf-cta-icon  { font-size: 17px; }
.aigf-cta-arrow { font-size: 16px; margin-left: auto; opacity: 0.7; transition: transform 0.2s; }
.aigf-popup-cta-btn:hover .aigf-cta-arrow { transform: translateX(3px); }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 680px) {
    .aigf-popup-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .aigf-popup-shell {
        flex-direction: column;
        max-width: 100%;
        width: 100%;
        max-height: 94vh;
        border-radius: 22px 22px 0 0;
        transform: translateY(42px) scale(0.97);
    }
    .aigf-popup-overlay.is-open .aigf-popup-shell {
        transform: translateY(0) scale(1);
    }
    .aigf-popup-hero {
        flex: 0 0 240px;
        min-height: 240px;
    }
    .aigf-popup-hero-img { object-position: center 18%; }
    .aigf-popup-discount { top: 12px; left: 12px; padding: 7px 12px; min-width: auto; }
    .aigf-popup-discount-pct { font-size: 17px; }
    .aigf-popup-body { padding: 18px 18px 0; }
    .aigf-popup-name { font-size: 24px; }
    .aigf-mobile-hide { display: none; }
    .aigf-popup-chemistry { padding: 10px; }
    .aigf-arc-svg { width: 120px; height: 64px; }
    .aigf-arc-score { font-size: 20px; }
    .aigf-arc-label { bottom: 12px; }
    .aigf-popup-cta-bar { padding: 10px 18px 16px; }
    .aigf-popup-cta-btn { font-size: 14.5px; padding: 13px 20px; }
    .aigf-popup-stats { gap: 6px; }
    .aigf-stat { padding: 9px 6px; }
    .aigf-stat-value { font-size: 16px; }
}
