:root {
    color-scheme: light;
    --navy: #142c3d;
    --teal: #087f73;
    --ink: #243746;
    --muted: #667788;
    --line: #e2e8ee;
    --surface: #ffffff;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    display: flex;
    flex-direction: column;
    font-family: Tahoma, Arial, sans-serif;
    color: var(--ink);
    background: #f4f6f8;
    font-size: 13px;
}

.header {
    height: 56px;
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    background: var(--navy);
    color: white;
    z-index: 10;
}

.brand {
    font-family: Arial, sans-serif;
    font-size: 21px;
    font-weight: 800;
    white-space: nowrap;
}

.brand span {
    color: #55d4ba;
}

.brand small {
    font-size: 9px;
    font-weight: 500;
    padding: 3px 6px;
    margin-left: 6px;
    border: 1px solid #587282;
    border-radius: 4px;
    vertical-align: middle;
}

.header-actions,
.location-actions {
    display: flex;
    gap: 7px;
}

button {
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
}

button:hover {
    background: #eff6f5;
}

button:disabled {
    opacity: .45;
    cursor: default;
}

.header button {
    color: white;
    background: #223e50;
    border-color: #3f596a;
}

.header button:hover {
    background: #365668;
}

.workspace {
    flex: 1;
    position: relative;
    min-height: 0;
}

#map {
    position: absolute;
    inset: 0;
}

.panel {
    position: absolute;
    inset-block-start: 14px;
    inset-inline-start: 14px;
    width: 270px;
    max-height: calc(100% - 65px);
    overflow-y: auto;
    border: 1px solid #dbe2e8;
    border-radius: 12px;
    background: rgba(255,255,255,.97);
    padding: 16px;
    box-shadow: 0 4px 20px #23374715;
    z-index: 5;
}

.panel[hidden] {
    display: none;
}

h2 {
    font-size: 15px;
    margin: 0 0 10px;
}

.subtitle,
.hint {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.8;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 2px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
}

.layer-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--teal);
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

.coordinate-label {
    color: var(--muted);
    font: 10px Arial, sans-serif;
    direction: ltr;
}

.coordinates {
    display: grid;
    gap: 8px;
    margin: 10px 0 14px;
}

.coordinates > div {
    padding: 9px;
    background: #f6f8fa;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.coordinates label {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-bottom: 6px;
}

output {
    display: block;
    font: 15px monospace;
    color: var(--navy);
}

#copy {
    background: var(--teal);
    border-color: var(--teal);
    color: white;
    flex: 1;
}

.statusbar {
    height: 28px;
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: white;
    border-top: 1px solid var(--line);
    padding: 0 12px;
    font-size: 10px;
}

.loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: #f4f6f8;
    z-index: 20;
}

.loading[hidden] {
    display: none;
}

.spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid #dce8e6;
    border-top-color: var(--teal);
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .header {
        padding: 0 8px;
    }

    .brand {
        font-size: 15px;
    }

    .brand small {
        display: none;
    }

    .header button {
        padding: 8px;
        font-size: 11px;
    }

    .panel {
        width: min(270px, calc(100% - 64px));
        max-height: 65%;
        padding: 12px;
    }

    .statusbar {
        font-size: 9px;
        padding: 0 6px;
    }

    .statusbar span:last-child {
        display: none;
    }
}

/* TROCA MAP R02-A2 */

@font-face {
    font-family: Vazirmatn;
    src: url('/fonts/vazirmatn/Vazirmatn-Regular.woff2')
         format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: Vazirmatn;
    src: url('/fonts/vazirmatn/Vazirmatn-Bold.woff2')
         format('woff2');
    font-weight: 700;
    font-display: swap;
}

body {
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

.basemap-switcher {
    display: flex;
    align-items: center;
}

#basemap {
    font: inherit;
    color: white;
    background: #294658;
    border: 1px solid #496577;
    border-radius: 7px;
    min-width: 145px;
    padding: 7px 12px;
    cursor: pointer;
}

#basemap option {
    background: #ffffff;
    color: #243746;
}

#basemap:disabled {
    opacity: .65;
    cursor: wait;
}

.panel {
    width: 250px;
    padding: 14px;
}

.layer-item {
    padding-block: 6px;
}

.maplibregl-popup-content {
    font-family: Vazirmatn, Tahoma, sans-serif;
}

@media (max-width: 600px) {

    .header {
        min-height: 56px;
        height: auto;
        flex-basis: auto;
        flex-wrap: wrap;
        padding: 8px;
        gap: 8px;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 4px;
    }

    #basemap {
        min-width: 105px;
        font-size: 11px;
        padding: 6px;
    }

    .panel {
        width: min(250px, calc(100% - 64px));
    }
}
