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

h2 {
    margin: 0px;
}

h4 {
    margin-left: 40px;
    margin-bottom: 0px;
}

.container {
    display: flex;
    height: 100vh;
}

.container.custom-full-width {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

.left-panel {
    width: 20%;
    border: 1px #ccc solid;
    background-color: #f0f0f0;
    padding: 5px;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;

    .layers-info {
        padding-top: 10px;
    }

    .category-layers-info {
        ul li:first-child::after {
            content: "";
            display: block;
            width: 90%;
            height: 1px;
            background-color: #ccc;
            margin-top: 5px;
        }
    }

    .chart-info {
        margin: 20px 15px;
        border-top: 1px #ccc solid;
    }

    .category-icon {
        width: 0.7rem;
        margin-left: 5px;
        margin-right: 5px;
    }

    .all-category-checkbox {
        margin-right: 10px;
    }

    .category-checkbox {
        margin-right: 10px;
    }

    ul {
        list-style-type: none;
        margin: 5px;
    }

    li {
        margin-bottom: 5px;
    }

    .density-map-btn {
        margin: 10px;
        border-radius: 6px;
    }

    h2, h4 {
        margin: 5px;
        margin-left: 20px;
    }

    h4 {
        margin-bottom: 10px;
    }

}

.right-panel {
    width: 80%;
    height: 100%;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
    position: absolute;
}

#windy {
    height: 100%;
    width: 100%;
    position: absolute;
}

.mappler-logo {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    width: 70px;
    height: 17px;
    cursor: pointer;
}

.ol-popup {
    position: absolute;
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    bottom: 12px;
    left: -50px;
    min-width: 200px;

    .detail-btn {
        margin-top: 10px;
    }
}
.ol-popup:after, .ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}
.ol-popup:after {
    border-top-color: white;
    border-width: 10px;
    left: 48px;
    margin-left: -10px;
}
.ol-popup:before {
    border-top-color: #ccc;
    border-width: 11px;
    left: 48px;
    margin-left: -11px;
}

/*
.overlay-modal {
    position: fixed;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    width: 500px;
}
.overlay-modal .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-weight: bold;
}
.overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}
*/

/* 팝업 모달 스타일 */
.overlay-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0;
    border-radius: 10px;
    width: 400px;
    max-width: 80%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

/* 모달 헤더 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f1f1f1;
    padding: 10px 15px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: bold;
    flex-grow: 1;
    text-align: center;
    margin: 0;
}

/* 닫기 버튼 */
.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    color: #ff4d4d;
    transition: color 0.3s;
    margin-left: auto;
    margin-right: 0;
}

.close-btn:hover {
    color: #cc0000;
}

/* 모달 내용 */
.modal-content {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
}

.legend-img-error {
    color: #888;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.layer-item label {
    flex-grow: 1;
    text-align: left;
}
.layer-item i {
    text-align: right;
    cursor: pointer;
    font-size: 16px;
    color: #007bff;
}

/** 이미지 슬라이드 **/
.slider-wrapper {
    position: relative;
    width: 100%;
    height: 200px; /* 슬라이더 높이 고정 */
    overflow: visible;
    background: #f0f0f0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
  
.slider-images {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

.slider-images img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* ← 포인트! */
    flex-shrink: 0;
}

.slider-images iframe {
    max-height: 200px;
    width: 100%;
    border: none;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    background-color: rgba(0,0,0,0.5);
    color: white;
    padding: 5px;
    cursor: pointer;
    z-index: 10;
}

.arrow-left { left: 5px; }
.arrow-right { right: 5px; }

#toggle-category {
    display: none;
}
#close-category {
    display: none;
}
@media (max-width: 767px) {
    #toggle-category {
        display: inherit;
    }
    #close-category {
        display: inherit;
    }
}

/* Search UI Styles */
.search-container {
    padding: 10px;
    margin: 10px 0;
    border-bottom: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
    order: -1; /* flexbox order를 사용하여 최상단으로 이동 */
}

.search-input-wrapper {
    position: relative;
    width: 90%;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.search-container input {
    width: 100%;
    padding: 8px 35px 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    box-sizing: border-box;
}

.search-container button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-results {
    position: relative;
    width: 90%;
    margin: 5px auto 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.search-results.visible {
    display: block;
}

.search-results.hidden {
    display: none;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.no-results {
    padding: 10px;
    color: #666;
    text-align: center;
    font-size: 14px;
}

#site-title {
    padding: 15px;
    margin: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    order: -2; /* 제목을 가장 위로 */
}

#category-layers-info {
    order: 0; /* 기본 순서 */
    padding: 15px;
}

#other-layers-info {
    order: 1;
    padding: 15px;
}

#chart-info {
    order: 2;
    padding: 15px;
}

#total-value {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    margin-top: auto; /* flexbox를 사용하여 맨 아래로 밀기 */
    order: 999; /* 가장 큰 order 값으로 맨 아래에 위치 */
}

/* 모바일 화면에서의 스타일 */
@media (max-width: 768px) {
    .left-panel {
        position: fixed;
        top: 0;
        left: -300px;
        width: 300px;
        height: 100%;
    }

    .left-panel.open {
        transform: translateX(300px);
    }

    .search-container {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1001;
        margin: 0;
        padding: 10px;
        border-bottom: 1px solid #ddd;
    }
}

/* 나의 위치찾기 버튼 스타일 */
.my-location-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #cccccc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 18px;
    color: #666666;
}

.my-location-btn:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.my-location-btn:active {
    transform: scale(0.95);
}

.my-location-btn.loading {
    animation: pulse 1.5s infinite;
}

.my-location-btn.success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.my-location-btn.error {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 모바일에서의 위치찾기 버튼 스타일 */
@media (max-width: 768px) {
    .my-location-btn {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}