/* ============================================================
   SolarThrone — Station Page CSS
   The primary gameplay screen: hero, HUD, market, panels
   ============================================================ */


/* ---------- 1. Station Hero ---------- */
.station-hero {
    text-align: center;
    margin: calc(-40px - var(--space-lg)) calc(-1 * var(--space-lg)) var(--space-lg);
    padding: 60px var(--space-lg) 40px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.6) 50%, var(--space-deep) 100%),
        linear-gradient(180deg, var(--space-blue) 0%, var(--nebula-purple) 40%, var(--atmo-teal) 80%, var(--space-deep) 100%);
}

/* Region-specific horizon gradients */
.station-hero[data-region="Inner"] {
    background:
        linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.6) 50%, var(--space-deep) 100%),
        linear-gradient(180deg, var(--space-blue) 0%, #1a1840 30%, var(--metal-orange) 70%, var(--metal-gold) 90%, var(--space-deep) 100%);
}

.station-hero[data-region="Belt"] {
    background:
        linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.6) 50%, var(--space-deep) 100%),
        linear-gradient(180deg, var(--space-deep) 0%, #1a1530 30%, var(--nebula-purple) 60%, #3d2244 80%, var(--space-deep) 100%);
}

.station-hero[data-region="Outer"] {
    background:
        linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.6) 50%, var(--space-deep) 100%),
        linear-gradient(180deg, #060a18 0%, var(--space-blue) 30%, #0e3848 60%, var(--atmo-teal) 85%, var(--space-deep) 100%);
}

.station-hero h1 {
    font-size: 2.2rem;
    letter-spacing: 0.18em;
    color: var(--star-warm);
    text-shadow:
        0 0 40px rgba(245, 234, 208, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.6);
    margin-bottom: var(--space-sm);
}

.station-hero__description {
    color: rgba(232, 224, 208, 0.7);
    font-size: 1rem;
    margin-bottom: var(--space-md);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.station-hero__badges {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.badge--jurisdiction {
    border-color: rgba(201, 146, 46, 0.3);
    color: var(--metal-gold);
}

.badge--region {
    border-color: rgba(91, 184, 196, 0.3);
    color: var(--atmo-cyan);
}

.badge--body {
    border-color: rgba(232, 224, 208, 0.2);
}


/* ---------- 2. CSS Station Placeholder ---------- */
.station-visual {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto var(--space-lg);
}

/* Atmospheric halo glow */
.station-visual__glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(91, 184, 196, 0.12) 0%,
        rgba(91, 184, 196, 0.04) 40%,
        transparent 70%
    );
}

/* Docking ring — outer circle */
.station-visual__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 3px solid rgba(91, 184, 196, 0.35);
    box-shadow:
        0 0 20px rgba(91, 184, 196, 0.15),
        inset 0 0 20px rgba(91, 184, 196, 0.08);
}

/* Central hub module */
.station-visual__core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(201, 146, 46, 0.25) 0%, rgba(201, 146, 46, 0.1) 100%);
    border: 2px solid rgba(201, 146, 46, 0.3);
    box-shadow:
        0 0 16px rgba(201, 146, 46, 0.12),
        inset 0 0 12px rgba(201, 146, 46, 0.06);
}

/* Antenna spires — top and bottom */
.station-visual__spire {
    position: absolute;
    left: 50%;
    width: 3px;
    height: 60px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(91, 184, 196, 0.4) 0%, rgba(91, 184, 196, 0.1) 100%);
    border-radius: 2px;
}

.station-visual__spire--top {
    bottom: calc(50% + 100px);
}

.station-visual__spire--bottom {
    top: calc(50% + 100px);
    background: linear-gradient(0deg, rgba(91, 184, 196, 0.4) 0%, rgba(91, 184, 196, 0.1) 100%);
}

/* Swap target: when replaced by real station art */
.station-visual__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* ---------- 3. Status HUD ---------- */
.status-hud {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-lg);
    background: rgba(15, 27, 61, 0.5);
    border: 1px solid var(--panel-border);
    border-top: 2px solid rgba(201, 146, 46, 0.3);
    border-radius: var(--panel-radius);
    flex-wrap: wrap;
}

.status-hud__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.status-hud__label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(232, 224, 208, 0.45);
}

.status-hud__value {
    font-family: var(--font-mono);
    font-size: 0.95rem;
}

.status-hud__value--credits {
    color: var(--metal-gold);
}

.status-hud__value--cargo {
    color: var(--metal-chrome);
}

/* Fuel gauge bar */
.fuel-gauge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.fuel-gauge__bar {
    width: 120px;
    height: 10px;
    background: rgba(232, 224, 208, 0.08);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(232, 224, 208, 0.1);
}

.fuel-gauge__fill {
    height: 100%;
    border-radius: 4px;
    width: calc(var(--fuel-pct) * 1%);
    background: linear-gradient(90deg,
        var(--alert-red) 0%,
        var(--metal-gold) 40%,
        var(--atmo-teal) 75%
    );
    background-size: 100px 100%;
    background-position: calc(var(--fuel-pct) * 1%) 0;
    transition: width 0.3s ease;
}

.fuel-gauge__text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--metal-chrome);
    min-width: 3.5em;
}


/* ---------- 4. Station Message Toast ---------- */
.station-message {
    border: none;
    border-left: 3px solid;
    font-weight: 500;
}


/* ---------- 5. Market Table Enhancements ---------- */
.price-cell {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.market-row--illegal {
    background: rgba(138, 36, 82, 0.1) !important;
    border-left: 3px solid var(--nebula-magenta);
}

.market-row--illegal:hover {
    background: rgba(138, 36, 82, 0.18) !important;
}

.badge--illegal {
    font-size: 0.6rem;
    padding: 1px 6px;
    background: rgba(138, 36, 82, 0.3);
    border: 1px solid rgba(138, 36, 82, 0.5);
    color: #d06090;
    margin-left: var(--space-xs);
    vertical-align: middle;
}

.pl-positive {
    color: var(--atmo-cyan);
}

.pl-negative {
    color: var(--alert-red);
}


/* ---------- 6. Panel Grids ---------- */

/* Cargo + Travel side-by-side */
.station-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.station-grid > section {
    border-top: 2px solid rgba(201, 146, 46, 0.2);
    margin-bottom: 0;
}

/* Docked Ships + Activity side-by-side */
.station-life {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.station-life > section {
    border-top: 2px solid rgba(201, 146, 46, 0.2);
    margin-bottom: 0;
}

/* Panel h2 divider treatment */
.station-grid h2,
.station-life h2 {
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(201, 146, 46, 0.12);
    margin-bottom: var(--space-md);
}


/* ---------- 7. Cargo lot details ---------- */
.cargo-lots {
    padding-left: var(--space-lg);
    font-size: 0.85em;
    color: rgba(232, 224, 208, 0.5);
}

.cargo-lots div {
    padding: 2px 0;
}


/* ---------- 8. Travel Panel ---------- */
.refuel-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.refuel-bar label {
    margin-bottom: 0;
}

.refuel-bar small {
    color: rgba(232, 224, 208, 0.4);
}

.destinations-table .visited-badge {
    font-size: 0.75em;
    color: rgba(232, 224, 208, 0.35);
    margin-left: var(--space-xs);
}

.fuel-warning {
    color: rgba(232, 224, 208, 0.3);
    font-size: 0.8rem;
}

.shipyard-panel {
    border-top: 2px solid rgba(201, 146, 46, 0.2);
    margin-bottom: var(--space-lg);
}

.shipyard-row--current {
    background: rgba(36, 116, 138, 0.22) !important;
}

.shipyard-warning {
    display: block;
    margin-top: var(--space-xs);
    color: var(--rust-copper);
    font-size: 0.75rem;
}

.shipyard-warning-check {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.75rem;
}


/* ---------- 9. Responsive ---------- */
@media (max-width: 768px) {
    .station-hero {
        margin-left: calc(-1 * var(--space-md));
        margin-right: calc(-1 * var(--space-md));
        padding: 40px var(--space-md) 30px;
    }

    .station-hero h1 {
        font-size: 1.6rem;
    }

    .station-visual {
        width: 200px;
        height: 200px;
    }

    .station-visual__ring {
        width: 130px;
        height: 130px;
    }

    .station-visual__core {
        width: 50px;
        height: 50px;
    }

    .station-visual__spire {
        height: 40px;
    }

    .station-visual__spire--top {
        bottom: calc(50% + 65px);
    }

    .station-visual__spire--bottom {
        top: calc(50% + 65px);
    }

    .status-hud {
        gap: var(--space-md);
        padding: var(--space-sm) var(--space-md);
    }

    .fuel-gauge__bar {
        width: 80px;
    }

    .station-grid {
        grid-template-columns: 1fr;
    }

    .station-life {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .station-hero {
        margin-left: calc(-1 * var(--space-sm));
        margin-right: calc(-1 * var(--space-sm));
        padding: 30px var(--space-sm) 24px;
    }

    .station-hero h1 {
        font-size: 1.3rem;
        letter-spacing: 0.1em;
    }

    .station-visual {
        width: 160px;
        height: 160px;
    }

    .station-visual__ring {
        width: 100px;
        height: 100px;
    }

    .station-visual__core {
        width: 40px;
        height: 40px;
    }

    .station-visual__spire {
        height: 30px;
    }

    .station-visual__spire--top {
        bottom: calc(50% + 50px);
    }

    .station-visual__spire--bottom {
        top: calc(50% + 50px);
    }

    .status-hud {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    /* Hide P/L and Your Cost columns on very small screens */
    .market-table .col-yourcost,
    .market-table .col-pl {
        display: none;
    }

    .station-hero__badges {
        gap: 4px;
    }
}
