/* =========================================
   1. 기본 설정 및 레이아웃
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Malgun Gothic', '맑은 고딕', sans-serif; }
body, html { height: 100%; overflow: hidden; overscroll-behavior: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; }

/* 유틸리티 */
.mobile-only { display: none !important; }
.pc-only { display: block !important; }
@media (min-width: 769px) { .mobile-only-sidebar { display: none !important; } }

.container { display: flex; height: 100vh; position: relative; }
.section { position: relative; flex-grow: 1; height: 100vh; margin-left: 70px; width: calc(100% - 70px); }
#map { width: 100%; height: 100%; }

/* 고정 사이드바 */
.fixed-bar { position: fixed; top: 0; left: 0; width: 70px; height: 100%; background-color: #2c3e50; z-index: 1001; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 15px 0; box-shadow: 2px 0 5px rgba(0,0,0,0.2); }
.fixed-bar .icon-btn, .fixed-bar .toggle-sidebar, .fixed-bar .toggle-star-sidebar, .fixed-bar .toggle-settings-sidebar, .fixed-bar .toggle-distance-mode { color: white; font-size: 22px; padding: 10px; width: 100%; transition: background-color 0.2s; }
.fixed-bar button:hover { background-color: #34495e; }
.fixed-bar .toggle-distance-mode.active { background-color: #e74c3c; color: #fff; }
.fixed-bar .bottom-icons, .fixed-bar .top-icons { display: flex; flex-direction: column; gap: 10px; }
.fixed-bar .toggle-weather-sidebar { color: white; font-size: 22px; padding: 10px; width: 100%; transition: background-color 0.2s; }
.fixed-bar .toggle-weather-sidebar:hover { background-color: #34495e; }

/* 슬라이딩 패널 */
.sidebar, .settings-sidebar, .star-sidebar, .weather-sidebar { 
    position: fixed; left: -420px; width: 370px; height: 100%; 
    background-color: #f4f6f8; z-index: 1000; 
    transition: left 0.35s ease-in-out; 
    box-shadow: 2px 0 8px rgba(0,0,0,0.15); 
    display: flex; flex-direction: column; 
}
.sidebar-title { padding: 15px 20px; font-size: 1.2rem; color: #2c3e50; background-color: #e9edf0; border-bottom: 1px solid #dce1e6; flex-shrink: 0; }

/* 기존 날씨 위젯 숨김 (플로팅 사용) */
#weather-info, #weather-info-pc, #weather-info-mobile, .weather-info-container { display: none !important; }

/* 리스트 및 검색 */
#mountain-view, #notice-view { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.search_total { display: flex; padding: 10px 15px; flex-shrink: 0; }
.search_text { flex-grow: 1; padding: 8px 12px; border: 1px solid #ccc; border-radius: 5px 0 0 5px; }
.search { padding: 8px 12px; background: #34495e; color: white; border-radius: 0 5px 5px 0; }
.mountain-list, .sidebar-notice-list, .star-list { flex-grow: 1; overflow-y: auto; padding: 0 15px; -webkit-overflow-scrolling: touch; }
.mountain-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px; border-bottom: 1px solid #eee; cursor: pointer; transition: background-color 0.2s; }
.mountain-item:hover { background-color: #e9ecef; }
.mountain-details { display: flex; flex-direction: column; justify-content: center; flex-grow: 1; margin-right: 15px; }
.mountain-name { font-size: 1rem; font-weight: bold; color: #333; margin: 0 0 4px 0; }
.mountain-address { font-size: 0.85rem; color: #666; margin: 0; }
.mountain-img { width: 75px; height: 75px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }

/* 공지사항 */
.notice-item { border-bottom: 1px solid #eee; }
.notice-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 10px; cursor: pointer; transition: background-color 0.2s; }
.notice-header:hover { background-color: #e9ecef; }
.notice-title-wrapper { display: flex; flex-direction: column; }
.notice-header h4 { font-size: 1rem; margin: 0 0 4px 0; }
.notice-header p { font-size: 0.85rem; color: #777; margin: 0; }
.notice-arrow { font-size: 1rem; color: #777; transition: transform 0.3s ease; }
.notice-item.expanded .notice-arrow { transform: rotate(90deg); }
.notice-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; padding: 0 15px; font-size: 0.9rem; color: #555; background-color: #fff; }
.notice-content p { padding-bottom: 15px; }
.notice-item.expanded .notice-content { max-height: 500px; padding: 15px; }
.notice-item-placeholder { font-size: 0.85rem; color: #777; padding: 15px; }

/* 즐겨찾기 카드 */
.star-card { background: #fff; border-radius: 8px; padding: 15px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: pointer; position: relative; }
.star-card-title { font-size: 1.1rem; font-weight: bold; margin-bottom: 8px; }
.star-card-desc { font-size: 0.9rem; color: #555; line-height: 1.5; }
.star-card-star { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; color: #f1c40f; }

/* 지도 컨트롤 */
#box { position: absolute; bottom: 20px; right: 20px; background: white; padding: 10px 15px; border-radius: 5px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); z-index: 500; }
.box-dot { display: inline-block; background: green; border-radius: 50%; width: 12px; height: 12px; }
.box-main { display: inline-block; border-bottom: 3px solid green; padding: 0 8px; width: 32px; }
.box-sub { display: inline-block; border-bottom: 3px dashed #c00; padding: 0 8px; width: 32px; }
.custom-map-control-group { display: flex; flex-direction: column; gap: 0; position: absolute; right: 20px; bottom: 870px; z-index: 2000 !important; }
.custom-map-btn { width: 36px; height: 36px; background-color: #fff; border: 1px solid #b3b3b3; box-shadow: 0 2px 4px rgba(0,0,0,0.15); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #333; transition: background-color 0.2s; }
.custom-map-btn:hover { background-color: #f8f9fa; }
.custom-map-btn.zoom-in-btn { border-bottom: 1px solid #e0e0e0; border-radius: 4px 4px 0 0; }
.custom-map-btn.zoom-out-btn { border-radius: 0 0 4px 4px; }
.custom-map-btn.location-btn { margin-bottom: 10px; border-radius: 4px; font-size: 20px; color: #333; }

.my-location-marker { width: 20px; height: 20px; background-color: #3B82F6; border: 3px solid white; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.3); animation: pulse-marker 2s infinite; }
@keyframes pulse-marker { 0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); } }

.map-type-control { display: flex; background-color: white; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.2); margin: 10px; }
.map-type-btn { padding: 8px; border: 1px solid #ccc; background-color: #f9f9f9; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; border-left: none; }
.map-type-btn:first-child { border-radius: 5px 0 0 5px; border-left: 1px solid #ccc; }
.map-type-btn:last-child { border-radius: 0 5px 5px 0; }
.map-type-icon { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; margin-bottom: 4px; display: block; margin-left: auto; margin-right: auto; }
.map-type-btn span { font-size: 12px; }
.map-type-btn.active { background-color: #3B82F6; color: white; border-color: #3B82F6; }

/* 거리 재기 UI */
.distance-result-overlay { background: white; border: 1px solid #8c8c8c; border-radius: 2px; padding: 8px 10px; box-shadow: 1px 1px 4px rgba(0,0,0,0.3); min-width: 180px; font-size: 12px; color: #333; font-family: 'Dotum', 'Gulim', sans-serif; position: relative; z-index: 1000; padding-right: 25px; }
.distance-result-overlay::after { content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border-width: 6px 6px 0; border-style: solid; border-color: white transparent transparent transparent; z-index: 2; }
.distance-result-overlay::before { content: ''; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); border-width: 7px 7px 0; border-style: solid; border-color: #8c8c8c transparent transparent transparent; z-index: 1; }
.distance-result-overlay .row { display: flex; justify-content: space-between; margin-bottom: 4px; line-height: 1.4; }
.distance-result-overlay .row:last-child { margin-bottom: 0; }
.distance-result-overlay .row.help-text { margin-top: 6px; padding-top: 6px; border-top: 1px solid #eee; color: #888; font-size: 11px; text-align: center; display: block; }
.distance-clear-btn { width: 100%; background-color: #f8f9fa; border: 1px solid #ddd; color: #333; padding: 4px 0; border-radius: 3px; font-size: 11px; cursor: pointer; display: block; margin-top: 2px; }
.distance-clear-btn:hover { background-color: #eee; color: #d00; border-color: #ccc; }
.distance-result-overlay .label { color: #666; }
.distance-result-overlay .value { font-weight: bold; color: #333; }
.distance-result-overlay .value.dist { color: #f23838; font-size: 13px; }
.distance-result-overlay .value.time { color: #333; }
.distance-result-overlay .unit { font-size: 11px; color: #666; font-weight: normal; margin-left: 2px; }
.distance-finish-btn { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background-color: #2c3e50; color: white; padding: 10px 24px; border-radius: 30px; font-size: 14px; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 2000; border: 1px solid #fff; transition: background-color 0.2s; }
.distance-finish-btn:active { background-color: #1a252f; }
.distance-finish-btn.delete-mode { background-color: #c0392b; border-color: #e74c3c; }

/* 마커 설정 */
.marker-settings { padding: 15px; background-color: #f4f6f8; display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; }
.preset-dropdown { position: relative; width: 100%; margin-bottom: 20px; flex-shrink: 0; }
.preset-dropdown-btn { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 15px; font-size: 1.1rem; font-weight: bold; color: #2c3e50; background-color: #fff; border: 1px solid #ccc; border-radius: 5px; }
.preset-list { position: absolute; top: 100%; left: 0; width: 100%; background-color: #fff; border: 1px solid #ccc; border-top: none; border-radius: 0 0 5px 5px; z-index: 10; max-height: 200px; overflow-y: auto; display: none; }
.preset-list-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; font-size: 1rem; cursor: pointer; }
.preset-list-item:hover { background-color: #e9ecef; }
.preset-list-swatches { display: flex; gap: 2px; }
.preset-swatch { width: 18px; height: 18px; border: 1px solid rgba(0,0,0,0.2); border-radius: 3px; flex-shrink: 0; }
.preset-preview { display: flex; flex-grow: 1; justify-content: flex-end; overflow: hidden; gap: 2px; }
.settings-main-area { display: flex; align-items: stretch; flex-grow: 1; padding: 30px 5px; gap: 20px; }
.gradient-preview-wrapper { width: 120px; height: 100%; display: flex; justify-content: center; position: relative; flex-shrink: 0; margin-left: 30px; }
.gradient-bar { width: 60px; height: 100%; border: 1px solid #ccc; border-radius: 4px; background: linear-gradient(to top, #0000ff, #ff0000); position: relative; cursor: pointer; }
.temp-display { position: absolute; right: 100%; margin-left: 100px; font-size: 1.2rem; font-weight: bold; color: #333; width: 60px; text-align: right; }
.max-temp { top: -10px; }
.min-temp { bottom: -10px; }
#gradient-stops-container { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); width: 24px; pointer-events: none; }
.gradient-stop { position: absolute; left: 0; width: 24px; height: 24px; background-color: #fff; border: 3px solid #333; border-radius: 50%; transform:translateY(20%) !important;  cursor: pointer; pointer-events: all; box-shadow: 0 2px 4px rgba(0,0,0,0.3); transition: border-color 0.2s, box-shadow 0.2s; }
.gradient-stop[data-ratio="1"] { transform: translateY(-50%); }
.gradient-stop.active { border-color: #3B82F6; box-shadow: 0 0 8px 2px #3B82F6; z-index: 10; }
.settings-controls { flex-grow: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 10px; padding-top: 20px; }
.settings-controls label { font-weight: bold; font-size: 1rem; color: #333; }
#active-color-picker { width: 100%; height: 40px; border: 1px solid #ccc; border-radius: 4px; padding: 0; cursor: pointer; -webkit-appearance: none; appearance: none; background-color: transparent; }
.settings-description { font-size: 0.85rem; color: #555; line-height: 1.4; margin-top: 10px; }
.stop-tooltip { position: fixed; background: #333; color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.9rem; pointer-events: none; z-index: 3000; transform: translate(-120%, -50%); white-space: nowrap; }
.sensor-marker { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; transition: background-color 0.3s ease; }
.sensor-marker span { transform: rotate(45deg); color: white; font-size: 12px; font-weight: bold; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }

/* 정보창 */
.weather-info-window { background: rgba(255, 255, 255, 0.98); padding: 15px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); border: 1px solid #ddd; display: flex; flex-direction: column; min-width: 260px; font-family: 'Pretendard', 'Malgun Gothic', sans-serif; }
.weather-info-window::after { content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); border-width: 10px 10px 0; border-style: solid; border-color: rgba(255, 255, 255, 0.98) transparent transparent transparent; }
.weather-info-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.weather-header-left { display: flex; align-items: center; }
.weather-header-left img { width: 48px; height: 48px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1)); }
.weather-header-left .temp-box { display: flex; flex-direction: column; margin-left: 5px; }
.weather-info-temp { font-size: 1.8rem; font-weight: 800; line-height: 1; color: #333; }
.weather-desc-text { font-size: 0.85rem; color: #666; margin-top: 3px; }
.weather-header-right { text-align: right; display: flex; flex-direction: column; justify-content: center; }
.weather-mountain-name { font-size: 1.3rem; font-weight: bold; color: #2c3e50; margin-bottom: 2px; }
.weather-sub-text { font-size: 0.8rem; color: #888; }
.weather-info-details { display: flex; justify-content: space-between; font-size: 0.85rem; background-color: #f8f9fa; border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.weather-info-details .detail-item { display: flex; flex-direction: column; align-items: center; flex: 1; }
.weather-info-details span:first-child { color: #888; font-size: 0.75rem; margin-bottom: 2px; }
.weather-info-details span:last-child { color: #333; font-weight: 600; }
.weather-sun-details { display: flex; justify-content: space-between; font-size: 0.85rem; color: #555; padding: 0 10px; }
.weather-sun-details .sun-item { display: flex; align-items: center; gap: 5px; }
.info-window-content { padding: 15px; min-width: 240px; line-height: 1.8; font-size: 1rem; position: relative; }
.heart-toggle { position: absolute; top: 10px; right: 10px; font-size: 1.5rem; cursor: pointer; }

/* 모달 */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000; visibility: hidden; opacity: 0; transition: visibility 0s 0.3s, opacity 0.3s ease; }
.modal-overlay.visible { visibility: visible; opacity: 1; transition: opacity 0.3s ease; }
.modal-content { background: #fff; padding: 30px; border-radius: 10px; position: relative; width: 90%; max-width: 400px; transform: scale(0.95); transition: transform 0.3s ease; }
.modal-overlay.visible .modal-content { transform: scale(1); }
.modal-close { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; cursor: pointer; color: #999; }
.modal-close:hover { color: #333; }
.modal-content h2 { margin-bottom: 20px; text-align: center; }
#modal-login-form input, #register-form input[type=text], #register-form input[type=password], #register-form input[type=tel] { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 5px; }
#modal-login-form .btn, #register-form .btn { width: 100%; padding: 12px; background: #34495e; color: white; border-radius: 5px; font-size: 1rem; font-weight: bold; }
#register-form .btn { background: #3B82F6; margin-top: 20px; }
#register-form .btn:hover { background-color: #2563eb; }
#modal-login-form .btn-signup { width: 100%; padding: 12px; background: #95a5a6; color: white; border-radius: 5px; margin-top: 10px; }
.input-with-btn { display: flex; gap: 8px; margin-top: 5px; }
.input-with-btn input { flex-grow: 1; margin-top: 0; }
.btn-check { padding: 0 15px; background-color: #555; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; flex-shrink: 0; }
.check-result { font-size: 0.85rem; display: block; margin-top: 5px; min-height: 1.2em; }
.check-result.success { color: green; } .check-result.error { color: red; }

/* 모바일 반응형 */
@media (max-width: 768px) {
    .section { margin-left: 0; width: 100%; padding-bottom: 60px; }
    .fixed-bar { top: auto; bottom: 0; left: 0; width: 100%; height: 60px; flex-direction: row; justify-content: space-between; align-items: center; padding: 0; box-shadow: 0 -2px 5px rgba(0,0,0,0.1); z-index: 1100; }
    .fixed-bar .top-icons, .fixed-bar .bottom-icons { display: contents; }
    .fixed-bar .icon-btn, .fixed-bar .toggle-sidebar, .fixed-bar .toggle-star-sidebar, .fixed-bar .toggle-settings-sidebar, .fixed-bar .toggle-distance-mode, .fixed-bar .toggle-weather-sidebar { width: auto; height: 100%; padding: 0; font-size: 22px; flex: 1; display: flex; justify-content: center; align-items: center; }
    .mobile-only { display: block !important; }
    .pc-only { display: none !important; }
    .mobile-only-sidebar { display: block !important; z-index: 2100 !important; }
    .sidebar, .star-sidebar, .settings-sidebar, .weather-sidebar {
        left: 0 !important; width: 100%; top: 100vh; bottom: 0 !important; z-index: 1200;
        background-color: #ffffff; border-top-left-radius: 20px; border-top-right-radius: 20px;
        box-shadow: 0 -5px 15px rgba(0,0,0,0.2); transition: top 0.35s cubic-bezier(0.25, 1, 0.5, 1);
        display: block; overflow-y: auto; overflow-x: hidden;
    }
    .sidebar.dragging, .star-sidebar.dragging, .settings-sidebar.dragging, .weather-sidebar.dragging { transition: none; }
    .mobile-drag-handle {
        display: flex !important; align-items: center; justify-content: center;
        width: 100%; height: 30px; cursor: row-resize; flex-shrink: 0;
        background-color: #e9edf0; position: sticky; top: 0; left: 0; z-index: 20;
        border-top-left-radius: 20px; border-top-right-radius: 20px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    .mobile-drag-handle::after { content: ''; width: 40px; height: 5px; background-color: #ccc; border-radius: 3px; }
    .handle-bar { display: none; }
    .sidebar-title { padding: 15px 20px; margin-top: 0; text-align: center; font-size: 1.1rem; background-color: #e9edf0; border-bottom: 1px solid #dce1e6; }
    #search-panel #weather-info-pc, #search-panel .weather-info-container { display: none !important; }
    #weather-panel, #weather-info-mobile { display: block !important; }
    #mountain-view, #notice-view { height: auto !important; overflow: visible !important; display: block !important; }
    .mountain-list, .sidebar-notice-list, .star-list, .marker-settings { margin-top: 0; height: auto !important; overflow: visible !important; padding-bottom: 100px; }
    .marker-settings { margin-top: 20px; }
    #box { bottom: 20vh; right: 10px; font-size: 11px; padding: 8px 10px; margin-bottom: 0px; } 
    .box-dot { width: 10px; height: 10px; }
    .box-main, .box-sub { width: 24px; }
    .distance-result-overlay { bottom: 110px !important; }
    input[type="text"], input[type="password"], input[type="tel"], input[type="number"], input[type="email"], textarea, select { font-size: 16px !important; }
    body.modal-open #chatbot-icon, body.mobile-panel-open #chatbot-icon { display: none !important; }
    .settings-main-area { flex-direction: column; padding: 10px 0; }
    .gradient-preview-wrapper { width: 100%; height: 80px; margin: 0 0 20px 0; display: block; position: relative; margin-left: 0; }
    .gradient-bar { width: 100%; height: 40px; margin-top: 20px; }
    #gradient-stops-container { width: 100%; height: 40px; top: 20px; left: 0; transform: none; }
    .temp-display { width: auto; margin: 0; text-align: center; font-size: 1rem; position: absolute; }
    .temp-display.max-temp { right: 0; top: 0; }
    .temp-display.min-temp { left: 0; bottom: auto; top: 0; }
    .custom-map-control-group { bottom: 230px !important; } 
    .fixed-bar .toggle-weather-sidebar { width: auto; padding: 10px; font-size: 24px; }
    .map-type-control { margin: 5px; }
    .map-type-btn { padding: 6px 10px; height: auto; min-width: auto; display: flex; align-items: center; justify-content: center; }
    .map-type-icon { display: none; }
    .map-type-btn span { font-size: 13px; display: block; margin: 0; }
    #login-modal, #register-modal { align-items: flex-end !important; background: rgba(0,0,0,0.5); }
    .modal-content, #register-modal .modal-content, #login-modal .modal-content { 
        width: 100% !important; height: 95% !important; max-height: 95% !important; max-width: none; 
        border-radius: 20px 20px 0 0 !important; padding: 30px 20px; overflow-y: auto; 
        transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); margin: 0 !important; 
    }
    #login-modal.visible .modal-content, #register-modal.visible .modal-content { transform: translateY(0) !important; }
    .modal-close { top: 20px; right: 20px; font-size: 2.5rem; padding: 10px; }
}

@media (min-width: 769px) {
    .mobile-drag-handle { display: none !important; }
    .distance-finish-btn { display: none !important; }
}

/* =========================================
   [New] 플로팅 날씨 위젯 & 상세 카드 스타일
   ========================================= */

/* 1. [플로팅 버튼] (왼쪽 정렬) */
#weather-floating-btn {
    position: absolute;
    bottom: 30px;
    left: 80px; /* 고정바 70px + 10px */
    transform: none; 
    background: white;
    padding: 8px 16px;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 1000;
    font-family: 'Malgun Gothic', 'Dotum', sans-serif;
    border: 1px solid #e0e0e0;
    transition: left 0.35s ease-in-out, transform 0.2s;
}
#weather-floating-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,0.2); }
#weather-floating-btn img { width: 22px; height: 22px; }
.wb-temp { font-size: 14px; font-weight: bold; color: #000; }
.wb-dust-text { font-size: 12px; color: #666; }
.wb-dust-val { font-weight: bold; }
.dust-good { color: #32a852; } 
.dust-mod { color: #f59e0b; }  
.dust-bad { color: #ef4444; }  

/* 2. [상세 팝업 카드] (왼쪽 정렬) */
#weather-detail-card {
    position: absolute;
    bottom: 80px;
    left: 80px; 
    transform: none; 
    width: 320px;
    height: 450px; 
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Malgun Gothic', 'Dotum', sans-serif;
    border: 1px solid #dcdcdc;
    transition: left 0.35s ease-in-out, opacity 0.2s, transform 0.2s; 
}
#weather-detail-card.active { display: flex; animation: slideUp 0.25s ease-out; }

@keyframes slideUp { from { opacity: 0; transform: translate(0, 15px); } to { opacity: 1; transform: translate(0, 0); } }

/* 사이드바 열림 시 위치 이동 */
body.sidebar-open #weather-floating-btn,
body.sidebar-open #weather-detail-card {
    left: 450px; 
}

/* 카드 헤더 */
.card-header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
    flex-shrink: 0;
}
.card-title { font-size: 1rem; font-weight: bold; color: #333; display: flex; align-items: center; gap: 5px; }
.card-close { font-size: 1.1rem; color: #999; cursor: pointer; padding: 0 5px; }

/* 메인 날씨 */
.weather-main { 
    display: flex; align-items: center; margin-bottom: 10px; padding: 15px 15px 0 15px;
}
.weather-main img { 
    width: 50px; height: 50px; margin-right: 12px; background-color: #fbbf24;
    border-radius: 50%; padding: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
}
.weather-temp-container { display: flex; flex-direction: column; }
.weather-temp { font-size: 2.2rem; font-weight: bold; color: #333; line-height: 1; }
.weather-desc { font-size: 0.9rem; color: #555; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.weather-minmax { font-size: 0.85rem; margin-left: 6px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.min-val { color: #3b82f6; } .max-val { color: #ef4444; } .temp-divider { color: #ddd; font-weight: 300; font-size: 0.7rem; }

/* 상세 정보 */
.weather-details { 
    display: flex; justify-content: space-around; background: #ffffff; 
    border: 1px solid #e0e0e0; padding: 10px 5px; border-radius: 8px; margin: 0 15px 10px 15px; 
}
.detail-item { display: flex; flex-direction: column; align-items: center; font-size: 0.8rem; flex: 1; }
.detail-item span:first-child { color: #777; font-size: 0.75rem; margin-bottom: 2px; }
.detail-item span:last-child { font-weight: bold; font-size: 0.9rem; color: #333; }

/* 일출/일몰 */
.weather-sun-times { 
    display: flex; justify-content: space-around; padding: 10px 0; 
    border-top: 1px solid #eee; margin: 0 15px; color: #555;
}
.sun-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.sun-item i { font-size: 1rem; color: #f39c12; }

/* 탭 메뉴 */
.weather-tabs {
    display: flex; border-top: 4px solid #f4f6f8; border-bottom: 1px solid #eee; background: #fff; flex-shrink: 0;
}
.weather-tab {
    flex: 1; text-align: center; padding: 10px 0; font-size: 13px; font-weight: bold; color: #999;
    cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.weather-tab.active { color: #333; border-bottom: 2px solid #333; }

/* 컨텐츠 영역 */
.weather-content-area { flex: 1; position: relative; overflow: hidden; background: #fff; min-height: 0; display: flex; flex-direction: column; }

/* 시간대별 (가로 스크롤) */
.hourly-container {
    display: flex; overflow-x: auto; padding: 15px 10px; height: 100%; align-items: center;
    scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; flex-shrink: 0;
}
.hourly-container::-webkit-scrollbar { height: 4px; } 
.hourly-container::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 4px; }

.h-item { display: flex; flex-direction: column; align-items: center; min-width: 50px; gap: 4px; }
.h-time { font-size: 0.8rem; color: #777; }
.h-time.tomorrow { background: #4a6cfa; color: white; font-size: 10px; padding: 2px 5px; border-radius: 8px; }
.h-icon { width: 28px; height: 28px; }
.h-temp { font-size: 0.9rem; font-weight: bold; color: #333; }

/* 일별 (세로 리스트) */
.daily-container {
    display: none; flex-direction: column; padding: 5px 15px; height: 100%; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; flex: 1;
}
.daily-container::-webkit-scrollbar { width: 4px; }
.daily-container::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 4px; }

.d-item {
    display: flex; justify-content: space-between; align-items: center; padding: 8px 0; 
    border-bottom: 1px solid #f1f5f9; min-height: 45px; flex-shrink: 0;
}
.d-day { width: 50px; font-size: 0.9rem; font-weight: 600; color: #333; }
.d-icon-grp { display: flex; align-items: center; justify-content: center; flex:1; }
.d-icon-grp img { width: 26px; height: 26px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1)); }
.d-temps { width: 90px; text-align: right; font-size: 0.9rem; display: flex; justify-content: flex-end; gap: 6px; }
.d-min { color: #3b82f6; font-weight: 500; }
.d-max { color: #ef4444; font-weight: bold; }

/* 푸터 */
.weather-footer {
    padding: 8px 15px; background: #f9f9f9; border-top: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: #999; flex-shrink: 0;
}

/* CCTV 전체화면 버튼 스타일 */
.cctv-expand-btn {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255,255,255,0.3); border-radius: 4px;
    font-size: 14px; color: #fff; cursor: pointer; padding: 4px 8px; z-index: 10;
    transition: background 0.2s;
}
.cctv-expand-btn:hover { background: rgba(0, 0, 0, 0.8); }