html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
body {
    box-sizing: border-box;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main {
    flex: 1;               /* body의 남은 공간을 모두 차지 */
    display: block;
    flex-direction: column;
    min-height: 600px;     /* 최소 높이 보장 */
    justify-content: space-between;  /* 요소들을 균등하게 분배 */
}
.header {
    flex: 0 0 auto;
    padding: 1rem;
    text-align: left;
}
.search-bar {
    display: flex;
    justify-content: left;
    align-items: center;
    gap: 8px;
    padding: 0 1rem 1rem 1rem;
    flex: 0 0 auto;
    width: 50%;
    box-sizing: border-box;
    position: relative;
    margin-bottom: 0;      /* 하단 마진 제거 */
}
#search-input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem;
    font-size: 1rem;
}
#search-button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}
#results {
    display: flex;
    width: 100%;
    align-items: center;   /* 중앙 정렬로 변경 */
    justify-content: center;
    flex: 0 1 auto;        /* 내용 크기만큼만 차지 */
    min-height: 0;         /* flex 아이템이 축소될 수 있도록 */
    padding: 1rem 0;       /* 일정한 상하 여백 */
}
#map-wrapper {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: block;
}
#map {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    flex: none;
    display: block;
    background: lightgray;
}

/* Leaflet 지도 컨테이너가 부모의 크기를 따르도록 설정 */
#map .leaflet-container {
    width: 100% !important;
    height: 100% !important;
}
#viewer {
    background: #f5f5f5;
    position: relative;
    width: 100%;           /* 너비를 100%로 설정 */
    height: 100%;          /* 높이를 100%로 설정 */
}
.aspect-ratio-box {
    width: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 16px;
    text-align: center;
    background: none;
    border: none;
    border-radius: 0;
}
#save {
    display: flex;
    justify-content: right;
    align-items: center;
    padding: 0 1rem 1rem 1rem;
    margin: 0;             /* 마진 제거 (space-between이 처리) */
}
#save-button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

/* 커스텀 마커 스타일 */
.custom-marker {
    background: transparent;
    border: none;
}
.custom-marker i {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Mapillary 마커 스타일 */
.mapillary-marker {
    background: transparent;
    border: none;
}
.mapillary-marker i {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.8));
}

/* 선택된 마커는 더 높은 z-index로 최상단에 표시 */
.leaflet-interactive.selected {
    z-index: 9999 !important;
}

/* 부채꼴은 마커들 아래에 그려지도록 낮은 z-index 설정 */
.leaflet-overlay-pane svg {
    z-index: 100 !important;
}

/* FoV 컨트롤 스타일 */
.viewer-control {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.fov-button {
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

.fov-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

.fov-slider {
    display: none;
    background: rgba(0, 0, 0, 0.6);
    padding: 12px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 180px;
    position: relative;
}

.viewer-control:hover .fov-slider {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fov-slider input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
}

.fov-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.fov-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.fov-slider #fov-value {
    color: #ffffff;
    font-size: 13px;
    min-width: 24px;
    text-align: right;
}

#autocomplete-list {
    position: absolute;
    z-index: 2000;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    min-width: 0;
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    left: 0;
    top: 100%;
    display: none;
}
.autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 15px;
    color: #222;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    transition: background 0.15s;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item:hover,
.autocomplete-item.active {
    background: #e6f0ff;
    color: #0066ff;
}

.image-type-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    pointer-events: none;
    user-select: none;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 반응형 디자인 - 큰 화면에서 더 나은 비율 */
@media (min-height: 800px) {
    #map, #viewer {
        min-height: 500px;  /* 큰 화면에서 최소 높이 증가 */
    }
}

@media (min-height: 1000px) {
    #map, #viewer {
        min-height: 600px;  /* 매우 큰 화면에서 최소 높이 더 증가 */
    }
}

/* 작은 화면에서의 최적화 */
@media (max-height: 600px) {
    .header {
        padding: 0.5rem;
    }
    
    .search-bar {
        padding: 0 1rem 0.5rem 1rem;
    }
    
    #save {
        padding: 0 1rem 0.5rem 1rem;
        margin: 1rem 0;
    }
}

/* 큰 화면에서 일정한 간격 유지 */
@media (min-height: 800px) {
    #results {
        padding: 1.5rem 0;  /* 큰 화면에서도 일정한 패딩 */
    }
} 