/* bada.city -- Coastal Metropolis Command Center */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --harbor-night: #0a1628;
    --maritime-blue: #1e3a5f;
    --port-cyan: #00e5ff;
    --beacon-orange: #ff6b35;
    --panel-dark: #132238;
    --grid-blue: #1e3a5f;
    --coastal-light: #c8dae8;
    --fog-gray: #5a7a9a;
    --phosphor: #00ff88;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Barlow', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 400;
    color: var(--coastal-light);
    background: var(--harbor-night);
    overflow-x: hidden;
    padding-bottom: 50px;
}

.mono {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
}

.phosphor {
    color: var(--phosphor);
}

.beacon {
    color: var(--beacon-orange);
}

/* === HERO SECTION === */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(180deg, var(--harbor-night) 0%, #1a3550 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-bottom: 10vh;
}

.hero-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 5rem);
    color: var(--port-cyan);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-shadow: 0 0 40px rgba(0, 229, 255, 0.4), 0 0 80px rgba(0, 229, 255, 0.15);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 0.95rem);
    color: var(--fog-gray);
    letter-spacing: 0.3em;
}

/* Skyline */
.skyline-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    z-index: 5;
    pointer-events: none;
}

.skyline {
    position: absolute;
    bottom: 50%;
    left: 0;
    width: 100%;
    height: 50%;
}

.skyline-reflection {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    transform: scaleY(-1);
    opacity: 0.25;
    filter: blur(2px);
}

/* Window flicker animation */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    30% { opacity: 0.3; }
    50% { opacity: 0.9; }
    70% { opacity: 0.15; }
    90% { opacity: 0.85; }
}

/* Harbor Reflections */
.harbor-reflections {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 22%;
    z-index: 4;
    pointer-events: none;
    overflow: hidden;
}

.reflection-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 229, 255, 0.05) 15%,
        rgba(0, 229, 255, 0.15) 30%,
        rgba(0, 229, 255, 0.05) 50%,
        rgba(0, 229, 255, 0.12) 70%,
        rgba(0, 229, 255, 0.03) 85%,
        transparent 100%
    );
    animation: reflectionShimmer 4s ease-in-out infinite;
}

.reflection-line:nth-child(1) { top: 15%; animation-delay: 0s; opacity: 0.7; }
.reflection-line:nth-child(2) { top: 30%; animation-delay: 0.8s; opacity: 0.5; }
.reflection-line:nth-child(3) { top: 50%; animation-delay: 1.6s; opacity: 0.6; }
.reflection-line:nth-child(4) { top: 68%; animation-delay: 2.4s; opacity: 0.4; }
.reflection-line:nth-child(5) { top: 85%; animation-delay: 3.2s; opacity: 0.3; }

@keyframes reflectionShimmer {
    0%, 100% { transform: scaleX(1); opacity: var(--line-opacity, 0.5); }
    50% { transform: scaleX(1.05); opacity: calc(var(--line-opacity, 0.5) * 1.3); }
}

/* === DASHBOARD SECTION === */
.dashboard {
    position: relative;
    padding: 60px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--grid-blue);
}

.section-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--coastal-light);
    letter-spacing: 0.1em;
}

.section-coord {
    margin-left: auto;
    color: var(--fog-gray);
}

/* === BENTO GRID === */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 16px;
}

/* Panel spans */
.panel-districts { grid-column: span 2; }
.panel-tides { grid-column: span 2; }
.panel-transit { grid-column: span 2; }
.panel-depth { grid-column: span 1; }
.panel-compass { grid-column: span 1; }
.panel-weather { grid-column: span 2; }
.panel-log { grid-column: span 2; }

/* === PANEL BASE === */
.panel {
    background: var(--panel-dark);
    border: 1px solid var(--grid-blue);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(30, 58, 95, 0.4);
    border-bottom: 1px solid var(--grid-blue);
}

.panel-label {
    color: var(--coastal-light);
    letter-spacing: 0.15em;
    font-size: 0.75rem;
}

.panel-status {
    margin-left: auto;
    color: var(--phosphor);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

.panel-body {
    padding: 20px 16px;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* === SIGNAL FLAGS === */
.signal-flag {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* International Maritime Signal Flags (simplified) */
.flag-c {
    background: linear-gradient(180deg,
        #0038a8 0% 20%,
        #fff 20% 40%,
        #ce1126 40% 60%,
        #fff 60% 80%,
        #0038a8 80% 100%
    );
}
.flag-d {
    background: linear-gradient(180deg,
        #fcd116 0% 33.33%,
        #0038a8 33.33% 66.66%,
        #fcd116 66.66% 100%
    );
}
.flag-t {
    background: linear-gradient(180deg,
        #ce1126 0% 33.33%,
        #fff 33.33% 66.66%,
        #0038a8 66.66% 100%
    );
}
.flag-r {
    background: linear-gradient(90deg, #ce1126 50%, #fcd116 50%);
}
.flag-b {
    background: linear-gradient(to bottom right, #ce1126 50%, transparent 50%),
                linear-gradient(to bottom left, transparent 50%, #ce1126 50%);
    /* Bravo flag: red swallowtail */
    background-color: #ce1126;
}
.flag-n {
    background: repeating-linear-gradient(
        45deg,
        #0038a8,
        #0038a8 4px,
        #fff 4px,
        #fff 8px
    );
}
.flag-w {
    background: linear-gradient(180deg, #0038a8 50%, transparent 50%);
    border: 2px solid #ce1126;
    background-color: #fff;
}
.flag-l {
    background: linear-gradient(90deg,
        #fcd116 0% 25%,
        #000 25% 50%,
        #fcd116 50% 75%,
        #000 75% 100%
    );
}

/* === DISTRICT MAP === */
.district-map {
    width: 100%;
    height: 220px;
}

/* === TIDE CHART === */
.tide-chart {
    width: 100%;
    height: 100px;
    margin-bottom: 15px;
}

.tide-data {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tide-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tide-label {
    color: var(--fog-gray);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
}

.tide-value {
    color: var(--coastal-light);
    font-size: 0.9rem;
}

/* === TRANSIT MAP === */
.transit-map {
    width: 100%;
    height: 140px;
    margin-bottom: 15px;
}

.transit-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    color: var(--fog-gray);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
}

.stat-value {
    font-size: 1.2rem;
}

/* === DEPTH CHART === */
.depth-chart {
    width: 100%;
    height: 140px;
    margin-bottom: 15px;
}

.depth-readings {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.depth-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.depth-label {
    color: var(--fog-gray);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
}

.depth-value {
    color: var(--coastal-light);
    font-size: 0.9rem;
}

/* === COMPASS ROSE === */
.compass-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.compass-rose {
    width: 140px;
    height: 140px;
    animation: compassSpin 120s linear infinite;
}

@keyframes compassSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.compass-heading {
    color: var(--port-cyan);
    font-size: 1rem;
    letter-spacing: 0.15em;
}

/* === WEATHER GRID === */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.weather-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weather-label {
    color: var(--fog-gray);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
}

.weather-value {
    color: var(--coastal-light);
    font-size: 0.85rem;
}

/* === HARBOR LOG === */
.log-entries {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-entry {
    display: flex;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(30, 58, 95, 0.5);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--fog-gray);
    flex-shrink: 0;
    font-size: 0.75rem;
}

.log-msg {
    color: var(--coastal-light);
    font-size: 0.75rem;
}

.log-msg.beacon {
    color: var(--beacon-orange);
}

/* === FIXED NAVIGATION BAR === */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 44px;
    background: rgba(10, 22, 40, 0.95);
    border-top: 1px solid var(--grid-blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.nav-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-label {
    color: var(--fog-gray);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
}

.nav-value {
    color: var(--port-cyan);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.nav-compass-mini {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-compass-indicator {
    width: 28px;
    height: 28px;
    transition: transform 0.4s ease;
}

.nav-compass-svg {
    width: 100%;
    height: 100%;
}

.nav-anchor {
    background: none;
    border: 1px solid var(--grid-blue);
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease;
}

.nav-anchor:hover {
    border-color: var(--port-cyan);
}

.anchor-icon {
    width: 20px;
    height: 20px;
}

/* === DEPTH CHART BACKGROUND PATTERN (bathymetric lines) === */
.panel-depth .panel-body::before,
.panel-tides .panel-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 200'%3E%3Cpath d='M0,40 C50,30 100,50 150,40 C200,30 250,45 300,35' fill='none' stroke='%231e3a5f' stroke-width='1'/%3E%3Cpath d='M0,80 C60,70 120,90 180,75 C240,60 270,85 300,70' fill='none' stroke='%231e3a5f' stroke-width='1'/%3E%3Cpath d='M0,120 C40,110 80,130 140,115 C200,100 260,125 300,110' fill='none' stroke='%231e3a5f' stroke-width='1'/%3E%3Cpath d='M0,160 C70,150 130,170 190,155 C250,140 280,165 300,150' fill='none' stroke='%231e3a5f' stroke-width='1'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 0;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .panel-districts,
    .panel-transit,
    .panel-log {
        grid-column: span 2;
    }

    .panel-tides,
    .panel-depth,
    .panel-compass,
    .panel-weather {
        grid-column: span 1;
    }

    .weather-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .panel-districts,
    .panel-tides,
    .panel-transit,
    .panel-depth,
    .panel-compass,
    .panel-weather,
    .panel-log {
        grid-column: span 1;
    }

    .dashboard {
        padding: 30px 16px;
    }

    .weather-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .transit-stats {
        gap: 16px;
        flex-wrap: wrap;
    }

    .hero-title {
        letter-spacing: 0.08em;
    }
}
