/* ============================================
   Voyage Visualization - Leaflet real map + OrbitMI dashboard
   Navy + cyan + pink/magenta (matches product feel)
   ============================================ */

.voyage-viz {
    padding: var(--space-24) 0;
    background: var(--color-deep);
    font-family: var(--font-body, 'Geist'), -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--color-white);
    position: relative;
    overflow: hidden;
}

.voyage-viz::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(0, 180, 216, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(0, 180, 216, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.voyage-viz__header {
    text-align: center;
    margin-bottom: var(--space-12);
    position: relative;
    z-index: 1;
}

.voyage-viz__eyebrow {
    font-family: var(--font-mono, 'IBM Plex Mono'), 'Consolas', monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: var(--space-3);
    text-transform: uppercase;
}

.voyage-viz__title {
    font-family: var(--font-display, 'Fraunces'), Georgia, serif;
    font-size: var(--font-size-5xl);
    font-weight: 600;
    color: var(--color-white);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
    font-variation-settings: "opsz" 144, "SOFT" 30;
}

.voyage-viz__subtitle {
    font-size: var(--font-size-lg);
    color: var(--color-gray-300);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.5;
}

/* --- Scene Header (above wrapper, changes per carousel entry) --- */
.voyage-viz__scene {
    max-width: 1280px;
    margin: 0 auto var(--space-6);
    padding: var(--space-5) var(--space-6);
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 180, 216, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-6);
    position: relative;
    z-index: 2;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.voyage-viz__scene::before {
    content: '';
    display: block;
    width: 4px;
    align-self: stretch;
    background: linear-gradient(180deg, var(--color-accent), var(--color-amber, #E55934));
    border-radius: 2px;
    flex-shrink: 0;
}

.voyage-viz__scene.is-switching {
    opacity: 0;
    transform: translateY(-6px);
}

.voyage-viz__scene-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: -0.01em;
    line-height: 1.2;
    flex-shrink: 0;
}

.voyage-viz__scene-tagline {
    font-size: 13px;
    color: var(--color-gray-400);
    line-height: 1.4;
    flex: 1;
}

@media (max-width: 768px) {
    .voyage-viz__scene {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    .voyage-viz__scene::before {
        width: 100%;
        height: 3px;
        align-self: auto;
    }
    .voyage-viz__scene-title {
        font-size: 18px;
    }
}

.voyage-viz__wrapper {
    /* Slightly raised tone vs the section background for visible card edge */
    background: var(--color-deep-2);
    border: 1px solid rgba(0, 180, 216, 0.18);
    border-radius: var(--radius-xl);
    aspect-ratio: 16 / 9;
    max-width: 1280px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 180, 216, 0.08);
}

.voyage-viz__grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    width: 100%;
    height: 100%;
}

/* --- Curtain transition between scenes --- */
/* z-index above highlights (2000) so it covers everything during swap */
.voyage-viz__wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 3000;
}

.voyage-viz__wrapper.is-curtain::after {
    opacity: 1;
}

/* --- LEFT: Leaflet map --- */
.voyage-viz__map {
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    background: #0a1828;
}

.voyage-viz__map-leaflet {
    width: 100%;
    height: 100%;
    background: #0a1828;
}

/* Leaflet overrides */
.voyage-viz__map-leaflet .leaflet-container {
    background: #0a1828 !important;
    font-family: 'Inter', sans-serif;
}

.voyage-viz__map-leaflet .leaflet-control-attribution {
    background: rgba(10, 37, 64, 0.8);
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 0;
}

.voyage-viz__map-leaflet .leaflet-control-attribution a {
    color: rgba(0, 180, 216, 0.8);
}

/* Slight darken filter on tiles to blend with navy theme */
.voyage-viz__map-leaflet .leaflet-tile {
    filter: saturate(0.9) brightness(0.85) contrast(1.05);
}

/* Port label bubbles */
.voyage-viz__port-label {
    background: transparent;
    border: none;
    pointer-events: none;
}

.voyage-viz__port-label span {
    display: inline-block;
    background: rgba(10, 37, 64, 0.9);
    color: var(--color-white);
    padding: 2px 6px;
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.06em;
    border: 1px solid var(--color-accent);
    white-space: nowrap;
    border-radius: 2px;
}

/* Ship marker */
.voyage-viz__ship {
    position: relative;
    overflow: visible !important;
}

.voyage-viz__ship-ping {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    border: 2px solid #FF1F8A;
    opacity: 0;
    animation: ship-ping 1.6s ease-out infinite;
    pointer-events: none;
}

@keyframes ship-ping {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(4.5); opacity: 0; }
}

.voyage-viz__ship-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -12px 0 0 -12px;
    transform-origin: center;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 4px rgba(255, 31, 138, 0.6));
}

/* Map label (top-left overlay) */
.voyage-viz__map-label {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 10px 14px;
    background: rgba(10, 37, 64, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: var(--radius-md);
    z-index: 500;
    pointer-events: none;
}

.voyage-viz__map-eyebrow {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: #FF1F8A;
    font-weight: 500;
}

.voyage-viz__map-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-white);
    margin-top: 3px;
    letter-spacing: -0.01em;
}

/* --- RIGHT: Dashboard --- */
.voyage-viz__dashboard {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    background: var(--color-deep);   /* darker than wrapper for clear contrast */
    color: var(--color-white);
    border-left: 1px solid rgba(0, 180, 216, 0.12);
}

.vv-eyebrow {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 10px;
    letter-spacing: 0.16em;
    color: var(--color-gray-400);
    font-weight: 500;
    text-transform: uppercase;
}

.vv-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 3px;
    color: var(--color-white);
}

.vv-meta {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 11px;
    color: var(--color-gray-400);
    margin-top: 3px;
}

/* Progress bar */
.vv-progress-row {
    display: flex;
    justify-content: space-between;
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 10px;
    color: var(--color-gray-400);
    margin-bottom: 5px;
    letter-spacing: 0.08em;
}

.vv-progress-row span:last-child {
    color: var(--color-accent);
    font-weight: 600;
}

.vv-progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

.vv-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-amber, #E55934));
    transition: width 0.1s linear;
    border-radius: 3px;
}

/* KPI grid */
.vv-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(0, 180, 216, 0.18);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-deep-3);  /* lighter than dashboard for depth */
}

.vv-kpi {
    padding: 12px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.vv-kpi--r { border-right: none; }
.vv-kpi--t { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.vv-kpi--rt {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: none;
}

.vv-kpi-label {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--color-gray-400);
    font-weight: 500;
    margin-bottom: 2px;
}

.vv-kpi-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-white);
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.vv-kpi-value--accent {
    color: var(--color-amber, #E55934);
}

.vv-kpi-unit {
    font-size: 10px;
    font-weight: 400;
    color: var(--color-gray-400);
    letter-spacing: 0;
}

/* Tables */
.vv-table {
    border: 1px solid rgba(0, 180, 216, 0.18);
    border-radius: var(--radius-md);
    font-family: var(--font-mono, 'IBM Plex Mono'), 'Consolas', monospace;
    overflow: hidden;
    background: var(--color-deep-3);  /* depth tier 3, lighter than dashboard bg */
}

.vv-table-header {
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--color-accent);
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    background: rgba(0, 180, 216, 0.05);
}

.vv-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 12px;
    font-size: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.vv-row:last-child {
    border-bottom: none;
}

.vv-row > span:first-child {
    color: var(--color-gray-400);
}

.vv-row > span:last-child {
    color: var(--color-white);
    font-variant-numeric: tabular-nums;
}

.vv-row--emph > span:last-child {
    color: var(--color-amber, #E55934);
    font-weight: 600;
}

.vv-unit {
    color: var(--color-gray-400);
    margin-left: 3px;
}

.vv-footer {
    margin-top: auto;
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--color-gray-500);
    font-weight: 500;
}

/* ============================================
   Highlights Card (post-voyage summary)
   ============================================ */

.voyage-viz__highlights {
    /* Sibling of .voyage-viz__grid inside .voyage-viz__wrapper (position:relative) */
    /* z-index must beat Leaflet internal panes (tiles 200, overlay 400, markers 600, controls 1000) */
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #081A2E 0%, var(--color-primary) 50%, #0D3B66 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    padding: 32px 40px;
    overflow: hidden;
    z-index: 2000;
    visibility: hidden;
}

.voyage-viz__highlights.is-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.voyage-viz__highlights::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 80% 10%, rgba(0, 180, 216, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 10% 90%, rgba(229, 89, 52, 0.06) 0%, transparent 40%);
    pointer-events: none;
}

.vvh-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.vvh-eyebrow {
    display: inline-block;
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--color-success);
    font-weight: 600;
    padding: 4px 10px;
    border: 1px solid var(--color-success);
    border-radius: 3px;
    background: rgba(16, 185, 129, 0.08);
    margin-bottom: 10px;
}

.vvh-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-white);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.vvh-subtitle {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 11px;
    color: var(--color-gray-400);
    margin-top: 6px;
    letter-spacing: 0.06em;
}

.vvh-arrival {
    text-align: right;
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
}

.vvh-arrival-label {
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--color-gray-400);
    margin-bottom: 4px;
    font-weight: 500;
}

.vvh-arrival-value {
    font-size: 16px;
    color: var(--color-white);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.vvh-arrival-sub {
    font-size: 11px;
    color: var(--color-accent);
    margin-top: 2px;
    font-weight: 500;
}

/* Hero stats row: big headline numbers */
.vvh-hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.vvh-hero-stat {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.vvh-hero-stat--accent {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.15), rgba(0, 180, 216, 0.05));
    border-color: rgba(0, 180, 216, 0.3);
}

.vvh-hero-stat--success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
}

.vvh-hero-stat--warn {
    background: linear-gradient(135deg, rgba(229, 89, 52, 0.18), rgba(229, 89, 52, 0.06));
    border-color: rgba(229, 89, 52, 0.35);
}

.vvh-hero-label {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--color-gray-400);
    font-weight: 600;
    margin-bottom: 6px;
}

.vvh-hero-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-white);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.vvh-hero-value-accent {
    color: var(--color-accent);
}

.vvh-hero-unit {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-gray-400);
}

.vvh-hero-sub {
    font-size: 10px;
    color: var(--color-gray-400);
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    margin-top: 4px;
}

/* Detail grid: 3 panels (consumption, emissions, regulatory) */
.vvh-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.vvh-panel {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vvh-panel-header {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--color-accent);
    font-weight: 600;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vvh-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 10px;
    color: var(--color-gray-300);
}

.vvh-row > span:first-child {
    color: var(--color-gray-400);
}

.vvh-row > span:last-child {
    color: var(--color-white);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.vvh-row--highlight > span:last-child {
    color: var(--color-amber, #E55934);
    font-weight: 700;
}

.vvh-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--color-success);
    color: var(--color-white);
    border-radius: 3px;
    font-weight: 800;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0;
}

.vvh-grade--b { background: #22C55E; }
.vvh-grade--c { background: var(--color-warning); }
.vvh-grade--d { background: #F97316; }
.vvh-grade--e { background: var(--color-danger); }

.vvh-no-ets-banner {
    padding: 8px 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 3px;
    margin-top: 8px;
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 10px;
    color: var(--color-success);
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.06em;
}

/* Dim map+dashboard underneath when highlights are active */
.voyage-viz__wrapper.is-showing-highlights .voyage-viz__map,
.voyage-viz__wrapper.is-showing-highlights .voyage-viz__dashboard {
    transition: opacity 0.6s ease;
}

/* ============================================
   Comparison Dashboard (multi-route view)
   ============================================ */

.vvc {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.vvc-grid {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
}

.vvc-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr 1fr;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vvc-row:last-child {
    border-bottom: none;
}

.vvc-row--head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

.vvc-col-header {
    padding: 10px 12px;
    border-top: 3px solid;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.vvc-col-dest {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 2px;
}

.vvc-col-title {
    font-size: 10px;
    color: var(--color-gray-300);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vvc-row-label {
    padding: 8px 12px;
    font-size: 10px;
    color: var(--color-gray-400);
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.vvc-cell {
    padding: 8px 12px;
    font-size: 11px;
    color: var(--color-white);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
}

.vvc-cell--best {
    color: var(--color-success);
    font-weight: 700;
    background: rgba(16, 185, 129, 0.08);
}

.vvc-insight {
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.08), rgba(255, 31, 138, 0.05));
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: var(--radius-md);
    margin-top: auto;
}

.vvc-insight-label {
    font-family: 'IBM Plex Mono', 'Consolas', monospace;
    font-size: 9px;
    letter-spacing: 0.16em;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 4px;
}

.vvc-insight-text {
    font-size: 11px;
    color: var(--color-gray-200);
    line-height: 1.5;
}

.vvc-insight-text strong {
    color: var(--color-white);
    font-weight: 700;
}

/* Comparison port labels */
.voyage-viz__port-label--compare span {
    font-weight: 700;
}

.voyage-viz__port-label--origin span {
    background: var(--color-primary);
    border-color: var(--color-accent);
    font-weight: 700;
    font-size: 10px;
}

/* --- CTA --- */
.voyage-viz__cta {
    text-align: center;
    margin-top: var(--space-12);
    position: relative;
    z-index: 1;
}

.voyage-viz__cta-text {
    font-size: var(--font-size-base);
    color: var(--color-gray-400);
    margin-bottom: var(--space-5);
    font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .voyage-viz__wrapper {
        aspect-ratio: auto;
    }
    .voyage-viz__grid {
        grid-template-columns: 1fr;
    }
    .voyage-viz__map {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        aspect-ratio: 16 / 10;
    }
    .voyage-viz__dashboard {
        padding: 20px;
    }
    .vv-title { font-size: 20px; }
    .vv-kpi-value { font-size: 20px; }
}

@media (max-width: 640px) {
    .voyage-viz__title { font-size: var(--font-size-3xl); }
    .voyage-viz__map-label {
        top: 12px; left: 12px;
        padding: 7px 10px;
    }
    .voyage-viz__map-title { font-size: 13px; }
    .voyage-viz__dashboard { padding: 16px; gap: 10px; }
    .vv-title { font-size: 18px; }
    .vv-kpi { padding: 9px 10px; }
    .vv-kpi-value { font-size: 16px; }
}
