/* ============================================================
   INTERACTIVE.CSS
   Hover effects, live data ticker, expandable sections
   Compatible with Adverteks dark theme & cyan/indigo palette
   ============================================================ */

/* ============================================================
   1. ENHANCED CARD HOVER EFFECTS
   Lift + glow on all card grids
   ============================================================ */

/* Ensure all cards have smooth transitions */
.feature-card,
.problem-card,
.metric-card,
.testimonial-card,
.geo-card,
.rtb-card,
.security-card,
.sec-item,
.cs-card,
.ai-opt-card,
.stats-banner-item,
.solution-col,
.how-rtb-step,
.pricing-card,
.pricing-card-gradient-border {
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

/* Green-accent cards (most of the page) */
.feature-card:hover,
.problem-card:hover,
.testimonial-card:hover,
.geo-card:hover,
.rtb-card:hover,
.security-card:hover,
.sec-item:hover,
.cs-card:hover {
    transform: translateY(-5px) scale(1.005);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45),
                0 0 0 1px rgba(0, 255, 136, 0.12),
                0 0 28px rgba(0, 255, 136, 0.06);
}

/* Metric cards: smaller lift */
.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
                0 0 32px rgba(0, 255, 136, 0.08),
                inset 0 0 32px rgba(0, 255, 136, 0.03);
}

/* Stats banner items */
.stats-banner-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* AI optimizer cards — indigo accent */
.ai-opt-card:hover {
    transform: translateY(-5px) scale(1.005);
    border-color: rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45),
                0 0 32px rgba(99, 102, 241, 0.1);
}

/* Solution columns */
.solution-col:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.solution-col.publishers:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45),
                0 0 36px rgba(59, 130, 246, 0.08);
}
.solution-col.advertisers:hover {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45),
                0 0 36px rgba(139, 92, 246, 0.08);
}

/* How-RTB steps — already have transform, add glow */
.how-rtb-step:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35),
                0 0 28px rgba(99, 102, 241, 0.08);
}

/* Pricing cards */
.pricing-card:hover,
.pricing-card-gradient-border:hover .pricing-card-inner {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

/* Marketplace auction rows — subtle row highlight */
.mp-auction-row {
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.mp-auction-row:hover {
    background: rgba(255, 255, 255, 0.03) !important;
    transform: translateX(2px);
}

/* Testimonial cards get a faint top-border glow on hover */
.testimonial-card:hover {
    background: rgba(255, 255, 255, 0.015);
}

/* FAQ items: highlight on hover */
.faq-item {
    transition: background 0.2s;
}
.faq-item:hover {
    background: rgba(0, 255, 136, 0.018);
    border-radius: 8px;
}

/* How-step icons: extra glow pulse on hover */
.how-step:hover .how-step-icon {
    animation: iconPulse 0.6s ease-out;
}
@keyframes iconPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
    40% { box-shadow: 0 0 0 12px rgba(0, 255, 136, 0.12); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* ============================================================
   2. LIVE DATA TICKER
   Horizontal scrolling bar below the fixed nav
   ============================================================ */

.live-ticker {
    position: fixed;
    top: 68px; /* matches nav height */
    left: 0;
    right: 0;
    z-index: 98;
    height: 32px;
    background: rgba(6, 6, 12, 0.97);
    border-bottom: 1px solid rgba(0, 255, 136, 0.12);
    display: flex;
    align-items: center;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.live-ticker-badge {
    flex-shrink: 0;
    padding: 0 0.85rem;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.1), rgba(0, 255, 136, 0.06));
    border-right: 1px solid rgba(0, 255, 136, 0.15);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #00ff88;
    white-space: nowrap;
}

.live-ticker-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.8);
    animation: tickerDotPulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes tickerDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.75); }
}

.live-ticker-scroll {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Fade edges */
.live-ticker-scroll::before,
.live-ticker-scroll::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}
.live-ticker-scroll::before {
    left: 0;
    background: linear-gradient(90deg, rgba(6, 6, 12, 0.97), transparent);
}
.live-ticker-scroll::after {
    right: 0;
    background: linear-gradient(-90deg, rgba(6, 6, 12, 0.97), transparent);
}

.live-ticker-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: tickerScroll 40s linear infinite;
}

.live-ticker-scroll:hover .live-ticker-track {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 1.1rem;
    white-space: nowrap;
}

.ticker-item-label {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.28);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

.ticker-item-val {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.72rem;
}

.ticker-item-val.green { color: #00ff88; }
.ticker-item-val.blue  { color: #00b4d8; }
.ticker-item-val.purple { color: #a78bfa; }
.ticker-item-val.orange { color: #fb923c; }
.ticker-item-val.teal  { color: #34d399; }

.ticker-sep {
    color: rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    padding: 0 0.1rem;
    user-select: none;
}

/* Adjust hero padding to account for fixed ticker (32px) stacked on fixed nav (68px) */
.hero-v2 {
    padding-top: calc(7rem + 32px) !important;
}

/* ============================================================
   3. EXPANDABLE / COLLAPSIBLE SECTIONS
   Smooth reveal for extra list items
   ============================================================ */

/* Generic expand toggle button */
.expand-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    padding: 0.5rem 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    letter-spacing: 0.2px;
}
.expand-toggle-btn:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.05);
}
.solution-col.publishers .expand-toggle-btn:hover {
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}
.solution-col.advertisers .expand-toggle-btn:hover {
    border-color: rgba(139, 92, 246, 0.4);
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.05);
}

.expand-toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-style: normal;
    line-height: 1;
}
.expand-toggle-btn.open .expand-toggle-icon {
    transform: rotate(180deg);
}

/* Collapsible solution features list — hide items 4+ */
.solution-features.collapsible .solution-feature {
    transition: max-height 0.4s ease, opacity 0.35s ease, margin 0.4s ease;
}
.solution-features.collapsible .solution-feature:nth-child(n+4) {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0 !important;
    pointer-events: none;
}
.solution-features.collapsible.expanded .solution-feature:nth-child(n+4) {
    max-height: 120px;
    opacity: 1;
    pointer-events: auto;
}

/* AI optimizer grid — collapsible extra cards */
.ai-opt-grid.collapsible .ai-opt-card {
    transition: max-height 0.45s ease, opacity 0.35s ease, margin 0.4s ease, transform 0.3s ease;
}
.ai-opt-grid.collapsible .ai-opt-card:nth-child(n+3) {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0 !important;
    pointer-events: none;
}
.ai-opt-grid.collapsible.expanded .ai-opt-card:nth-child(n+3) {
    max-height: 400px;
    opacity: 1;
    pointer-events: auto;
}

/* Center the AI grid expand button */
.ai-expand-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
}
.ai-expand-wrap .expand-toggle-btn {
    max-width: 260px;
    border-color: rgba(99, 102, 241, 0.25);
    color: #818cf8;
}
.ai-expand-wrap .expand-toggle-btn:hover {
    border-color: rgba(99, 102, 241, 0.5);
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.06);
}

/* Expandable sections for "How It Works" - details reveal */
.how-rtb-step .step-extra {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    margin-top: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
}
.how-rtb-step.expanded .step-extra {
    max-height: 200px;
    opacity: 1;
    margin-top: 0.75rem;
}

.step-expand-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.85rem;
    font-size: 0.72rem;
    color: rgba(99, 102, 241, 0.7);
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}
.step-expand-hint:hover { color: #818cf8; }
.step-expand-hint-icon {
    display: inline-block;
    transition: transform 0.3s;
    font-style: normal;
}
.how-rtb-step.expanded .step-expand-hint-icon {
    transform: rotate(180deg);
}
.how-rtb-step.expanded .step-expand-hint-text::after {
    content: 'Show less';
}
.how-rtb-step:not(.expanded) .step-expand-hint-text::after {
    content: 'Read more';
}
.step-expand-hint-text::after {
    content: 'Read more';
}

/* ============================================================
   4. REDUCED MOTION
   Respect user preferences
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .live-ticker-track { animation: none !important; }
    .live-ticker-dot   { animation: none !important; }

    .feature-card:hover,
    .problem-card:hover,
    .metric-card:hover,
    .testimonial-card:hover,
    .geo-card:hover,
    .rtb-card:hover,
    .security-card:hover,
    .sec-item:hover,
    .cs-card:hover,
    .ai-opt-card:hover,
    .stats-banner-item:hover,
    .solution-col:hover,
    .solution-col.publishers:hover,
    .solution-col.advertisers:hover,
    .how-rtb-step:hover,
    .pricing-card:hover,
    .pricing-card-gradient-border:hover,
    .mp-auction-row:hover {
        transform: none !important;
    }

    .expand-toggle-icon { transition: none !important; }
    .solution-features.collapsible .solution-feature,
    .ai-opt-grid.collapsible .ai-opt-card,
    .how-rtb-step .step-extra {
        transition: none !important;
    }
}

/* ============================================================
   5. MOBILE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
    .live-ticker {
        top: 58px; /* mobile nav is shorter */
    }
    .hero-v2 {
        padding-top: calc(6rem + 32px) !important;
    }
    .live-ticker-badge {
        padding: 0 0.6rem;
        font-size: 0.55rem;
    }
    .ticker-item {
        padding: 0 0.75rem;
    }
    .ticker-item-label {
        display: none; /* hide labels on small screens, just show values */
    }
}

@media (max-width: 480px) {
    .live-ticker { height: 28px; top: 58px; }
    .ticker-item-val { font-size: 0.68rem; }
}
