:root {
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --excel-color: #28a745;
    --excel-hover-color: #218838;
    --border-color: #ddd;
    --bg-light: #f9f9f9;
    --text-up: #e74c3c;
    --text-down: #3498db;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /*background-color: #f8f9fa;*/
    color: #333;
    line-height: 1.6;
}

#app {
    display: flex;
    flex-direction: column;
    height: 96vh;
}

/* 네비게이션 스타일은 공통 헤더 템플릿에서 관리됩니다 */


.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 10px 40px 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    width: 280px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
}

.search-btn:hover {
    color: #3498db;
}

/* 사용자 메뉴 스타일은 공통 헤더 템플릿에서 관리됩니다 */

/* 드롭다운 메뉴와 로그인 버튼 스타일은 공통 헤더 템플릿에서 관리됩니다 */

.main-container {
    padding: 20px;
    height: 70vh;
}


/* [수정] 타이틀과 엑셀 버튼을 위한 헤더 컨테이너 */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.header-container h1 {
    margin: 0;
    /* h1의 기본 마진 제거 */
}

.header-button {
    padding: 8px 15px;
    background-color: var(--excel-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.header-button:hover {
    background-color: var(--excel-hover-color);
}

.header-button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

.header-button-search {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.header-button-search:hover {
    background-color: var(--primary-hover-color);
}

.header-button-search:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

/* [추가] 로그인 UI 관련 스타일 */
.user-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #eee;
}

.user-info span {
    font-weight: bold;
    font-size: 15px;
}

.logout-button {
    background-color: #6c757d;
}

.logout-button:hover {
    background-color: #5a6268;
}

/* [추가] 단지비교 버튼 스타일 */
.deal-cnt-button,
.compare-button,
.interest-set-button,
.interest-unset-button,
.grid-set-button,
.grid-unset-button {
    padding: 8px 10px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.deal-cnt-button {
    background-color: #42c1b6;
    /* 보라색 계열 */
}

.compare-button {
    background-color: #6f42c1;
    /* 보라색 계열 */
}

.compare-button:hover {
    background-color: #5a359a;
}

/* [추가] 관심단지 설정 버튼 스타일 */
.interest-set-button {
    background-color: #ffc107;
    /* 노란색 계열 */
    color: #343a40;
    /* 어두운 글자색 */
}

.interest-set-button:hover {
    background-color: #e0a800;
}

/* [추가] 관심단지 해제 버튼 스타일 */
.interest-unset-button {
    background-color: #ffc107;
    /* 노란색 계열 */
    color: #343a40;
    /* 어두운 글자색 */
    /*background-color: #17a2b8; */
    /* 청록색 계열 */
}

.interest-unset-button:hover {
    background-color: #e0a800;
    /*background-color: #138496;*/
}

/* [추가] 단지비교 버튼 스타일 */
.grid-set-button {
    background-color: #43b7e8;
    /* 보라색 계열 */
}

.grid-set-button:hover {
    background-color: #0486bd;
}

.grid-unset-button {
    background-color: #43b7e8;
    /* 보라색 계열 */
}

.grid-unset-button:hover {
    background-color: #0486bd;
}

/* [수정] 검색 폼 레이아웃 변경 */
.search-form {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-light);
    display: flex;
    flex-direction: row;
    /* 가로 정렬 */
    align-items: stretch;
    /* 자식 요소들의 높이를 맞춤 */
    gap: 20px;
}

/* [추가] 검색 입력 필드들을 감싸는 컨테이너 */
.search-inputs-container {
    flex-grow: 1;
    /* 남은 공간을 모두 차지 */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-field-group {
    display: flex;
    align-items: center;
}

.search-row label {
    font-weight: bold;
    margin-right: 5px;
    padding-left: 2px;
}

.search-row input[type="text"],
.search-row input[type="number"],
.search-row select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
}

.search-row input[type="number"] {
    width: 100px;
}

.search-row .range-separator {
    margin: 0 5px;
}

/* [수정] 검색/초기화 버튼 컨테이너 스타일 */
.button-row {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    /* 버튼들을 세로로 배치 */
    justify-content: space-between;
    /* 버튼들을 위아래로 분산 */
    gap: 10px;
}

.button-row button {
    flex-grow: 1;
    /* 버튼 높이가 컨테이너에 맞춰지도록 함 */
}

.search-form button {
    padding: 8px 15px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.search-form button:hover {
    background-color: var(--primary-hover-color);
}

.search-form button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}


/* Tabulator 및 기타 스타일 (변경 없음) */
#tabulator-grid,
#naver-croll-data-grid {
    width: 100%;
    border: 1px solid var(--border-color);
    background-color: white;
    font-size: 13px;
}

.price-up {
    color: var(--text-up);
    font-weight: 500;
}

.price-down {
    color: var(--text-down);
    font-weight: 500;
}

.clickable-cell {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 500;
}

.clickable-cell:hover {
    text-decoration: underline;
}

.portal-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.portal-link a:hover {
    text-decoration: underline;
}

.price-bar-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.price-bar {
    position: absolute;
    height: 80%;
    background-color: rgba(0, 123, 255, 0.2);
    border-radius: 2px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.price-bar.red {
    background-color: rgba(255, 99, 71, 0.3);
}

/* Tomato */
.price-bar.yellow {
    background-color: rgba(255, 215, 0, 0.3);
}

/* Gold */
.price-bar.blue {
    background-color: rgba(65, 105, 225, 0.3);
}

/* RoyalBlue */
.modal-content {
    background: white;
    padding: 0px;
    border-radius: 10px;
    width: 90%;
    max-width: 1500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 100vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 0px;
    padding: 5px 20px
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.modal-close {
    cursor: pointer;
    font-size: 2rem;
    font-weight: bold;
    color: #888;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

.detail-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0px 12px;
    font-size: 14px;
}

.detail-grid dt {
    font-weight: bold;
    color: #555;
    padding-left: 8px;
}

.detail-grid dd {
    margin: 0;
    color: #333;
}

/* 상태 표시 배경 */
.tabulator-cell .status-active {
    color: #fff;
    background: #56c060;
    border-radius: 5px;
    padding: 2px 9px;
}

.tabulator-cell .status-leave {
    color: #fff;
    background: #e47e56;
    border-radius: 5px;
    padding: 2px 9px;
}

.tabulator-cell .status-wait {
    color: #212531;
    background: #ffe47e;
    border-radius: 5px;
    padding: 2px 9px;
}

/* [추가] 헤더 강조를 위한 CSS 클래스 */
.highlight-header .tabulator-col-content {
    background-color: #ffe4e1;
    /* 연한 핑크/빨강 계열 배경색 */
    color: #d9534f;
    /* 어두운 빨강 계열 글자색 */
    font-weight: bold;
}


.login-button {
    padding: 8px 15px;
    background-color: #4285F4;
    /* 구글 브랜드 색상 */
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* [추가] 로그인 UI 관련 스타일 */

/* Existing styles for modal-overlay, modal-content, modal-header, modal-body, detail-grid etc. will remain */

/* New styles for content-wrapper, map-container, facilities-panel and its contents */
.content-wrapper {
    display: grid;
    grid-template-columns: 400px 2fr 1fr;
    /* Info | Map | Facilities Panel */
    gap: 15px;
    height: 100%;
    /* 모달 베디 전체 높이 사용 */
    align-items: stretch;
    /* 모든 영역이 동일한 높이를 가지도록 */
    overflow: hidden;
    /* 그리드 자체는 오버플로우 방지 */
    padding: 15px 15px;
}

.apartment-info-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    overflow-y: auto;
    /* 단지정보 영역 내에서만 스크롤 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    height: 100%;
    /* 그리드 높이에 맞춤 */
}

.map-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    /* 지도 영역은 스크롤 방지 */
    display: flex;
    flex-direction: column;
    height: 100%;
    /* 그리드 높이에 맞춤 */
    padding: 20px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.apartment-info-section {
    width: 100%;
    padding-bottom: 10px;
    overflow-y: auto;
    height: 100%;
}

/* map-wrapper 스타일은 위에 정의됨 */
/* .map-wrapper {
            justify-content: center;
        } */

#kakao-map {
    width: 100%;
    height: 400px;
    max-height: calc(100% - 40px);
    border-radius: 8px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.facilities-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 10px;
    overflow: hidden;
    /* 패널 자체는 스크롤 방지 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    height: 100%;
    /* 그리드 높이에 맞춤 */
    display: flex;
    flex-direction: column;
}

.facilities-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
    text-align: center;
    flex-shrink: 0;
    /* 제목이 축소되지 않도록 */
}

.facilities-content {
    flex: 1;
    overflow-y: auto;
    /* 편의시설 컨텐츠만 스크롤 */
    padding-right: 5px;
    /* 스크롤바 여백 */
}

.facility-category {
    margin-bottom: 15px;
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 1px 10px;
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
    border-radius: 10px;
    font-weight: bold;
}

.category-icon {
    margin-right: 8px;
    font-size: 1.2em;
}

.category-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.9em;
}

.facility-item {
    background: aliceblue;
    margin: 5px 0;
    padding: 3px 10px;
    border-radius: 10px;
    border-left: 4px solid #74b9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.facility-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.facility-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    display: ruby;
}

.facility-address {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.facility-distance {
    color: #74b9ff;
    font-size: 0.85em;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        /* Stack info, map and facilities */
        height: auto;
    }

    .map-container {
        height: 400px;
        /* Adjust map height for stacked view */
    }

    #kakao-map {
        height: 350px;
        /* Adjust map height for stacked view */
    }

    .facilities-panel {
        height: 400px;
        /* Adjust facilities panel height */
    }
}

/* 로딩 오버레이 스타일 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-size: 1.5rem;
}

.loading-message {
    text-align: center;
}

.loading-message .fa-spinner {
    margin-right: 15px;
    font-size: 2rem;
}

.tabulator .tabulator-header {
    padding-left: 2px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
    /* 타이틀과 버튼을 양 끝으로 정렬하기 위해 너비 추가 */
}

.dd-flex-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.dd-flex-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chart-size-toggle-btn {
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f0f0f0;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.chart-size-toggle-btn:hover {
    background-color: #e0e0e0;
}

.price-history-chart-container {
    position: relative;
    /* 자식 요소의 기준이 되도록 */
    transition: all 0.4s ease-in-out;
    height: 250px;
    /* 기본 높이 */
    width: 100%;
    margin-top: 24px;
}

/* 확대된 차트를 위한 전역 오버라이드 */
body.chart-fullscreen .modal-overlay,
body.chart-fullscreen .modal-content,
body.chart-fullscreen .modal-body,
body.chart-fullscreen .content-wrapper,
body.chart-fullscreen .apartment-info-wrapper {
    overflow: visible !important;
}

body.chart-fullscreen .price-history-chart-container.expanded {
    position: absolute !important;
    top: 0px !important;
    left: 0px !important;
    right: 25px !important;
    bottom: 25px !important;
    width: 100% !important;
    height: auto !important;
    background-color: rgba(255, 255, 255, 1) !important;
    z-index: 10001 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    border-radius: 10px !important;
    transform: none !important;
    overflow: visible !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

body.chart-fullscreen .price-history-chart-container.expanded .chart-header {
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 10px !important;
}

body.chart-fullscreen .price-history-chart-container.expanded canvas {
    flex: 1 !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.modal-body {
    height: 800px;
    overflow: auto;
    /* 모달 베디 자체는 스크롤 방지 */
}

.modal-content {
    /* Ensure the modal can contain the absolutely positioned chart */
    position: relative;
    /* 확대된 차트의 기준점 */
}

.desktop-only-buttons {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 모바일 네비게이션 스타일은 공통 헤더 템플릿에서 관리됩니다 */
@media (max-width: 1024px) {


    .desktop-only-buttons {
        display: none;
        /* 1024px 이하에서 숨김 */
    }

    /* 검색 폼 반응형 */
    .search-form {
        flex-direction: column;
        /* 세로로 쌓이도록 */
    }

    .search-row {
        flex-wrap: wrap;
        /* 필드들이 다음 줄로 넘어가도록 */
        justify-content: center;
        /* 중앙 정렬 */
    }

    .search-field-group {
        width: 48%;
        /* 두 개씩 배치 */
    }

    .search-field-group label {
        width: 100%;
        /* 라벨이 한 줄 차지 */
        text-align: left;
    }

    .search-row input[type="text"],
    .search-row input[type="number"],
    .search-row select {
        width: 100%;
        /* 입력 필드 너비 100% */
    }

    .button-row {
        flex-direction: row;
        /* 버튼 가로 배치 */
        width: 100%;
    }

    .button-row button {
        width: 48%;
        /* 버튼 두 개씩 배치 */
    }

    /* 모달 내부 레이아웃 반응형 */
    .content-wrapper {
        grid-template-columns: 1fr;
        /* 한 컬럼으로 변경 */
        grid-template-rows: auto auto auto;
        /* 3개 영역에 따라 높이 자동 조절 */
        height: auto;
    }

    .apartment-info-wrapper,
    .map-wrapper {
        padding: 10px;
        min-height: 300px;
    }

    .map-wrapper {
        min-height: 350px;
    }

    .apartment-info-section {
        width: 100%;
    }

    .price-history-chart-container {
        width: 100%;
        /* 차트 컨테이너 너비 100% */
    }

    .facilities-panel {
        width: 100%;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    /* 네비게이션 스타일은 공통 헤더 템플릿에서 관리됩니다 */

    .news-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }

    .search-field-group {
        width: 100%;
        /* 한 개씩 배치 */
    }

    .button-row button {
        width: 100%;
        /* 버튼 한 개씩 배치 */
    }
}

@media (max-width: 480px) {
    /* 네비게이션 스타일은 공통 헤더 템플릿에서 관리됩니다 */

    .search-input {
        width: 150px;
        font-size: 13px;
    }

    /* 사용자 액션 스타일은 공통 헤더 템플릿에서 관리됩니다 */

    /* 모바일 지도 최적화 */
    .map-wrapper {
        min-height: 300px !important;
        padding: 12px;
    }

    #kakao-map {
        min-height: 220px !important;
        height: 220px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chart-size-toggle-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* 컬럼 설정 모달 스타일 */
.column-settings-modal {
    max-width: 600px;
}

.column-list-container {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
}

.column-list-header {
    margin-bottom: 10px;
}

.column-sortable-list {
    list-style: none;
    padding: 0;
}

.column-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    cursor: grab;
}

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

.drag-handle {
    margin-right: 10px;
    color: #999;
    cursor: grab;
}

.column-item input[type="checkbox"] {
    margin-right: 5px;
}

.column-item label {
    cursor: pointer;
}

.modal-actions {
    text-align: right;
}

.custom-select-wrapper {
    position: relative;
    width: 180px;
    /* 너비 조정 */
    min-width: 120px;
    /* 최소 너비 설정 */
}

.custom-select-display {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
    /* input과 높이 맞춤 */
    box-sizing: border-box;
    font-size: 14px;
}

.custom-select-display span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 450px;
    overflow-y: auto;
    z-index: 1000;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.custom-select-option {
    padding: 2px 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.custom-select-option:hover {
    background-color: #f0f0f0;
}

.custom-select-option.selected {
    background-color: #007bff;
    color: white;
    font-weight: 500;
}

.custom-select-option input[type="checkbox"] {
    margin-right: 8px;
}

.custom-select-option label {
    cursor: pointer;
    flex-grow: 1;
}

/* 단지특성 배지 스타일 */
.apt-badge {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 4px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: bold;
    line-height: 1;
    vertical-align: middle;
}

.badge-station {
    background-color: #FF5733;
    color: white;
}

/* 역세권 */
.badge-near-station {
    background-color: #FFBD33;
    color: white;
}

/* 준역세권 */
.badge-large {
    background-color: #33FF57;
    color: black;
}

/* 대단지 */
.badge-new {
    background-color: #3357FF;
    color: white;
}

/* 신축 */
.badge-school {
    background-color: #BD33FF;
    color: white;
}

/* 초품아 */

/* 모바일 필터 관련 스타일 */
.mobile-filter-toggle {
    display: none;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.mobile-filter-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-filter-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.mobile-filter-btn:active {
    transform: translateY(0);
}

.mobile-filter-btn .transition-icon {
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.mobile-filter-btn .transition-icon.rotated {
    transform: rotate(180deg);
}

.mobile-filter-btn span {
    flex-grow: 1;
    text-align: left;
    margin-left: 8px;
}

/* 모바일 필터 관련 스타일 */
.mobile-filter-toggle {
    display: none;
    /* 기본적으로 숨김 (PC) */
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

/* 모바일 및 태블릿 환경에서 필터 토글 버튼 표시 및 검색 조건 숨김/표시 */
@media (max-width: 1024px) {
    .mobile-filter-toggle {
        display: block;
        /* 1024px 이하에서 표시 */
        padding: 10px 15px;
    }

    .mobile-filter-btn {
        padding: 10px 14px;
        font-size: 15px;
    }

    .search-inputs-container.mobile-hidden {
        display: none !important;
        /* 모바일에서 숨김 */
    }

    .search-inputs-container {
        padding: 0 20px 20px;
        /* 모바일에서 패딩 조정 */
    }
}

/* 더 작은 모바일 화면에 대한 추가 조정 */
@media (max-width: 768px) {
    .search-inputs-container {
        padding: 0 15px 15px;
        /* 더 작은 화면에서 패딩 조정 */
    }
}

/* ========================================
   토스트 알림 스타일
   ======================================== */

/* 토스트 컨테이너 - 우측 상단 고정 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* 개별 토스트 메시지 */
.toast-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: white;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
}

/* 타입별 색상 - success */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-content i {
    color: #10b981;
}

/* 타입별 색상 - error */
.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-content i {
    color: #ef4444;
}

/* 타입별 색상 - info */
.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-content i {
    color: #3b82f6;
}

/* 토스트 내용 */
.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.toast-content i {
    font-size: 18px;
}

.toast-content span {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

/* 닫기 버튼 */
.toast-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #1f2937;
}

.toast-close i {
    font-size: 14px;
}

/* 슬라이드 인 애니메이션 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    .toast-message {
        background: #1f2937;
    }

    .toast-content span {
        color: #f9fafb;
    }

    .toast-close {
        color: #9ca3af;
    }

    .toast-close:hover {
        color: #f9fafb;
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .toast-container {
        top: 60px;
        right: 10px;
        left: 10px;
    }

    .toast-message {
        min-width: auto;
        max-width: none;
    }
}

/* ==================== 도움말 시스템 스타일 ==================== */

/* 1. 도움말 아이콘 버튼 */
.help-icon-btn {
    border: 2px solid #3b82f6;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 0;
}

.help-icon-btn:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.help-icon-btn:active {
    transform: scale(1.05);
}

/* 2. 도움말 모달 커스터마이징 */
.help-modal-content {
    width: 900px;
    max-width: 95vw;
    max-height: 85vh;
}

.help-modal-body {
    padding: 0;
    height: calc(85vh - 60px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 3. 탭 시스템 */
.help-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    gap: 4px;
    padding: 0 20px;
    background: #f9fafb;
    flex-shrink: 0;
}

.help-tab-btn {
    padding: 12px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.help-tab-btn:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.help-tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: white;
    font-weight: 600;
}

.help-tab-btn i {
    font-size: 16px;
}

/* 4. 탭 콘텐츠 영역 */
.help-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.help-section {
    animation: fadeIn 0.3s ease-in;
}

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

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

.help-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-top: 24px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section h3:first-child {
    margin-top: 0;
}

.help-section h3 i {
    color: #3b82f6;
    font-size: 20px;
}

.help-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 8px 0 4px 0;
}

.help-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 12px 0;
}

.help-intro {
    font-size: 15px;
    line-height: 1.8;
    color: #374151;
    padding: 16px;
    background: #f3f4f6;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
    margin-bottom: 24px;
}

/* 5. 워크플로우 스텝 */
.help-workflow {
    margin: 16px 0;
}

.workflow-step {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding-left: 8px;
    border-left: 2px solid #e5e7eb;
    position: relative;
}

.workflow-step:last-child {
    border-left-color: transparent;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
    position: relative;
    left: -9px;
}

.step-content {
    flex: 1;
    padding-bottom: 4px;
}

.step-content h4 {
    color: #1f2937;
    font-size: 15px;
    margin: 0 0 4px 0;
}

.step-content p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* 6. Tip 박스 */
.help-tip {
    padding: 12px 16px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #92400e;
}

.help-tip i {
    color: #f59e0b;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.help-tip strong {
    color: #78350f;
}

/* 7. Example 박스 */
.help-example {
    padding: 12px 16px;
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: #1e40af;
}

.help-example i {
    color: #3b82f6;
    font-size: 16px;
}

.help-example strong {
    color: #1e3a8a;
    font-weight: 600;
}

/* 8. Definition List */
.help-definition {
    margin: 12px 0;
    padding-left: 8px;
}

.help-definition dt {
    font-weight: 600;
    color: #374151;
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 14px;
}

.help-definition dt:first-child {
    margin-top: 0;
}

.help-definition dd {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    margin-left: 0;
    margin-bottom: 8px;
}

/* 9. Feature Grid */
.help-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.feature-category {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}

.feature-category h3 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.feature-item {
    padding: 12px;
    background: white;
    border-radius: 6px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.feature-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.feature-header i {
    color: #3b82f6;
    font-size: 16px;
}

.feature-header strong {
    font-size: 14px;
    color: #1f2937;
}

.feature-item p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* 10. 멤버십 배지 */
.tier-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 8px;
}

.tier-badge.free {
    background: #e5e7eb;
    color: #6b7280;
}

.tier-badge.normal {
    background: #dbeafe;
    color: #1e40af;
}

.tier-badge.premium {
    background: #fef3c7;
    color: #92400e;
}

.tier-badge.vip {
    background: #fce7f3;
    color: #9f1239;
}

/* 11. 현재 등급 표시 */
.current-grade-display {
    padding: 16px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

.current-grade-display i {
    font-size: 28px;
    color: #3b82f6;
}

.current-grade-display strong {
    color: #374151;
}

.current-grade {
    color: #3b82f6;
    font-weight: 700;
    font-size: 18px;
}

/* 12. 멤버십 비교 테이블 */
.membership-table-container {
    overflow-x: auto;
    margin: 16px 0;
}

.membership-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.membership-table thead {
    background: #f9fafb;
}

.membership-table th {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.membership-table th:first-child {
    text-align: left;
    padding-left: 16px;
}

.membership-table tbody tr {
    transition: background 0.2s ease;
}

.membership-table tbody tr:hover {
    background: #f9fafb;
}

.membership-table td {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.membership-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: #374151;
    padding-left: 16px;
}

.membership-table tbody tr:last-child td {
    border-bottom: none;
}

.membership-table .text-success {
    color: #10b981;
    font-size: 18px;
}

.membership-table .text-muted {
    color: #d1d5db;
    font-size: 18px;
}

/* 13. 업그레이드 CTA */
.upgrade-cta {
    padding: 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 8px;
    text-align: center;
    color: white;
    margin-top: 24px;
}

.upgrade-cta i {
    font-size: 32px;
    margin-bottom: 8px;
}

.upgrade-cta p {
    margin: 8px 0 16px 0;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.upgrade-btn {
    display: inline-block;
    padding: 12px 24px;
    background: white;
    color: #2563eb;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.upgrade-btn:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.upgrade-btn i {
    margin-right: 6px;
}

/* 14. FAQ 스타일 */
.faq-list {
    margin-top: 16px;
}

.faq-item {
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.faq-question {
    padding: 14px 16px;
    background: #f9fafb;
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faq-question i {
    color: #3b82f6;
    font-size: 12px;
}

.faq-answer {
    padding: 12px 16px 14px 42px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.faq-answer p {
    font-size: 14px;
    color: #4b5563;
    margin: 0;
    line-height: 1.6;
}

.faq-answer strong {
    color: #3b82f6;
    font-weight: 600;
}

/* 15. CSS-Only 툴팁 시스템 */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    pointer-events: none;
    animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 16. 반응형 조정 - Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .help-modal-content {
        width: 90%;
    }

    .help-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .help-tabs::-webkit-scrollbar {
        height: 4px;
    }

    .help-tabs::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 2px;
    }

    .help-tab-btn {
        font-size: 13px;
        padding: 10px 16px;
    }

    .help-feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
    }
}

/* 17. 반응형 조정 - Mobile (< 768px) */
@media (max-width: 767px) {
    .help-icon-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
        border-width: 1.5px;
    }

    .help-modal-content {
        width: 95%;
        max-width: 95vw;
        height: 90vh;
        max-height: 90vh;
    }

    .help-modal-body {
        height: calc(90vh - 60px);
    }

    .help-tab-content {
        padding: 16px;
    }

    .help-tabs {
        padding: 0 12px;
    }

    .help-tab-btn {
        font-size: 12px;
        padding: 10px 12px;
        gap: 4px;
    }

    .help-tab-btn i {
        font-size: 14px;
    }

    .help-section h3 {
        font-size: 16px;
    }

    .help-section p {
        font-size: 13px;
    }

    .help-feature-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .workflow-step {
        gap: 12px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .membership-table {
        font-size: 12px;
    }

    .membership-table th,
    .membership-table td {
        padding: 8px 6px;
    }

    .membership-table th:first-child,
    .membership-table td:first-child {
        padding-left: 10px;
    }

    .tier-badge {
        font-size: 9px;
        padding: 3px 6px;
    }

    .upgrade-cta {
        padding: 16px;
    }

    .upgrade-cta i {
        font-size: 24px;
    }

    /* 툴팁 위치 조정 (모바일) */
    [data-tooltip]:hover::before,
    [data-tooltip]:hover::after {
        display: none;
    }
}

/* 18. 다크 모드 호환성 (향후 추가 대비) */
@media (prefers-color-scheme: dark) {
    .help-icon-btn {
        background: #1f2937;
        border-color: #60a5fa;
    }

    .help-icon-btn:hover {
        background: #3b82f6;
    }
}

/* ================================
   시세지도 모달 스타일
   ================================ */
.map-compare-modal-overlay {
    z-index: 10000;
    /* .top-nav(9998)보다 높게 설정하여 전체화면 시 네비게이션 위에 표시 */
}

.map-compare-modal {
    width: 1600px;
    height: 900px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden !important;
    padding: 0 !important;
}

.map-compare-modal.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 10001 !important;
    /* 전체화면 시 최상위에 표시 */
}

.map-compare-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.map-compare-modal.fullscreen .modal-header {
    border-radius: 0;
    position: relative;
    z-index: 10;
}

.map-compare-modal .modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.map-compare-modal .modal-header h2 i {
    font-size: 1rem;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-fullscreen-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.map-compare-modal .modal-close {
    font-size: 28px;
    color: white;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: transform 0.2s ease;
}

.map-compare-modal .modal-close:hover {
    transform: scale(1.2);
}

.map-compare-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    min-height: 0;
}

.map-compare-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 다크모드 대응 */
@media (prefers-color-scheme: dark) {
    .map-compare-modal .modal-header {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    }

    .modal-fullscreen-btn {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
    }

    .modal-fullscreen-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* 반응형 */
@media (max-width: 1680px) {
    .map-compare-modal {
        width: 95vw;
        height: 85vh;
    }
}

@media (max-width: 768px) {
    .map-compare-modal {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .map-compare-modal .modal-header {
        border-radius: 0;
        padding: 10px 15px;
    }

    .map-compare-modal .modal-header h2 {
        font-size: 1rem;
    }
}