﻿body {
    width: 100vw;
    height: 100vh;
    margin: 0;
}

#map {
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
}

.map-status-box {
    position: absolute;
    top: 0%;
    left: 50%;
    margin-left: -70px;
    width: 140px;
    color: rgb(0, 0, 0);
    background-color: #31e04e6c;
    padding: 3px 9px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border-style: solid;
    border-color: rgba(0, 0, 0, 1);
    border-radius: 4px;
    border-width: thin;
    z-index: 99;
}

.map-control-button {
    position: absolute;
    color: white;
    background-color: #4f5050;
    border-radius: 4px;
    padding: 6px 10px;
    border: none;
    cursor: pointer;
    z-index: 99;
    font-size: 13px;
    line-height: 1.3;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.map-control-button:hover {
    background-color: #373838;
}

.map-control-button:active {
    transform: translateY(1px);
}

.Setting-container {
    top: 10px;
    right: 52px;
}

.Light-container {
    top: 10px;
    right: 150px;
}

.reset-container {
    position: absolute;
    bottom: 0px;
    left: 0px;
    color: white;
    background-color: #3887be;
    border-radius: 4px;
    padding: 3px 9px;
    border: none;
    cursor: pointer;
    z-index: 99;
}

.map-jump-picker {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 99;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 0;
}

.map-jump-button {
    appearance: none;
    border: 1px solid rgba(20, 49, 71, 0.18);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(245, 249, 252, 0.96) 0%, rgba(226, 236, 245, 0.96) 100%);
    color: #1c3349;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    padding: 6px 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 39, 56, 0.08);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.map-jump-button:hover {
    background: linear-gradient(180deg, #edf5fb 0%, #dfeef9 100%);
    border-color: rgba(0, 96, 156, 0.34);
}

.map-jump-button:active {
    transform: translateY(1px);
}

.googlemap2mb {
    position: absolute;
    top: 27px;
    left: 0px;
    color: white;
    background-color: #3887be;
    border-radius: 4px;
    padding: 3px 9px;
    border: none;
    z-index: 99;
}

/* Fork Me Github style */
.github-fork-ribbon:before {
    background-color: #ff0000;
}

.calculation-box {
    height: 100px;
    width: 180px;
    position: absolute;
    bottom: 70px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    text-align: center;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border-width: thin;
    z-index: 98;
}

p {
    font-family: 'Open Sans';
    margin: 0;
    font-size: 12px;
}

.map-menu-shell {
    position: absolute;
    top: 42px;
    right: 52px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    width: min(300px, calc(100vw - 40px));
    max-width: 300px;
}

.map-menu-shell[hidden] {
    display: none !important;
}

.technical-focus-panel {
    position: absolute;
    top: 50px;
    left: 0px;
    z-index: 30;
    width: min(300px, calc(100vw - 40px));
    max-width: 300px;
    overflow: hidden;
    background: rgba(245, 248, 251, 0.96);
    border: 1px solid rgba(25, 53, 72, 0.18);
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(15, 39, 56, 0.12);
    backdrop-filter: blur(4px);
}

.technical-focus-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 9px 12px;
    border: 0;
    background: transparent;
    color: #21435d;
    cursor: pointer;
    text-align: left;
}

.technical-focus-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.technical-focus-chevron {
    font-size: 20px;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.technical-focus-panel:not(.is-collapsed) .technical-focus-chevron {
    transform: rotate(90deg);
}

.technical-focus-toggle:hover {
    background: rgba(226, 237, 247, 0.8);
}

.technical-focus-content {
    padding: 0 8px 8px;
}

.technical-focus-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.technical-focus-tab {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid rgba(18, 58, 82, 0.14);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.78);
    color: #2b3e4d;
    cursor: pointer;
    font-size: 10.5px;
    font-weight: 700;
}

.technical-focus-tab:hover {
    background: #edf5fb;
}

.technical-focus-tab.is-active {
    background: linear-gradient(180deg, #3d8ec8 0%, #2a6fa6 100%);
    border-color: transparent;
    color: #ffffff;
}

.technical-focus-tab-panel[hidden],
.technical-focus-content[hidden] {
    display: none !important;
}

.technical-focus-placeholder {
    padding: 12px 10px;
    border: 1px solid rgba(18, 58, 82, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: #526673;
    font-size: 11px;
    line-height: 1.4;
}

.map-style-picker {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 8px;
    background: linear-gradient(180deg, rgba(246, 250, 252, 0.98) 0%, rgba(232, 238, 245, 0.98) 100%);
    border: 1px solid rgba(25, 53, 72, 0.18);
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(15, 39, 56, 0.12);
    font-family: 'Open Sans', sans-serif;
    text-align: center;
    max-width: 100%;
}

.map-style-picker input[type="radio"] {
    display: none;
}

.map-style-picker label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(20, 49, 71, 0.16);
    background: rgba(255, 255, 255, 0.75);
    color: #1f2d3d;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-style-picker label:hover {
    background-color: #edf5fb;
    border-color: rgba(0, 96, 156, 0.34);
}

.map-style-picker input[type="radio"]:checked + label {
    background: linear-gradient(180deg, #3d8ec8 0%, #2a6fa6 100%);
    color: #ffffff;
    border-color: rgba(27, 84, 121, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#menu2,
#menu3 {
    background: #fff;
    width: 100%;
    min-height: 0;
    max-height: 220px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(18, 58, 82, 0.15);
    border-top: none;
    font-family: 'Open Sans', sans-serif;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

#menu2 layerswitch,
#menu3 layerswitch3 {
    font-size: 10.5px;
    color: #404040;
    display: block;
    margin: 0;
    padding: 6px 8px;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
    background: rgba(255, 255, 255, 0.75);
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#menu2 layerswitch:last-child,
#menu3 layerswitch3:last-child {
    border: none;
}

#menu2 layerswitch:hover,
#menu3 layerswitch3:hover {
    background-color: #edf5fb;
    color: #1d3d5f;
}

#menu2 layerswitch.active,
#menu3 layerswitch3.active {
    background: linear-gradient(180deg, #3d8ec8 0%, #2a6fa6 100%);
    color: #ffffff;
}

#menu2 layerswitch.active:hover,
#menu3 layerswitch3.active:hover {
    background: linear-gradient(180deg, #2d7bb5 0%, #225d8f 100%);
}

.layer-menu-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    background: rgba(245, 248, 251, 0.96);
    border: 1px solid rgba(25, 53, 72, 0.18);
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(15, 39, 56, 0.12);
    padding: 8px;
    backdrop-filter: blur(4px);
    margin-left: auto;
    width: 100%;
}

.layer-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 2px 2px 0;
}

.layer-menu-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #2b3e4d;
    text-transform: uppercase;
}

.layer-search-box {
    display: flex;
    justify-content: flex-end;
    flex: 1;
}

#layer-search {
    width: 100%;
    max-width: 170px;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 7px;
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.2;
    background-color: rgba(255, 255, 255, 0.95);
    color: #404040;
    box-shadow: inset 0 1px 2px rgba(10, 22, 35, 0.06);
}

#layer-search:focus {
    outline: 2px solid rgba(56, 135, 190, 0.28);
    border-color: rgba(56, 135, 190, 0.8);
}

.refname-filter-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(18, 58, 82, 0.14);
    border-radius: 8px;
    padding: 6px 8px;
}

.refname-filter-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #2b3e4d;
    text-transform: uppercase;
}

.refname-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}

.refname-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(245, 248, 251, 0.9);
    border: 1px solid rgba(18, 58, 82, 0.08);
    font-size: 11px;
    color: #404040;
    cursor: pointer;
    text-align: left;
    touch-action: manipulation;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.refname-filter-item:hover {
    background: rgba(232, 240, 247, 0.95);
    border-color: rgba(18, 58, 82, 0.18);
}

.refname-filter-item input[type="checkbox"] {
    display: none;
}

.refname-filter-item.active {
    background: var(--refname-color, #2f80ed);
    border-color: rgba(0, 0, 0, 0.12);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.refname-filter-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.refname-filter-empty {
    font-size: 11px;
    color: #666;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(245, 248, 251, 0.9);
    border: 1px solid rgba(18, 58, 82, 0.08);
}

.layer-menu-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.layer-menu-column {
    display: flex;
    flex-direction: column;
}

.layer-menu-column-header {
    background: linear-gradient(180deg, #eef5fb 0%, #e2edf7 100%);
    border: 1px solid rgba(18, 58, 82, 0.14);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: #21435d;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 8px;
    text-align: center;
}

.layer-search-empty {
    font-size: 10.5px;
    color: #666;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

/* Shared website shell */
.map-page {
    --map-header-height: 76px;
    overflow: hidden;
}

.map-site-header {
    height: var(--map-header-height);
    position: relative;
    z-index: 200;
}

#map-main {
    height: calc(100vh - var(--map-header-height));
    position: relative;
    width: 100%;
}

#map-main #map {
    bottom: 0;
    height: 100%;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
}

.map-site-header .header-inner {
    height: 100%;
}

@media (max-width: 760px) {
    .map-page {
        --map-header-height: 65px;
    }

    .map-site-header {
        height: auto;
        min-height: var(--map-header-height);
    }

    .map-site-header .header-inner {
        min-height: var(--map-header-height);
    }

    #map-main {
        height: calc(100vh - var(--map-header-height));
    }

    .technical-focus-panel {
        top: 42px;
        left: 8px;
        width: min(270px, calc(100vw - 16px));
    }
}

@media print {
    body {
        overflow: visible;
        background: #fff;
    }

    .map-site-header,
    #ribbon,
    #condition_box,
    #settingonoff,
    #lightingonoff,
    #j2gmap,
    #j2geoinfomap,
    #gmap2mb,
    #menu,
    #technical-focus-panel,
    #calculation-box_group,
    .layer-menu-panel,
    .mapboxgl-ctrl,
    .mapboxgl-control-container {
        display: none !important;
    }

    #map-main,
    #map {
        position: static !important;
        display: block !important;
        width: 100% !important;
        height: 100vh !important;
        overflow: visible !important;
    }

    .mapboxgl-canvas-container,
    .mapboxgl-canvas {
        width: 100% !important;
        height: 100% !important;
    }
}