/* ── Van Trip Counter / Odometer Widget ── */
/* Extracted from cc.landing.page.proposal.static.html */
/* Corporate CI Colors: primary_blue #017de9, primary_bg #1f2937, primary_black #000321 */

/* Animated pulse for LIVE badge */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.live-dot { animation: pulse-dot 1.8s ease-in-out infinite; }

/* LIVE badge container */
.live-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid #22c55e;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
}
.live-badge-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 9999px;
    background: #22c55e;
    flex-shrink: 0;
}
.live-badge-text {
    color: #22c55e;
    font-size: 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Main panel container */
.binnacle-panel {
    background: #111827;
    border: 1px solid #565a7c;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(17,24,39,0.45),
        0 25px 60px -15px rgba(0,3,33,0.88),
        inset 0 1px 0 rgba(255,255,255,0.03);
}

/* Top bar with title and LIVE badge */
.binnacle-topbar {
    background: linear-gradient(180deg, #1f2937 0%, #1a202c 100%);
    border-bottom: 1px solid #565a7c;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}
.binnacle-topbar-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #8893a8;
}

/* Instrument cluster layout */
.instrument-cluster {
    padding: 2rem 2rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 1.5rem;
    align-items: center;
}
.cluster-divider {
    height: 5rem;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, #017de9 50%, transparent 100%);
    align-self: center;
}

/* Odometer unit labels */
.odometer-unit { text-align: center; }
.odometer-label-top {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #d1d5db;
    margin-bottom: 0.65rem;
}
.odometer-label-bottom {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #ffffff;
    margin-top: 0.65rem;
}

/* Display housing */
.odometer-display {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    background: #000321;
    border: 1px solid #565a7c;
    border-radius: 0.35rem;
    padding: 0.4rem 0.65rem;
    box-shadow:
        inset 0 3px 10px rgba(0,3,33,0.92),
        inset 0 1px 3px rgba(0,3,33,0.55),
        0 0 30px rgba(1,125,233,0.1);
    position: relative;
}

/* Scanline overlay on display */
.odometer-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,0.1) 3px,
        rgba(0,0,0,0.1) 4px
    );
    pointer-events: none;
    z-index: 10;
    border-radius: 0.35rem;
}

/* Digit clip window */
.digit-window {
    width: 2.1rem;
    height: 3.5rem;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

/* Fade mask: hides digits above/below the active slot */
.digit-window::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,3,33,1)   0%,
        rgba(0,3,33,0)  22%,
        rgba(0,3,33,0)  78%,
        rgba(0,3,33,1) 100%
    );
    pointer-events: none;
    z-index: 5;
}

/* Rolling digit reel */
.digit-reel {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    will-change: transform;
}
.digit-reel.roll {
    transition: transform 2s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Individual digit */
.digit-cell {
    width: 2.1rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    color: #017de9;
    text-shadow:
        0 0 12px rgba(1,125,233,0.8),
        0 0 28px rgba(1,125,233,0.3);
    line-height: 1;
    flex-shrink: 0;
}

/* Thousands comma separator */
.odo-comma {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #3b82f6;
    text-shadow: 0 0 8px rgba(1,125,233,0.3);
    align-self: flex-end;
    padding-bottom: 0.3rem;
    margin: 0 0.1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* Duration cluster with animated digits */
.duration-cluster {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.3rem;
}
.duration-segment {
    display: flex;
    align-items: flex-end;
    gap: 0.15rem;
}
.duration-segment .duration-digit {
    min-width: 2rem;
}
.duration-segment .duration-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #d1d5db;
    text-transform: lowercase;
    padding-bottom: 0.4rem;
}

/* Bottom live feed bar */
.binnacle-feed-bar {
    background: #1a202c;
    border-top: 1px solid #565a7c;
    padding: 0.55rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.binnacle-feed-bar .feed-icon {
    color: #8893a8;
    font-size: 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    flex-shrink: 0;
}
.binnacle-feed-bar .feed-ticker {
    flex: 1;
}
.binnacle-feed-bar .last-updated {
    color: #ffffff;
    font-size: 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    flex-shrink: 0;
    margin-left: auto;
    text-align: right;
}

/* Feed ticker */
.feed-ticker {
    overflow: hidden;
    height: 1.4rem;
    position: relative;
}
.feed-ticker-inner {
    display: flex;
    flex-direction: column;
    animation: feed-scroll 12s linear infinite;
}
.feed-ticker-inner span {
    height: 1.4rem;
    line-height: 1.4rem;
    white-space: nowrap;
    font-size: 0.7rem;
    color: #d1d5db;
    font-family: 'Courier New', Courier, monospace;
}
@keyframes feed-scroll {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Stack vertically on small screens */
@media (max-width: 580px) {
    .instrument-cluster {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }
    .cluster-divider {
        height: 1px;
        width: 5rem;
        margin: 0 auto;
        background: linear-gradient(90deg, transparent 0%, #017de9 50%, transparent 100%);
    }
    .digit-cell {
        width: 1.8rem;
        height: 3rem;
        font-size: 2.2rem;
    }
    .digit-window {
        width: 1.8rem;
        height: 3rem;
    }
    .odo-comma {
        font-size: 1.7rem;
        padding-bottom: 0.25rem;
    }
    /* Duration cluster mobile adjustments */
    .duration-cluster {
        gap: 0.2rem;
        justify-content: center;
    }
    .duration-segment .duration-label {
        font-size: 0.65rem;
        padding-bottom: 0.3rem;
    }
    .duration-segment .duration-digit {
        min-width: 1.6rem;
    }
    .duration-segment .duration-digit .digit-window {
        width: 1.6rem;
        height: 2.6rem;
    }
    .duration-segment .duration-digit .digit-cell {
        width: 1.6rem;
        height: 2.6rem;
        font-size: 1.9rem;
    }
    /* Feed bar stack vertically: ticker above last-updated */
    .binnacle-feed-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.35rem;
        padding: 0.5rem 1rem;
        overflow: hidden;
    }
    .binnacle-feed-bar .feed-icon {
        display: none !important;
    }
    .binnacle-feed-bar .feed-ticker {
        width: 100% !important;
        height: 1.2rem !important;
        max-height: 1.2rem !important;
        overflow: hidden !important;
    }
    .binnacle-feed-bar .feed-ticker-inner {
        display: flex !important;
        flex-direction: column !important;
    }
    .binnacle-feed-bar .feed-ticker-inner span {
        height: 1.2rem !important;
        line-height: 1.2rem !important;
        flex-shrink: 0 !important;
        font-size: 0.65rem !important;
    }
    .binnacle-feed-bar .last-updated {
        margin-left: 0 !important;
        text-align: right !important;
        font-size: 0.65rem !important;
    }
}

/* Extra small screens / mobile landscape */
@media (max-width: 400px) {
    .binnacle-topbar {
        padding: 0.5rem 0.75rem;
    }
    .binnacle-topbar-title {
        font-size: 0.55rem;
        letter-spacing: 0.2em;
    }
    .instrument-cluster {
        padding: 1rem 0.5rem;
        gap: 1rem;
    }
    .odometer-label-top {
        font-size: 0.5rem;
        margin-bottom: 0.4rem;
    }
    .odometer-label-bottom {
        font-size: 0.55rem;
        margin-top: 0.4rem;
    }
    .digit-cell {
        width: 1.5rem;
        height: 2.4rem;
        font-size: 1.75rem;
    }
    .digit-window {
        width: 1.5rem;
        height: 2.4rem;
    }
    .odo-comma {
        font-size: 1.4rem;
        padding-bottom: 0.2rem;
    }
    .odometer-display {
        padding: 0.3rem 0.4rem;
    }
    /* Duration cluster extra small */
    .duration-cluster {
        gap: 0.15rem;
    }
    .duration-segment {
        gap: 0.1rem;
    }
    .duration-segment .duration-label {
        font-size: 0.55rem;
        padding-bottom: 0.25rem;
    }
    .duration-segment .duration-digit {
        min-width: 1.3rem;
    }
    .duration-segment .duration-digit .digit-window {
        width: 1.3rem;
        height: 2.1rem;
    }
    .duration-segment .duration-digit .digit-cell {
        width: 1.3rem;
        height: 2.1rem;
        font-size: 1.5rem;
    }
    /* Feed bar adjustments */
    .binnacle-feed-bar {
        padding: 0.4rem 0.75rem;
        gap: 0.5rem;
    }
    .binnacle-feed-bar .feed-icon {
        display: none;
    }
    .binnacle-feed-bar .feed-ticker-inner span {
        font-size: 0.6rem;
    }
    .binnacle-feed-bar .last-updated {
        font-size: 0.6rem;
    }
}

/* Mobile landscape specific - short height screens */
@media (max-height: 500px) and (orientation: landscape) {
    .binnacle-panel {
        border-radius: 0.5rem;
    }
    .binnacle-topbar {
        padding: 0.35rem 0.75rem;
    }
    .binnacle-topbar-title {
        font-size: 0.5rem;
        margin-bottom: 0;
    }
    .live-badge {
        padding: 0.15rem 0.5rem;
    }
    .live-badge-dot {
        width: 0.3rem;
        height: 0.3rem;
    }
    .live-badge-text {
        font-size: 0.6rem;
    }
    .instrument-cluster {
        padding: 0.75rem 0.5rem;
        gap: 0.75rem;
    }
    .odometer-label-top {
        font-size: 0.45rem;
        margin-bottom: 0.25rem;
    }
    .odometer-label-bottom {
        font-size: 0.5rem;
        margin-top: 0.25rem;
    }
    .digit-cell {
        width: 1.3rem;
        height: 2rem;
        font-size: 1.4rem;
    }
    .digit-window {
        width: 1.3rem;
        height: 2rem;
    }
    .odo-comma {
        font-size: 1.1rem;
        padding-bottom: 0.15rem;
    }
    .odometer-display {
        padding: 0.2rem 0.3rem;
        border-radius: 0.25rem;
    }
    /* Duration cluster landscape */
    .duration-cluster {
        gap: 0.1rem;
    }
    .duration-segment {
        gap: 0.08rem;
    }
    .duration-segment .duration-label {
        font-size: 0.5rem;
        padding-bottom: 0.2rem;
    }
    .duration-segment .duration-digit {
        min-width: 1.1rem;
    }
    .duration-segment .duration-digit .digit-window {
        width: 1.1rem;
        height: 1.7rem;
    }
    .duration-segment .duration-digit .digit-cell {
        width: 1.1rem;
        height: 1.7rem;
        font-size: 1.2rem;
    }
    .binnacle-feed-bar {
        padding: 0.3rem 0.5rem;
        gap: 0.4rem;
    }
    .binnacle-feed-bar .feed-icon {
        display: none;
    }
    .feed-ticker {
        height: 1.1rem;
    }
    .feed-ticker-inner span {
        height: 1.1rem;
        line-height: 1.1rem;
        font-size: 0.55rem;
    }
    .binnacle-feed-bar .last-updated {
        font-size: 0.55rem;
    }
}

/* Hero replica: stack Trip A above Trip B throughout */
.hero-trip-counter-panel {
    transform-origin: top center;
    will-change: transform;
}

.hero-trip-counter .hero-instrument-cluster {
    grid-template-columns: 1fr;
    gap: 1.75rem;
}

.hero-trip-counter .hero-cluster-divider {
    display: none;
}

@media (min-width: 580px) and (max-width: 1136px) {
    .hero-visual-stage {
        width: min(100%, 72rem) !important;
        max-width: 72rem !important;
        aspect-ratio: auto !important;
    }

    .hero-trip-counter {
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
    }

    .hero-trip-counter-panel {
        transform: scale(clamp(0.85, calc((100vw - 580px) / 443px), 1));
    }
}

@media (min-width: 1137px) {
    .hero-visual-stage {
        max-width: 72rem;
        aspect-ratio: auto;
    }

    .hero-trip-counter-panel {
        transform: none;
    }
}
