/* =========================================================
   NAVTOOL MAP
   ========================================================= */

:root {
    --bg: #020706;
    --bg-soft: #06100d;
    --panel: #07130f;
    --panel-2: #091813;

    --mint: #00d8b8;
    --mint-bright: #16f0cf;
    --mint-dark: #008f7c;

    --white: #eefbf7;
    --text: #d6e8e2;
    --muted: #78918a;
    --muted-2: #506660;

    --border: rgba(0, 216, 184, 0.16);
    --border-strong: rgba(0, 216, 184, 0.34);

    --danger: #ff5366;

    --shadow:
        0 25px 70px rgba(0, 0, 0, 0.4);
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    min-height: 100vh;

    background:
        radial-gradient(
            circle at 20% 0%,
            rgba(0, 216, 184, 0.07),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   HEADER
========================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 5000;

    min-height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 32px;

    background:
        rgba(2, 7, 6, 0.94);

    border-bottom:
        1px solid var(--border);

    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    position: relative;

    width: 36px;
    height: 36px;

    border:
        1px solid var(--mint);

    transform: rotate(45deg);

    display: grid;
    place-items: center;
}

.brand-mark span {
    position: absolute;

    width: 14px;
    height: 1px;

    background: var(--mint);
}

.brand-mark span:nth-child(1) {
    transform: rotate(0deg);
}

.brand-mark span:nth-child(2) {
    transform: rotate(60deg);
}

.brand-mark span:nth-child(3) {
    transform: rotate(120deg);
}

.brand-name {
    color: var(--white);

    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.15em;
}

.brand-sub {
    margin-top: 2px;

    color: var(--muted);

    font-size: 8px;
    letter-spacing: 0.17em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    position: relative;

    color: var(--muted);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;

    transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--mint);
}

.main-nav a.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: -9px;

    height: 1px;

    background: var(--mint);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--muted);

    font-size: 9px;
    letter-spacing: 0.12em;
}

.system-status span {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--mint);

    box-shadow:
        0 0 12px var(--mint);
}


/* =========================================================
   HERO
========================================================= */

.hero {
    padding:
        90px
        24px
        60px;
}

.hero-inner {
    width: min(1180px, 100%);
    margin: auto;
}

.eyebrow,
.panel-kicker {
    color: var(--mint);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
}

.hero h1 {
    margin:
        14px
        0
        14px;

    color: var(--white);

    font-size:
        clamp(46px, 8vw, 100px);

    line-height: 0.92;

    letter-spacing: -0.055em;
}

.hero h1 span {
    color: var(--mint);
}

.hero-text {
    max-width: 650px;

    color: var(--muted);

    font-size: 15px;
    line-height: 1.8;
}


/* =========================================================
   GENERAL SECTIONS
========================================================= */

.control-section,
.map-section,
.results-section,
.info-section {
    width: min(1180px, calc(100% - 40px));
    margin:
        0
        auto
        80px;
}

.panel,
.info-panel {
    background:
        linear-gradient(
            145deg,
            rgba(9, 24, 19, 0.98),
            rgba(4, 12, 9, 0.98)
        );

    border:
        1px solid var(--border);

    box-shadow: var(--shadow);
}

.panel {
    padding: 30px;
}

.panel-header,
.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 28px;
}

.panel-header h2,
.section-heading h2,
.info-panel h2 {
    margin: 7px 0 0;

    color: var(--white);

    font-size: 28px;
    letter-spacing: -0.03em;
}

.route-state,
.map-status {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--muted);

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.route-state span:first-child {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--mint);

    box-shadow: 0 0 10px var(--mint);
}


/* =========================================================
   FORM
========================================================= */

.route-form {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        52px
        minmax(0, 1fr);

    gap: 15px;

    align-items: end;
}

.field-block {
    min-width: 0;
}

.field-block label {
    display: block;

    margin-bottom: 9px;

    color: var(--muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.input-row {
    display: flex;
    gap: 8px;
}

input,
select {
    width: 100%;

    min-height: 48px;

    border:
        1px solid var(--border);

    border-radius: 2px;

    outline: none;

    background: #030b08;

    color: var(--white);

    padding: 0 14px;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

input:focus,
select:focus {
    border-color: var(--mint);

    box-shadow:
        0 0 0 2px
        rgba(0, 216, 184, 0.08);
}

.small-button {
    min-width: 82px;

    border:
        1px solid var(--border);

    background: #07140f;

    color: var(--mint);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.small-button:hover {
    background: rgba(0, 216, 184, 0.08);

    border-color:
        var(--border-strong);
}

.swap-button {
    width: 52px;
    height: 48px;

    border:
        1px solid var(--border);

    background: #07140f;

    color: var(--mint);

    font-size: 24px;
}

.swap-button:hover {
    border-color: var(--mint);

    background:
        rgba(0, 216, 184, 0.08);
}


/* =========================================================
   MAP ACTIONS
========================================================= */

.map-action-row {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;

    margin-top: 22px;
}

.action-button {
    min-height: 40px;

    padding: 0 14px;

    border:
        1px solid var(--border);

    background: transparent;

    color: var(--muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;

    transition: 0.2s ease;
}

.action-button span {
    color: var(--mint);

    margin-right: 5px;
}

.action-button:hover,
.action-button.active {
    color: var(--white);

    border-color: var(--mint);

    background:
        rgba(0, 216, 184, 0.08);
}

.primary-outline {
    color: var(--mint);
}

.danger-outline:hover {
    color: var(--danger);

    border-color: var(--danger);

    background:
        rgba(255, 83, 102, 0.06);
}

.map-instruction {
    margin-top: 12px;

    color: var(--muted-2);

    font-size: 11px;
    line-height: 1.6;
}


/* =========================================================
   TECHNICAL GRID
========================================================= */

.technical-grid {
    display: grid;

    grid-template-columns:
        1fr
        1.5fr
        1fr;

    gap: 14px;

    margin-top: 26px;
}

.unit-input {
    position: relative;
}

.unit-input input {
    padding-right: 55px;
}

.unit-input span {
    position: absolute;

    right: 14px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--mint);

    font-size: 10px;
    font-weight: 800;
}


/* =========================================================
   CALCULATE
========================================================= */

.calculate-row {
    margin-top: 24px;
}

.calculate-button {
    width: 100%;

    min-height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    border:
        1px solid var(--mint);

    background:
        linear-gradient(
            90deg,
            rgba(0, 216, 184, 0.08),
            rgba(0, 216, 184, 0.18)
        );

    color: var(--white);

    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;

    transition: 0.2s ease;
}

.calculate-button:hover {
    background:
        rgba(0, 216, 184, 0.2);

    box-shadow:
        0 0 30px
        rgba(0, 216, 184, 0.08);
}

.calculate-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.calculate-icon {
    color: var(--mint);
}


/* =========================================================
   ERROR
========================================================= */

.error-box {
    margin-top: 15px;

    padding: 14px;

    border:
        1px solid rgba(255, 83, 102, 0.35);

    background:
        rgba(255, 83, 102, 0.06);

    color: #ff9aa7;

    font-size: 11px;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}


/* =========================================================
   MAP
========================================================= */

.map-wrapper {
    position: relative;

    width: 100%;
    height: 640px;

    overflow: hidden;

    border:
        1px solid var(--border);

    background: #07130f;

    box-shadow: var(--shadow);
}

#map {
    width: 100%;
    height: 100%;

    background: #081411;
}


/*
   Wichtig:
   Leaflet darf nicht von anderen NavTool-CSS-Regeln
   überschrieben werden.
*/

#map .leaflet-pane {
    z-index: 1;
}

#map .leaflet-control {
    z-index: 800;
}

#map img {
    max-width: none !important;
}


/* =========================================================
   LEAFLET
========================================================= */

.leaflet-container {
    font-family: inherit;

    background: #081411;
}

.leaflet-control-zoom {
    border:
        1px solid var(--border) !important;
}

.leaflet-control-zoom a {
    width: 34px !important;
    height: 34px !important;

    line-height: 34px !important;

    background: #07130f !important;

    color: var(--mint) !important;

    border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
    background: #0c2019 !important;
}

.leaflet-control-attribution {
    background:
        rgba(2, 7, 6, 0.8) !important;

    color: var(--muted) !important;
}

.leaflet-control-attribution a {
    color: var(--mint) !important;
}


/* =========================================================
   MAP OVERLAYS
========================================================= */

.map-overlay {
    position: absolute;
    z-index: 1000;

    padding: 10px 12px;

    border:
        1px solid var(--border);

    background:
        rgba(2, 7, 6, 0.9);

    backdrop-filter: blur(10px);

    color: var(--muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;

    pointer-events: none;
}

.map-overlay.top-left {
    top: 15px;
    left: 15px;

    display: flex;
    gap: 16px;
}

.map-overlay.bottom-left {
    bottom: 15px;
    left: 15px;
}

.map-overlay.bottom-right {
    right: 15px;
    bottom: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-line {
    width: 20px;
    height: 3px;

    background: var(--mint);
}

.legend-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;
}

.legend-dot.start {
    background: var(--mint);
}

.legend-dot.destination {
    background: #ff5366;
}


/* =========================================================
   CUSTOM MARKERS
========================================================= */

.nav-marker {
    position: relative;

    width: 26px;
    height: 26px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 10px;
    font-weight: 900;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(0, 216, 184, 0.4);
}

.start-marker {
    background: var(--mint);

    color: #00110c;

    border:
        2px solid #d8fff7;
}

.destination-marker {
    background: #ff5366;

    color: white;

    border:
        2px solid #ffd3d8;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(255, 83, 102, 0.35);
}

.waypoint-marker {
    background: #07130f;

    color: var(--mint);

    border:
        2px solid var(--mint);
}


/* =========================================================
   POPUP
========================================================= */

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #07130f;

    color: var(--text);
}

.leaflet-popup-content {
    margin: 14px;

    font-family: inherit;

    font-size: 11px;
}

.popup-title {
    color: var(--mint);

    margin-bottom: 7px;

    font-weight: 800;
    letter-spacing: 0.1em;
}

.popup-coords {
    color: var(--muted);

    margin-bottom: 10px;
}

.popup-delete {
    width: 100%;

    padding: 8px;

    border:
        1px solid rgba(255, 83, 102, 0.3);

    background:
        rgba(255, 83, 102, 0.06);

    color: #ff8996;

    font-size: 9px;
    font-weight: 800;
}


/* =========================================================
   ROUTE
========================================================= */

.route-line-shadow {
    stroke: #001b16;

    filter:
        drop-shadow(
            0 0 7px
            rgba(0, 216, 184, 0.25)
        );
}

.route-line {
    stroke: var(--mint);

    filter:
        drop-shadow(
            0 0 4px
            rgba(0, 216, 184, 0.45)
        );
}


/* =========================================================
   RESULTS
========================================================= */

.result-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 12px;
}

.result-card {
    min-height: 175px;

    padding: 22px;

    border:
        1px solid var(--border);

    background:
        linear-gradient(
            145deg,
            #081510,
            #040c09
        );
}

.result-card.highlight {
    border-color:
        rgba(0, 216, 184, 0.4);

    box-shadow:
        inset 0 0 40px
        rgba(0, 216, 184, 0.03);
}

.result-label {
    color: var(--muted);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.result-value {
    margin-top: 28px;

    color: var(--white);

    font-size: 40px;
    font-weight: 800;

    letter-spacing: -0.04em;
}

.result-value small {
    color: var(--mint);

    font-size: 11px;

    letter-spacing: 0.08em;
}

.result-value.eta {
    font-size: 28px;
}

.result-secondary {
    margin-top: 10px;

    color: var(--muted-2);

    font-size: 10px;
    letter-spacing: 0.05em;
}


/* =========================================================
   DETAILS
========================================================= */

.route-details {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    margin-top: 12px;

    border:
        1px solid var(--border);
}

.detail-item {
    padding: 18px;

    border-right:
        1px solid var(--border);
}

.detail-item:last-child {
    border-right: 0;
}

.detail-label {
    display: block;

    margin-bottom: 7px;

    color: var(--muted-2);

    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.detail-item strong {
    color: var(--white);

    font-size: 12px;
}

.calculation-note {
    margin-top: 15px;

    padding: 14px;

    border:
        1px solid var(--border);

    background:
        rgba(0, 216, 184, 0.03);

    color: var(--muted);

    font-size: 11px;
    line-height: 1.6;
}


/* =========================================================
   INFO
========================================================= */

.info-panel {
    padding: 30px;
}

.info-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 1px;

    margin-top: 30px;

    background: var(--border);
}

.info-grid > div {
    padding: 22px;

    background: #06100d;
}

.info-grid strong {
    color: var(--mint);

    font-size: 11px;
    letter-spacing: 0.08em;
}

.info-grid p {
    margin:
        10px
        0
        0;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.7;
}


/* =========================================================
   FOOTER
========================================================= */

.footer {
    margin-top: 100px;

    border-top:
        1px solid var(--border);

    background: #030a08;
}

.footer-inner {
    width: min(1180px, calc(100% - 40px));
    min-height: 100px;

    margin: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;
}

.footer strong {
    display: block;

    color: var(--white);

    font-size: 12px;
    letter-spacing: 0.15em;
}

.footer span {
    display: block;

    margin-top: 4px;

    color: var(--muted-2);

    font-size: 8px;
    letter-spacing: 0.15em;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: var(--muted);

    font-size: 9px;
    letter-spacing: 0.12em;
}

.footer-links a:hover {
    color: var(--mint);
}

.footer-copy {
    color: var(--muted-2);

    font-size: 9px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .main-nav {
        display: none;
    }

    .system-status {
        display: none;
    }

    .route-form {
        grid-template-columns: 1fr;
    }

    .swap-button {
        width: 100%;
    }

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

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

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

    .detail-item:nth-child(2) {
        border-right: 0;
    }

    .detail-item:nth-child(-n + 2) {
        border-bottom:
            1px solid var(--border);
    }

    .map-wrapper {
        height: 540px;
    }
}


@media (max-width: 600px) {

    .topbar {
        padding: 0 16px;
    }

    .hero {
        padding:
            55px
            18px
            35px;
    }

    .control-section,
    .map-section,
    .results-section,
    .info-section {
        width:
            calc(100% - 24px);
    }

    .panel,
    .info-panel {
        padding: 18px;
    }

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

    .route-details {
        grid-template-columns: 1fr;
    }

    .detail-item {
        border-right: 0;

        border-bottom:
            1px solid var(--border);
    }

    .detail-item:last-child {
        border-bottom: 0;
    }

    .map-wrapper {
        height: 470px;
    }

    .map-overlay.top-left {
        flex-direction: column;
        gap: 7px;
    }

    .footer-inner {
        padding: 25px 0;

        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}

/* NAVTOOL unified responsive refinements */
.topbar{top:58px !important;}
@media(max-width:760px){.main-nav{gap:10px!important}.main-nav a{font-size:9px!important}.system-status{display:none!important}.topbar{top:58px!important}.map-wrapper{height:58vh!important;min-height:390px}.technical-grid{grid-template-columns:1fr!important}.route-form{grid-template-columns:1fr!important}.swap-button{width:100%!important}.control-section,.map-section,.results-section,.info-section{width:min(100% - 20px,1180px)!important}.panel{padding:20px!important}}
