:root {
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    /* --border-radius: 4px; */
    --primary: #3b82f6;
    /* 밝은 파란색 */
    --primary-dark: #2563eb;
    --secondary: #64748b;
    /* 슬레이트 그레이 */
    --success: #10b981;
    /* 그린 */
    --danger: #ef4444;
    /* 레드 */
    --warning: #f59e0b;
    /* 앰버 */
    --info: #3b82f6;
    /* 블루 */

    --light-bg: #f8fafc;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.rounded-4 {
    border-radius: var(--border-radius);
}

body {
    /* font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--light-bg);
    color: #334155; */
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--light-bg);
    color: #334155;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 모달 개선 */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-body {
    padding: 1.5rem;
}

/* 버튼 스타일 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.btn-custom-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-custom-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.25);
    color: white;
}

.btn-outline-custom {
    border-color: var(--secondary);
    color: var(--secondary);
}

.btn-outline-custom:hover {
    background-color: #f1f5f9;
    color: #334155;
}

/* 입력 필드 */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    padding: 0.6rem 1rem;
    border-color: #e2e8f0;
    min-height: 48px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea.form-control {
    min-height: 120px;
}

.main-container-demo {
    display: flex;
    flex-grow: 1;
}

/* 사이드바는 기본적으로 숨김 */
#sidebar {
    display: none;
    width: 350px;
    height: 100%;
    min-width: 350px;
    background-color: #f8f9fa;
    padding: 20px;
    border-right: 1px solid #dee2e6;
    height: calc(100vh - 125px);
}
/* 데스크톱(lg) 이상에서 사이드바 표시 */
@media (min-width: 992px) {
    #sidebar {
        display: block;
    }
}

/* 사이드바 개선 */
#sidebar {
    background-color: white;
    border-radius: 0;
    box-shadow: var(--box-shadow);
    /* transition: var(--transition); */
    /* display: flex; */
    /* flex-direction: column; */
    /* top: 100px; */
    /* height: calc(100vh - 100px); */
    /* position: fixed; */
    /* left: 0; */
    /* bottom: 0; */
    /* width: 350px; */
    /* padding: 1rem; */
    /* background: white; */
    /* z-index: 10; */
    /* overflow-y: auto; */
}


.sidebar-header {
    padding: 1.0rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 20;
}

/* .side-panels {
    padding: 0.1rem;
} */

.side-panels button {
    margin-bottom: 0.15rem;
}

/* 레이아웃 스타일 */
.content-wrapper {
    flex-grow: 1;
    /* margin-left: 350px; */
    /* width: 100%; */
    /* position: relative; */
}

#sidebar.active {
    transform: translateX(0);
    display: block;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        /* width: 100%; */
        width: 350px;
    }

    .content-wrapper {
        margin-left: 0;
        /* width: 100%; */
        width: calc(100% - 350px);
    }

    .toggle-sidebar {
        display: block;
    }
}


/* 지도 컨테이너 */
#map {
    /* border-radius: var(--border-radius); */
    /* box-shadow: var(--box-shadow); */
    overflow: hidden;
    /* top: 10px; */
    /* bottom: 0; */
    height: calc(100vh - 125px);
    z-index: 1;
    /* position: absolute; */
    /* top: 0; */
    /* width: calc(100vw - 350px); */
    /* width: 100%; */
    /* height: 100vh; */
    /* left: 350px; */
}

#geocode-summary {
    text-align: right;
}

#geocode-speed {
    opacity: 0.01;
    ;
}

/* 카드와 리스트 */
.list-group-item {
    border-color: #e2e8f0;
    padding: 0.75rem 1rem;
    transition: background-color 0.15s ease;
}

.list-group-item:hover {
    background-color: #f8fafc;
}

.publicdata-item {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.publicdata-item.visualized {
    background-color: aliceblue;
    color: black;
    font-weight: 600;
    border-color: var(--primary);
}

/* 뱃지 */
.badge {
    font-weight: 500;
    border-radius: 20px;
    padding: 0.35em 0.75em;
}

/* 다운로드 옵션 */
.download-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.download-file-button {
    flex: 1 0 auto;
    min-width: 120px;
    transition: var(--transition);
    position: relative;
    margin: 5px;
}

.download-file-button:hover {
    transform: translateY(-1px);
}

/* 애니메이션 효과 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 토글 사이드바 버튼 개선 */
.toggle-sidebar {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: var(--box-shadow);
    /* position: fixed; */
    z-index: 90;
    left: 1rem;
    top: 6.0rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}


.toggle-sidebar:hover {
    background-color: var(--primary);
    color: white;
}

.toggle-sidebar-highlight {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: var(--box-shadow);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.3);
    }

    100% {
        transform: scale(1);
        box-shadow: var(--box-shadow);
    }
}

/* 결과 목록 영역 */
.geocode-list {
    /* border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-grow: 1;
    overflow-y: auto;
    height: calc(100vh - 400px); */
}

.summary-container {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    position: sticky;
    /* position: absolute; */
    bottom: 60px;
    /* bottom: 70px; */
    left: 0;
    right: 0;
}

/* 기타 UI 요소 */
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    /* transition: var(--transition); */
}

.dropdown-item {
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
}

.alert {
    border-radius: var(--border-radius);
    border: none;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #166534;
}

#loading-spinner {
    /* display: none; */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 3rem;
    height: 3rem;
}

#upload-spinner{
    display: none;
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th {
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* 제어 패널 스타일 */
.control-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    padding: 1rem;
    /* margin-bottom: 0rem; */
    margin: 0.5rem;
}

.leaflet-container {
    font: 0.8rem "Segoe UI", Arial, Helvetica, sans-serif;
    z-index: 1;
}

@media (max-width: 768px) {
    .modal-button {
        margin-left: 3rem !important;
        margin-right: 3rem !important;
    }
}

.modal-content {
    position: absolute;
}

.modal-header {
    cursor: move;
    /* 'grabbing' 대신 'move'를 사용하여 드래그 가능함을 표시 */
    position: relative;
    z-index: 10;
    /* 헤더가 항상 위에 오도록 z-index 설정 */
    padding: 1rem 1rem;
    /* 패딩 조정으로 더 넓은 드래그 영역 확보 */
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: -1;
}

/* 모달 애니메이션 개선 */
.modal.fade .modal-dialog {
    transition: transform 0.15s ease-out;
}

.modal.show .modal-dialog {
    transform: none !important;
    /* 내장된 transform 제거 */
}


/* 활성화된 네비게이션 항목 스타일 */
.navbar .nav-link.active {
    position: relative;
    font-weight: 600;
    color: var(--primary, #3b82f6) !important;
}

/* 밑줄 효과 */
.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.5rem;
    right: 0.5rem;
    height: 3px;
    background-color: var(--primary, #3b82f6);
    border-radius: 2px;
}


.geocode-popup {
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.popup-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.popup-title {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
}

.popup-coords {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.popup-body {
    max-height: 300px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .popup-body {
        max-height: 500px;
    }
}

.popup-section {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #e9ecef;
}

.popup-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.section-content {
    font-size: 0.9rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    border-bottom: 1px dotted #f0f0f0;
}

.info-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.info-label {
    color: #6c757d;
    flex: 0 0 40%;
    font-weight: 500;
}

.info-value {
    color: #212529;
    flex: 0 0 60%;
    /* text-align: right; */
    word-break: break-word;
}

.popup-footer {
    margin-top: 0.75rem;
    text-align: center;
}

.copy-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Leaflet 팝업 컨테이너 스타일 오버라이드 */
.leaflet-popup-content {
    margin: 10px 14px;
    min-width: 250px;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
}

.hd-history-link {
    color: #0d6efd;
    text-decoration: none;
    cursor: pointer;
}

.hd-history-link:hover {
    text-decoration: underline;
    color: #0a58ca;
}

.hd-history-container {
    margin-top: 0.5rem;
    /* margin-left: 1rem;
    padding: 0.5rem;
    border-left: 2px solid #e9ecef; */
    font-size: 0.8rem;
}

.hd-history-loading {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
}

.section-subtitle {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.table-sm td,
.table-sm th {
    padding: 0.25rem 0.2rem;
    font-size: 0.75rem;
}

/* 선택된 항목 스타일 */
.selected-item {
    background-color: #e7f2ff;
    border-left: 4px solid #0d6efd;
    font-weight: 500;
    color: #0d6efd;
    padding-left: 8px;
    transition: all 0.2s ease;
}

/* 마우스 오버 효과 */
#selectable li:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* 기본 리스트 아이템 스타일 */
#selectable li {
    /* border-left: 4px solid transparent;
    padding: 8px 12px; */
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

/* #selectable li:last-child {
    border-bottom: none;
} */

.notes {
    font-size: small;
    color: #666;
}

#resultTable thead th {
    min-width: 50px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#resultTable td {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.region-label {
    color: black;
    font-weight: bold;
    text-align: center;
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

.navbar-brand-img {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

#navbar-brand-logo {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.column-type {
    display: inline-block;
    min-width: 50px;
    max-width: 70px;
    text-align: center;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    background-color: #f8fafc;
    margin-right: 5px;
}

.column-type-int {
    color: #0d6efd;
}

.column-type-float {
    color: #198754;
}

.column-type-string {
    color: #ff9800;
}

.column-type-boolean {
    color: #dc3545;
}

.column-type-object {
    color: #6f42c1;
}

#sidebar .dropdown-menu {
    width: 100%;
}
#sidebar ul {
    font-size: smaller;
}

#sidebar .dropdown-item {
    width: 100%;
    /* border-radius: var(--border-radius); */
    padding: 0.3rem 0.5rem;
}

.color-ramp-item {
    display: inline-block;
    width: 100%;
    height: 14px;
    margin-right: 5px;
    /* border-radius: 50%; */
    vertical-align: middle;
}

.theme-item {
    font-size: 0.75rem;
}

.toolbar-right select {
    min-width: 100px;
    min-height: 40px;
    max-height: 40px;
    overflow-y: auto;
}


/* Tabulator 스타일 커스터마이징 */
.tabulator {
    font-size: 0.875rem;
}

.tabulator .tabulator-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tabulator .tabulator-header .tabulator-col {
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
}
.tabulator .tabulator-row {
    border-bottom: 1px solid #dee2e6;
}
.tabulator .tabulator-row:hover {
    background-color: #f8f9fa;
}

.tabulator-row .highlighted-row {
    background-color: #ffc107 !important;
}

.tabulator-row.tabulator-selected {
    background-color: #b3cbfa !important;
}

.tabulator .tabulator-cell {
    border-right: 1px solid #dee2e6;
    padding: 1px 4px;
}

.tabulator .tabulator-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* 테이블 헤더 숨김 */
/* #resultList > .tabulator-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: none;
} */




#resultList {
    border: none;
}

#resultList .tabulator {
    border: none !important;
}

#resultList .tabulator-cell {
    border-right: 0px solid #dee2e6;
}

.tabulator-row .tabulator-cell {
  padding-top: 8px;
  padding-bottom: 8px;
}

#resultList .tabulator-row {
    /* border: 1px solid #dee2e6; */
    /* margin: 0.4rem; */
    /* margin-right: 1rem; */
    /* padding-right: 1rem; */
    font-size: 0.9rem;
    border-radius: 7px;
}

#resultList .tabulator-row-even {
    background-color:transparent;
}

#resultList .tabulator-row-odd {
    background-color:transparent;
}


#resultList .tabulator-tableholder {
    overflow-x: hidden !important;
}

#resultList .badge {
    padding: 0.55em 0.75em;
}

.bg-representative {
    --bs-bg-opacity: 1;
    background-color: orchid !important;
}

.address-cell {
    white-space: normal !important;
    word-break: auto-phrase !important;
    /* overflow-wrap: break-word; */
    /* padding-right: 40px; */
    width: calc(100% - 50px) !important;
}

#colorRampDropdown {
    height: 2rem;
}

.legend-item {
    font-size: 0.75rem;
    white-space: nowrap;
    height: 20px;
    display: flow-root;
    margin-bottom: 5px
    /* align-items: left; */
}

.legend-color {
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-right: 5px;
    /* border-radius: 3px; */
}

.legend-text {
    /* max-width: 100px; */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* 테마 패널 스타일 */
.theme-panel-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
}

/* 패널 헤더 */
.panel-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.panel-title {
    margin: 0;
    font-weight: 700;
    color: #1e293b;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

/* 컨트롤 섹션 */
.control-section {
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

/* .control-section:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
} */

.control-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

/* 테마 그리드 */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.theme-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

.theme-item:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.theme-item.active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.theme-item i {
    font-size: 1.4rem;
}

.theme-item span {
    font-size: 0.8rem;
    text-align: center;
}

/* 커스텀 드롭다운 */
.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-button {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #374151;
    font-weight: 500;
}

.dropdown-button:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.dropdown-button:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dropdown-text {
    flex-grow: 1;
    text-align: left;
}

.dropdown-icon {
    transition: transform 0.3s ease;
    color: #64748b;
}

.dropdown-button[aria-expanded="true"] .dropdown-icon {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}

.custom-dropdown-menu .dropdown-item {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    color: #374151;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.custom-dropdown-menu .dropdown-item:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    transform: translateX(4px);
}

/* 커스텀 셀렉트 */
.custom-select {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    width: 100%;
    color: #374151;
    font-weight: 500;
    transition: all 0.3s ease;
}

.custom-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 색상 램프 관련 스타일 */
.color-ramp-dropdown .dropdown-button {
    padding: 0.5rem 1rem;
}

.color-preview {
    width: 40px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-right: 0.75rem;
}

.color-ramp-menu {
    min-width: 220px;
}

.color-ramp-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem !important;
}

.color-sample {
    width: 50px;
    height: 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.color-ramp-item span {
    font-size: 0.9rem;
    color: #374151;
}

.color-ramp-item:hover span {
    color: white;
}

/* 슬라이더 스타일 */
.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.custom-range {
    flex-grow: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.custom-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.opacity-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 3rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* 범례 컨테이너 */
.legend-container {
    background: #f8fafc;
    border-radius: 10px;
    /* padding: 1rem; */
    /* border: 1px solid #e2e8f0; */
    min-height: 60px;
    /* display: flex; */
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-style: italic;
}

.legend-container:empty::before {
    content: "범례가 여기에 표시됩니다";
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .theme-panel-container {
        padding: 1rem;
    }
    
    .control-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .theme-item {
        padding: 0.75rem 0.25rem;
    }
    
    .theme-item i {
        font-size: 1.2rem;
    }
    
    .theme-item span {
        font-size: 0.75rem;
    }
    
    .panel-title {
        font-size: 1rem;
    }
    
    .control-label {
        font-size: 0.9rem;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .theme-panel-container {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
    }
    
    .control-section {
        background: #1e293b;
        border-color: #475569;
    }
    
    .panel-title,
    .control-label {
        color: #e2e8f0;
    }
    
    .dropdown-button,
    .custom-select {
        background: #334155;
        border-color: #64748b;
        color: #e2e8f0;
    }
    
    .theme-item {
        background: #334155;
        border-color: #64748b;
        color: #cbd5e1;
    }
    
    .theme-item:hover {
        background: #475569;
    }
    
    .legend-container {
        background: #334155;
        border-color: #64748b;
        color: #94a3b8;
    }
}

/* 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* .control-section {
    animation: fadeInUp 0.3s ease-out;
} */

/* .control-section:nth-child(2) { animation-delay: 0.1s; }
.control-section:nth-child(3) { animation-delay: 0.2s; }
.control-section:nth-child(4) { animation-delay: 0.3s; }
.control-section:nth-child(5) { animation-delay: 0.4s; }
.control-section:nth-child(6) { animation-delay: 0.5s; } */

/* 스크롤바 스타일링 */
.theme-panel-container::-webkit-scrollbar {
    width: 6px;
}

.theme-panel-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.theme-panel-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
}

.theme-panel-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}
/* 테마 패널 스타일 */


/* 툴바 스타일 */
.modern-toolbar {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.toolbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  max-width: 100vw;
  margin: 0 auto;
  gap: 1rem;
}

/* 왼쪽 액션 버튼 그룹 */
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* flex-wrap: wrap; */
}

.action-buttons-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.action-buttons-mobile {
  display: flex;
  min-width: auto;
}

/* 버튼 스타일 */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
  min-width: 50px;
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.action-btn.secondary {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(100, 116, 139, 0.2);
}

.action-btn.secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.action-btn:disabled {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.action-btn i {
  font-size: 1rem;
}

/* 드롭다운 스타일 */
.modern-dropdown {
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  margin-top: 0.5rem;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.modern-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  background: none;
  color: #374151;
  font-weight: 500;
  transition: all 0.3s ease;
  text-decoration: none;
}

.modern-dropdown .dropdown-item:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  transform: translateX(4px);
}

.modern-dropdown .dropdown-item i {
  font-size: 1rem;
  width: 16px;
  text-align: center;
}

.dropdown-header {
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.dropdown-header .form-check {
  margin: 0;
}

.dropdown-header .form-check-label {
  font-size: 0.85rem;
  color: darkblue;
  font-weight: 500;
}

.dropdown-header .badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

.download-menu {
  min-width: 220px;
}

.toolbar-center {
    flex-grow: 1;
    text-align: center;
}

@media (max-width: 767px) {
    .toolbar-center {
        display: none;
    }
}

/* 오른쪽 컨트롤 그룹 */
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  /* flex-wrap: wrap; */
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 100px;
}

.control-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modern-select {
  padding: 0.5rem 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #374151;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  cursor: pointer;
  min-width: 100px;
}

.modern-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modern-select:hover {
  border-color: #3b82f6;
}

/* 반응형 디자인 */
@media (min-width: 999768px) {
/* @media (min-width: 768px) { */
  .action-buttons-desktop {
    display: flex;
  }
  
  .action-buttons-mobile {
    display: none;
  }
  
  .desktop-text {
    display: inline;
  }
  
  /* .toolbar-container {
    padding: 1rem 2rem;
  } */
  
  .control-group {
    min-width: 120px;
  }
}

@media (max-width: 767px) {
  .toolbar-container {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  
  .desktop-text {
    display: none;
  }
  
  .action-btn span {
    display: none;
  }
  
  .action-btn {
    padding: 0.5rem;
  }
  
  .control-group {
    min-width: 80px;
  }
  
  .control-label {
    font-size: 0.7rem;
  }
  
  .modern-select {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
  
  .toolbar-right {
    gap: 0.5rem;
  }
}

/* 로딩 상태 */
.action-btn.loading {
  pointer-events: none;
}

.action-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
  .modern-toolbar {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-color: #475569;
  }
  
  .modern-dropdown {
    background: rgba(30, 41, 59, 0.95);
  }
  
  .modern-dropdown .dropdown-item {
    color: #e2e8f0;
  }
  
  .modern-select {
    background: #334155;
    border-color: #64748b;
    color: #e2e8f0;
  }
  
  .control-label {
    color: #94a3b8;
  }
}

/* 애니메이션 */

.toolbar-container > * {
  animation: fadeInUp 0.3s ease-out;
}

/* 
.toolbar-left > *:nth-child(1) { animation-delay: 0.1s; }
.toolbar-left > *:nth-child(2) { animation-delay: 0.2s; }
.toolbar-left > *:nth-child(3) { animation-delay: 0.3s; }
.toolbar-right > *:nth-child(1) { animation-delay: 0.4s; }
.toolbar-right > *:nth-child(2) { animation-delay: 0.5s; } 
*/

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* 네비게이션 스타일 */
.navbar {
  /* padding: 1rem 0; */
  transition: all 0.3s ease;
  z-index: 100;
}

.navbar-brand {
  font-weight: 700;
}

.nav-link {
  color: var(--dark-text);
  font-weight: 500;
}
