/**
 * AIGF Discount System — CSS
 * Temu-style urgency pricing layer: promo bar, badges, countdown timers
 * UI-only; no layout or billing logic is modified.
 */

/* ======================================================================
   TOP PROMO ANNOUNCEMENT BAR
   ====================================================================== */

#aigf-promo-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: linear-gradient(90deg, #6B3FA0 0%, #9B5DD4 50%, #6B3FA0 100%);
    color: #fff;
    font-family: var(--font-primary, 'DM Sans', system-ui, -apple-system, sans-serif);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.4;
    padding: 0 48px 0 16px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 14px rgba(107, 63, 160, 0.45);
    transition: transform 0.35s ease, opacity 0.35s ease;
    will-change: transform, opacity;
}

#aigf-promo-bar.aigf-promo-bar--hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.aigf-promo-bar__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 900px;
    justify-content: center;
    flex-wrap: nowrap;
    overflow: hidden;
}

.aigf-promo-bar__icon {
    width: 15px;
    height: 15px;
    color: #fde68a;
    flex-shrink: 0;
}

.aigf-promo-bar__icon-wrap {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 15px;
}

.aigf-promo-bar__icon-wrap svg {
    width: 15px;
    height: 15px;
}

.aigf-promo-bar__text {
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #F0E8FF;
    white-space: nowrap;
}

.aigf-promo-bar__highlight {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.aigf-promo-bar__sep {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    flex-shrink: 0;
}

.aigf-promo-bar__label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.aigf-promo-bar__timer {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    flex-shrink: 0;
}

.aigf-promo-bar__unit {
    background: #F97316;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 15px;
    min-width: 32px;
    text-align: center;
    line-height: 1.4;
    color: #FFFFFF;
    font-weight: 700;
}

.aigf-promo-bar__colon {
    color: #FFFFFF;
    padding: 0 1px;
    font-size: 15px;
    font-weight: 700;
}

/* CTA button — pink pill matching reference */
.aigf-promo-bar__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 0;
    padding: 5px 16px;
    background: #FF5A8A;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    border-radius: 20px;
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

.aigf-promo-bar__cta:hover {
    background: #ff3d76;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.aigf-promo-bar__cta-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.aigf-promo-bar__cta-icon svg {
    width: 13px;
    height: 13px;
}

.aigf-promo-bar__close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease;
    line-height: 1;
    font-size: 18px;
}

.aigf-promo-bar__close svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.aigf-promo-bar__close:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .aigf-promo-bar__sep {
        display: none;
    }

    #aigf-promo-bar {
        font-size: 12px;
        padding: 0 40px 0 10px;
        gap: 8px;
    }

    .aigf-promo-bar__inner {
        gap: 10px;
    }

    .aigf-promo-bar__cta {
        padding: 4px 12px;
        font-size: 11px;
    }

    .aigf-promo-bar__highlight {
        padding: 1px 7px;
        font-size: 11px;
    }

    .aigf-promo-bar__unit {
        font-size: 13px;
        padding: 2px 6px;
        min-width: 28px;
    }

    .aigf-promo-bar__colon {
        font-size: 13px;
    }
}

@media (max-width: 520px) {
    .aigf-promo-bar__timer {
        display: none;
    }

    .aigf-promo-bar__label {
        display: none;
    }

    .aigf-promo-bar__text {
        font-size: 11px;
    }

    #aigf-promo-bar {
        height: 38px;
        padding-right: 36px;
    }

    .aigf-promo-bar__cta {
        padding: 3px 10px;
        font-size: 10px;
    }

    .aigf-promo-bar__highlight {
        padding: 1px 6px;
        font-size: 10px;
    }
}

/* ======================================================================
   PRICING CARD — DISCOUNT BADGE  (top-corner ribbon)
   ====================================================================== */

.aigf-pricing-card {
    position: relative; /* ensure badge stacks correctly */
}

.aigf-discount-badge {
    position: absolute;
    top: 0;
    right: 18px;
    z-index: 8;
    background: linear-gradient(135deg, #FF4F87 0%, #C77DFF 100%);
    color: #fff;
    border-radius: 0 0 10px 10px;
    padding: 5px 11px 7px;
    box-shadow: 0 0 12px rgba(199, 125, 255, 0.6), 0 4px 14px rgba(255, 79, 135, 0.35);
    pointer-events: none;
}

/* Popular badge already occupies top-right, move discount badge to top-left */
.aigf-pricing-card.popular .aigf-discount-badge {
    right: auto;
    left: 18px;
}

.aigf-discount-pct {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ======================================================================
   PRICING CARD — STRIKETHROUGH "ORIGINAL" PRICE
   ====================================================================== */

.aigf-price-original {
    display: flex;
    align-items: baseline;
    gap: 3px;
    margin-bottom: 2px;
    display: none;
}

.aigf-price-was {
    font-size: 11px;
    color: var(--muted, #b9b4d9);
    font-weight: 400;
}

.aigf-price-strike {
    font-size: 14px;
    color: var(--muted, #b9b4d9);
    font-weight: 500;
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.65);
}

/* ======================================================================
   PRICING CARD — IN-CARD COUNTDOWN TIMER
   ====================================================================== */

.aigf-card-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #F97316;
    border: 1px solid rgba(249, 115, 22, 0.30);
    border-radius: 12px;
    transition: background 0.4s ease, border-color 0.4s ease;
    flex-direction: row;
    justify-content: space-between;
}

.aigf-card-timer__label {
    color: #FFF;
    flex: 0;
    white-space: nowrap;
    transition: color 0.4s ease;
    font-size: 14px;
    font-weight: 900;
}

.aigf-card-timer__countdown {
    display: inline-flex;
    align-items: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    background: #F97316;
    border-radius: 4px;
    padding: 2px 6px;
    transition: color 0.4s ease, background 0.4s ease;
}

.aigf-card-timer__unit {
    min-width: 22px;
    text-align: center;
}

.aigf-card-timer__colon {
    padding: 0 1px;
    opacity: 0.8;
    color: #FFFFFF;
}

/* Warning state (≤6h): deeper orange */
.aigf-card-timer--warn {
    background: rgba(249, 115, 22, 0.14);
    border-color: rgba(249, 115, 22, 0.35);
}

.aigf-card-timer--warn .aigf-card-timer__label {
    color: #EA580C;
}

.aigf-card-timer--warn .aigf-card-timer__countdown {
    background: #EA580C;
    color: #FFFFFF;
}

/* Urgent state (≤1h): red/pink + border pulse */
.aigf-card-timer--urgent {
    background: rgba(255, 79, 135, 0.10);
    border-color: rgba(255, 79, 135, 0.30);
    animation: aigf-timer-urgent-pulse 0.9s ease-in-out infinite;
}

.aigf-card-timer--urgent .aigf-card-timer__label {
    color: #FF4F87;
}

.aigf-card-timer--urgent .aigf-card-timer__countdown {
    background: #FF4F87;
    color: #FFFFFF;
}

/* Cooldown state (offer expired, next cycle pending) */
.aigf-card-timer--cooldown {
    background: rgba(249, 115, 22, 0.10);
    border-color: rgba(249, 115, 22, 0.30);
    animation: none;
}

.aigf-card-timer--cooldown .aigf-card-timer__label {
    color: #F97316;
}

.aigf-card-timer--cooldown .aigf-card-timer__countdown {
    background: #F97316;
    color: #FFFFFF;
}

/* ======================================================================
   GIRLFRIEND DISCOVER CARDS
   ====================================================================== */

.aigf-gf-card {
    position: relative; /* ensure badge positions correctly */
}

/* Discount badge — inline with girlfriend name */
.aigf-gf-discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #FF4F87 0%, #C77DFF 100%);
    color: #fff;
    border-radius: 6px;
    padding: 2px 7px;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 0 12px rgba(199, 125, 255, 0.6), 0 2px 8px rgba(255, 79, 135, 0.35);
    font-size: 10px;
}

.aigf-gf-discount-badge__icon {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    color: #fde68a;
}

.aigf-gf-discount-pct {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Starting soon state - enhanced visibility */
.aigf-gf-card--starting-soon {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08) 0%, rgba(255, 79, 135, 0.08) 100%);
    border: 2px solid #F97316;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4), 0 4px 16px rgba(255, 79, 135, 0.25);
}

.aigf-gf-card--starting-soon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #F97316, #FF4F87);
    opacity: 0;
    animation: aigf-starting-soon-pulse 2s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes aigf-starting-soon-pulse {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.3; }
}

/* Per-card countdown timer — top-right overlay */
.aigf-gf-card-timer {
    position: absolute;
    top: var(--spacing-sm, 8px);
    right: var(--spacing-sm, 8px);
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgb(255 246 246 / 20%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 8px;
    padding: 8px 10px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.aigf-gf-card-timer__label {
    font-size: 12px;
    font-weight: 800;
    color: #F97316;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.4s ease;
}

.aigf-gf-card-timer__time {
    display: inline-flex;
    align-items: center;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: 13px;
    color: #FFFFFF;
    background: #F97316;
    border-radius: 4px;
    padding: 1px 5px;
    transition: color 0.4s ease, background 0.4s ease;
}

.aigf-gf-card-timer__unit {
    min-width: 18px;
    text-align: center;
}

.aigf-gf-card-timer__colon {
    padding: 0 1px;
    opacity: 0.85;
    color: #FFFFFF;
}

/* Warning state (≤6h): deeper orange */
.aigf-gf-card-timer--warn .aigf-gf-card-timer__label {
    color: #EA580C;
}

.aigf-gf-card-timer--warn .aigf-gf-card-timer__time {
    background: #EA580C;
    color: #FFFFFF;
}

/* Urgent state (≤1h): red/pink + border pulse */
.aigf-gf-card-timer--urgent .aigf-gf-card-timer__label {
    color: #FF4F87;
}

.aigf-gf-card-timer--urgent .aigf-gf-card-timer__time {
    background: #FF4F87;
    color: #FFFFFF;
}

.aigf-gf-card-timer--urgent {
    animation: aigf-timer-urgent-pulse 0.9s ease-in-out infinite;
}

/* Cooldown state (offer expired, next cycle pending) */
.aigf-gf-card-timer--cooldown .aigf-gf-card-timer__label {
    color: #F97316;
}

.aigf-gf-card-timer--cooldown .aigf-gf-card-timer__time {
    background: #F97316;
    color: #FFFFFF;
}

.aigf-gf-card-timer--cooldown {
    animation: none;
}

@keyframes aigf-timer-urgent-pulse {
    0%, 100% { border-color: rgba(255, 79, 135, 0.15); }
    50%       { border-color: rgba(255, 79, 135, 0.6);  box-shadow: 0 0 8px rgba(255, 79, 135, 0.4); }
}

/* ======================================================================
   PORTRAIT WALL CARDS  (home.php Tinder-style swipe carousel)
   ====================================================================== */

/* Badge displayed inline with portrait name */
.aigf-portrait-discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #FF4F87 0%, #C77DFF 100%);
    color: #fff;
    border-radius: 6px;
    padding: 2px 6px;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 0 12px rgba(199, 125, 255, 0.6), 0 2px 8px rgba(255, 79, 135, 0.35);
    pointer-events: none;
    vertical-align: middle;
}

.aigf-portrait-discount-badge__icon {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    color: #fde68a;
}

.aigf-portrait-discount-pct {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* Per-card countdown timer — positioned at top-right */
.aigf-portrait-card-timer {
    position: absolute;
    top: var(--spacing-sm, 8px);
    right: var(--spacing-sm, 8px);
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #F97316;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 5px 10px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transition: opacity 0.4s ease;
    color: #FFF;
}

.portrait.active .aigf-portrait-card-timer {
    opacity: 1;
}

/* Timer label — matches GF card timer label styling */
.aigf-portrait-card-timer__label {
    font-size: 14px;
    font-weight: var(--font-semibold, 600);
    color: #fff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.4s ease;
}

.aigf-portrait-card-timer__time {
    display: inline-flex;
    align-items: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    transition: color 0.4s ease;
}

.aigf-portrait-card-timer__unit {
    min-width: 16px;
    text-align: center;
}

.aigf-portrait-card-timer__colon {
    padding: 0 1px;
    opacity: 0.7;
}

/* Warning state (≤6h): orange */
.aigf-portrait-card-timer--warn .aigf-portrait-card-timer__label,
.aigf-portrait-card-timer--warn .aigf-portrait-card-timer__time {
    color: v#fff;
}

/* Urgent state (≤1h): red/pink + border pulse */
.aigf-portrait-card-timer--urgent .aigf-portrait-card-timer__label,
.aigf-portrait-card-timer--urgent .aigf-portrait-card-timer__time {
    color: #FF4F87;
}

.aigf-portrait-card-timer--urgent {
    animation: aigf-timer-urgent-pulse 0.9s ease-in-out infinite;
}

/* Cooldown state (offer expired, next cycle pending) */
.aigf-portrait-card-timer--cooldown .aigf-portrait-card-timer__label,
.aigf-portrait-card-timer--cooldown .aigf-portrait-card-timer__time {
    color: var(--muted, #B9B4D9);
}

.aigf-portrait-card-timer--cooldown {
    animation: none;
}

/* ======================================================================
   MODEL SLIDER CARDS  (home.php horizontal strip — "Meet Your Girlfriend")
   ====================================================================== */

.model-card {
    position: relative; /* ensure badge stacks */
}

.aigf-model-discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: linear-gradient(135deg, #FF4F87 0%, #C77DFF 100%);
    color: #fff;
    border-radius: 10px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(199, 125, 255, 0.6);
}

/* ======================================================================
   PULSE ANIMATION  (subtle urgency on all discount badges)
   ====================================================================== */

@keyframes aigf-discount-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(199, 125, 255, 0.35); }
    50%       { box-shadow: 0 0 18px rgba(199, 125, 255, 0.75), 0 0 8px rgba(255, 79, 135, 0.45); }
}

.aigf-discount-badge,
.aigf-gf-discount-badge,
.aigf-portrait-discount-badge,
.aigf-model-discount-badge {
    animation: aigf-discount-pulse 2.6s ease-in-out infinite;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .aigf-discount-badge,
    .aigf-gf-discount-badge,
    .aigf-portrait-discount-badge,
    .aigf-model-discount-badge {
        animation: none;
    }

    .aigf-card-timer--urgent,
    .aigf-gf-card-timer--urgent,
    .aigf-portrait-card-timer--urgent {
        animation: none;
    }

    #aigf-promo-bar {
        transition: none;
    }
}

/* ======================================================================
   SUBSCRIPTION-AWARE STATES
   ====================================================================== */

/* Plan card: "Included in your plan" / "Your plan exceeds this offer" label */
.aigf-plan-sub-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(109, 40, 217, 0.12);
    color: var(--primary, #9b5de5);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
    display: none;
}

/* GF card: "Upgrade to unlock more" label */
.aigf-gf-limit-label {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(30, 30, 40, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--primary, #c77dff);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 8px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ======================================================================
   CHECKOUT — DISCOUNT FLOW DISPLAY
   Repurposes the existing #summary-discount-message-row (.discount-note.premium)
   when entering checkout from a girlfriend card (ready_girlfriend flow).
   Scope-isolated: only renders when from_discover=1 is present in the URL.
   ====================================================================== */

/* Fire icon inside the discount-note — red for urgency */
.aigf-checkout-disc-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #FF4F87;
    filter: drop-shadow(0 0 8px rgba(255, 79, 135, 0.7));
}

/* Strikethrough "was" price */
.aigf-checkout-orig-price .aigf-price-strike {
    text-decoration: line-through;
    text-decoration-color: rgba(255, 79, 135, 0.6);
    opacity: 0.7;
}

/* Timer wrap inside discount-sub */
.aigf-checkout-timer-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.aigf-checkout-timer {
    display: inline-flex;
    align-items: center;
}

.aigf-checkout-timer__label {
    font-size: 13px;
    font-weight: var(--font-bold, 700);
    color: #F97316;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.4s ease;
}

.aigf-checkout-timer__time {
    display: inline-flex;
    align-items: center;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 15px;
    color: #FFFFFF;
    background: #F97316;
    border-radius: 4px;
    padding: 3px 8px;
    transition: color 0.4s ease, background 0.4s ease;
}

.aigf-checkout-timer__unit {
    min-width: 22px;
    text-align: center;
}

.aigf-checkout-timer__colon {
    padding: 0 1px;
    opacity: 0.85;
    color: #FFFFFF;
}

/* Timer urgency states (reuse same thresholds as card timers) */
.aigf-checkout-timer--warn .aigf-checkout-timer__time {
    background: #EA580C;
    color: #FFFFFF;
}

.aigf-checkout-timer-wrap--warn .aigf-checkout-timer__label {
    color: #EA580C;
}

.aigf-checkout-timer--urgent .aigf-checkout-timer__time {
    background: #FF4F87;
    color: #FFFFFF;
}

.aigf-checkout-timer-wrap--urgent .aigf-checkout-timer__label {
    color: #FF4F87;
}

.aigf-checkout-timer--urgent {
    animation: aigf-timer-urgent-pulse 0.9s ease-in-out infinite;
}

.aigf-checkout-timer--cooldown {
    display: none;
}

/* Strikethrough fake-original in the total price row */
.aigf-total-strike {
    text-decoration: line-through;
    text-decoration-color: rgba(255, 79, 135, 0.6);
    color: var(--muted, #B9B4D9);
    font-size: 0.95rem;
    font-weight: 500;
    margin-right: 6px;
    opacity: 0.7;
}

.aigf-total-amount {
    color: var(--primary, #9B5DE5);
    font-size: 1.2rem;
    font-weight: 700;
}
