/* =============================================================
   AltDeliver – Front-End Layout & Animations (frontend.css)
   ============================================================= */

/* ── Page layout ─────────────────────────────────────────────── */
.page-wrap {
    position: relative;
    /* NO z-index here — an explicit z-index creates a stacking context
       that traps Bootstrap modal z-indexes inside it */
    flex: 1;
}


/* ══════════════════════════════════════════════════════════════
   HERO SECTION + SLIDESHOW
   ══════════════════════════════════════════════════════════════ */
.hero-section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 80px 0 0;
}

.hero-slideshow {
    width: 100%;
    position: relative;
    padding-bottom: 60px;
    /* room for dots */
}

/* Slide base */
.hero-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 60px 40px 24px;
    animation: slideFadeIn 0.65s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.hero-slide.active {
    display: flex;
}

@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero text block */
.hero-text-block {
    text-align: center;
    margin-bottom: 36px;
    max-width: 820px;
}

.hero-headline {
    font-size: clamp(2.4rem, 5.5vw, 4.6rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
}

.hero-sub {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    color: rgba(210, 222, 240, 0.90);
    max-width: var(--content-max-width);
    margin: 0 auto 12px;
    line-height: 1.75;
    text-shadow:
        0 0 28px rgba(4, 10, 22, 0.95),
        0 0 12px rgba(4, 10, 22, 0.85),
        0 2px 6px rgba(4, 10, 22, 0.75);
    margin-bottom: 12px !important;
}

.hero-scale-label {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(180, 195, 220, 0.80);
    margin-bottom: 16px;
    text-shadow:
        0 0 20px rgba(4, 10, 22, 0.95),
        0 0 8px rgba(4, 10, 22, 0.85);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Network SVG diagram ─────────────────────────────────────── */
.network-diagram-wrap {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.network-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* ── Slide 2: DSP grid ───────────────────────────────────────── */
.slide2-dsp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 10px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.slide2-dsp-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px 12px;
    border-radius: 12px;
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    cursor: default;
    transition: all 0.25s;
    animation: tilePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    opacity: 0;
}

.hero-slide.active .slide2-dsp-tile {
    opacity: 1;
}

@keyframes tilePop {
    from {
        opacity: 0;
        transform: scale(0.80);
    }

    to {
        opacity: 1;
        transform: scale(1.00);
    }
}

.slide2-dsp-tile:hover {
    background: var(--surface-hover);
    border-color: var(--glass-border-hi);
    transform: translateY(-3px);
}

.slide2-dsp-tile img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
}

.slide2-dsp-tile span {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted-glass);
    text-align: center;
    line-height: 1.3;
}

.slide2-dsp-tile:hover span {
    color: var(--text-primary);
}

.slide2-more {
    background: var(--surface-subtle) !important;
    border-style: dashed;
}

.slide2-more span {
    color: var(--text-muted-glass);
    opacity: 0.55;
}

.more-count {
    font-family: var(--font-display) !important;
    font-size: 1.4rem !important;
    font-weight: 800 !important;
    color: var(--text-muted-glass) !important;
    opacity: 0.7;
}

/* ── Slide 3: cert features ──────────────────────────────────── */
.slide3-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

.slide3-feat-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-card);
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    transition: all 0.25s;
}

.slide3-feat-card:hover {
    background: var(--surface-hover);
    border-color: var(--glass-border-hi);
    transform: translateY(-2px);
}

.slide3-feat-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.slide3-feat-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.slide3-feat-desc {
    font-size: 12.5px;
    color: var(--text-muted-glass);
    line-height: 1.6;
}

/* ── Slide dot indicators ────────────────────────────────────── */
.slide-dots {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
}

.slide-dot {
    width: 28px;
    height: 4px;
    border-radius: 2px;
    border: none;
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
    padding: 0;
    transition: background 0.30s, width 0.30s;
}

.slide-dot.active {
    background: var(--cyan);
    width: 44px;
    box-shadow: 0 0 8px var(--cyan);
}

:root[data-theme="light"] .slide-dot {
    background: rgba(0, 20, 60, 0.18);
}

:root[data-theme="light"] .slide-dot.active {
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD SECTION
   ══════════════════════════════════════════════════════════════ */
.dashboard-section {
    padding: 60px 40px 100px;
    position: relative;
}

.dashboard-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.dashboard-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 700;
    text-align: center;
    color: var(--cyan);
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}

:root[data-theme="light"] .dashboard-title {
    color: var(--cyan);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    align-items: start;
}

/* ── Base dash card ──────────────────────────────────────────── */
.dash-card {
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color 0.25s, background 0.25s;
}

.dash-card:hover {
    border-color: var(--glass-border-hi);
    background: var(--surface-hover);
}

.dash-card-wide {
    padding-bottom: 28px;
}

.dash-card-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.dash-card-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-card-menu {
    background: transparent;
    border: none;
    color: var(--text-muted-glass);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.55;
    transition: opacity 0.20s;
}

.dash-card-menu:hover {
    opacity: 1;
}

/* Metrics row */
.dash-metrics-row {
    display: flex;
    gap: 32px;
    margin-bottom: 20px;
}

.dash-metric {
    flex: 1;
}

.dash-metric-label {
    font-size: 12px;
    color: var(--text-muted-glass);
    display: block;
    margin-bottom: 4px;
}

.dash-metric-value {
    font-family: var(--font-display);
    font-size: 2.0rem;
    font-weight: 800;
    color: var(--text-primary);
    display: block;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.dash-metric-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.dash-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-subtle);
    color: var(--text-muted-glass);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.20s;
}

.dash-icon-btn:hover {
    color: var(--text-primary);
    border-color: var(--glass-border-hi);
    background: var(--surface-hover);
}

/* Metadata health row */
.dash-metadata-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dash-metadata-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Sparkline bar chart */
.dash-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 52px;
    padding-top: 8px;
}

.spark-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(to top, rgba(6, 159, 214, 0.55), rgba(91, 138, 255, 0.45));
    min-height: 4px;
    animation: barGrow 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) both;
    transform-origin: bottom;
}

@keyframes barGrow {
    from {
        transform: scaleY(0);
        opacity: 0;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* DSP logo row */
.dash-dsp-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.dash-dsp-logo {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.20s, border-color 0.20s;
    animation: tilePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.dash-dsp-logo:hover {
    transform: scale(1.10);
    border-color: var(--glass-border-hi);
}

.dash-dsp-logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 4px;
}

.dash-dsp-logo--sm {
    width: 30px;
    height: 30px;
}

.dash-dsp-logo--sm img {
    width: 20px;
    height: 20px;
}

.dash-dsp-more {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted-glass);
    padding: 5px 8px;
    border-radius: 7px;
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
}

/* DDEX badge row */
.dash-ddex-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-ddex-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted-glass);
    transition: all 0.22s;
}

.dash-ddex-badge:hover {
    background: var(--surface-hover);
    border-color: var(--glass-border-hi);
    color: var(--text-primary);
}


/* ══════════════════════════════════════════════════════════════
   SIMPLE PAGE HERO (non-slideshow sub-pages)
   ══════════════════════════════════════════════════════════════ */
.page-hero {
    padding: 150px 40px 40px;
    text-align: center;
    position: relative;
}

.page-hero .section-label {
    display: block;
    margin-bottom: 16px;
}

.page-hero-headline {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 18px;
}

.page-hero .hero-sub {
    text-shadow: none;
    color: var(--text-muted-glass);
}

/* ══════════════════════════════════════════════════════════════
   FEATURES SECTION
   ══════════════════════════════════════════════════════════════ */
.features-section {
    padding: 80px 40px;
    position: relative;
}

.features-section .section-text {
    text-align: center;
    margin-bottom: 48px;
}

.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.feature-card {
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.28s;
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fc-accent, var(--cyan-dim)), transparent);
    opacity: 0;
    transition: opacity 0.28s;
}

.feature-card:hover {
    border-color: var(--glass-border-hi);
    background: var(--surface-hover);
    transform: translateY(-3px);
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 13.5px;
    color: var(--text-muted-glass);
    line-height: 1.7;
}

/* ══════════════════════════════════════════════════════════════
   CTA SECTION
   ══════════════════════════════════════════════════════════════ */
.cta-section {
    padding: 60px 40px 100px;
    position: relative;
}

.cta-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    text-align: center;
    padding: 56px 40px;
    border-radius: var(--radius-lg);
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: background 0.35s, border-color 0.35s;
}

.cta-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 110%, var(--green-dim) 0%, transparent 70%);
    pointer-events: none;
}

.cta-headline {
    font-size: clamp(1.7rem, 2.8vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 14px;
}

.cta-sub {
    font-size: 1rem;
    color: var(--text-muted-glass);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 32px;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}



/* ══════════════════════════════════════════════════════════════
   OFFCANVAS FORM
   ══════════════════════════════════════════════════════════════ */
.form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 48px 24px;
    gap: 18px;
}

.success-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--green-dim);
    border: 1px solid rgba(0, 212, 170, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--green);
}

.success-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
}

.success-sub {
    font-size: 13.5px;
    color: var(--text-muted-glass);
    max-width: 280px;
    line-height: 1.65;
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-slide {
        padding: 40px 20px 20px;
    }

    .dashboard-section,
    .features-section {
        padding: 60px 20px;
    }

    .cta-section {
        padding: 40px 20px 80px;
    }

    .cta-inner {
        padding: 36px 20px;
    }

    .site-footer {
        padding: 40px 20px 20px;
    }

    .footer-top {
        gap: 28px;
    }

    .network-diagram-wrap {
        padding: 0 8px;
    }

    .slide2-dsp-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .dash-metrics-row {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn-glow {
        justify-content: center;
    }

    .hero-stats {
        flex-direction: column;
    }

    .slide3-features {
        grid-template-columns: 1fr;
    }

    .footer-links-group {
        min-width: 0;
    }
}

/* ══════════════════════════════════════════════════════════════
   SLIDE 1 — DSP ORBIT VISUALIZATION
   ══════════════════════════════════════════════════════════════ */
.broadcast-viz {
    position: relative;
    width: min(480px, 100%);
    aspect-ratio: 1;
    margin: 0 auto;
    --bv-r: 196px;
}

/* Decorative rings */
.bv-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.bv-ring-1 {
    width: 150px;
    height: 150px;
    border: 1px solid rgba(6, 159, 214, 0.25);
}

.bv-ring-2 {
    width: 290px;
    height: 290px;
    border: 1px solid rgba(80, 90, 255, 0.18);
}

.bv-ring-3 {
    width: 430px;
    height: 430px;
    border: 1px solid rgba(140, 60, 240, 0.14);
}

/* Sonar pulses emanating from center */
.bv-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1.5px solid rgba(6, 159, 214, 0.55);
    transform: translate(-50%, -50%) scale(0.1);
    animation: bvPulse 3s ease-out infinite;
    pointer-events: none;
}

@keyframes bvPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(5.8);
        opacity: 0;
    }
}

/* Orbiting container */
.bv-orbit {
    position: absolute;
    inset: 0;
    animation: bvOrbit 36s linear infinite;
}

@keyframes bvOrbit {
    to {
        transform: rotate(360deg);
    }
}

/* Each DSP position */
.bv-dsp-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px;
    transform: rotate(var(--a, 0deg)) translateX(var(--bv-r, 196px)) rotate(calc(-1 * var(--a, 0deg)));
}

/* Logo bubble */
.bv-dsp-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    animation: bvCounter 36s linear infinite;
    transition: background 0.3s, border-color 0.3s;
}

.bv-dsp-logo:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
}

.bv-dsp-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

@keyframes bvCounter {
    to {
        transform: rotate(-360deg);
    }
}

/* Center hub */
.bv-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 112px;
    height: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    z-index: 10;
}

.bv-hub-live {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-display);
    font-size: 8px;
    font-weight: 700;
    color: #00e060;
    letter-spacing: 1.2px;
    margin-bottom: 1px;
}

.bv-live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00e060;
    flex-shrink: 0;
    animation: bvDotPulse 1.4s ease-in-out infinite;
}

@keyframes bvDotPulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 224, 96, 0.5);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 4px rgba(0, 224, 96, 0);
    }
}

.bv-hub-name {
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    color: #e0d8ff;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.bv-hub-sub {
    font-family: var(--font-body);
    font-size: 9.5px;
    color: rgba(180, 168, 255, 0.62);
    letter-spacing: 0.5px;
}

/* Light mode */
[data-theme="light"] .bv-hub-name {
    color: #1c18a0;
}

[data-theme="light"] .bv-hub-sub {
    color: rgba(50, 40, 180, 0.58);
}

[data-theme="light"] .bv-dsp-logo {
    background: rgba(20, 0, 80, 0.05);
    border-color: rgba(20, 0, 80, 0.14);
}

[data-theme="light"] .bv-ring-1 {
    border-color: rgba(6, 159, 214, 0.30);
}

[data-theme="light"] .bv-ring-2 {
    border-color: rgba(60, 60, 220, 0.20);
}

[data-theme="light"] .bv-ring-3 {
    border-color: rgba(100, 40, 200, 0.15);
}

[data-theme="light"] .bv-pulse {
    border-color: rgba(6, 159, 214, 0.50);
}

/* Responsive */
@media (max-width: 600px) {
    .broadcast-viz {
        --bv-r: 130px;
        max-width: 320px;
    }

    .bv-ring-3 {
        display: none;
    }

    .bv-dsp-item {
        width: 38px;
        height: 38px;
        margin: -19px;
    }

    .bv-dsp-logo {
        width: 38px;
        height: 38px;
    }

    .bv-dsp-logo img {
        width: 26px;
        height: 26px;
    }

    .bv-hub {
        width: 88px;
        height: 88px;
        border-radius: 20px;
    }

    .bv-hub-name {
        font-size: 10px;
    }
}