/* ==========================================================================
   리셋 및 기본 스타일
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

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

:root {
    --primary-color: #f59e0b;
    --primary-hover-color: #d97706;
    --secondary-color: #fb923c;
    --success-color: #10b981;
    --warning-color: #fbbf24;
    --danger-color: #ef4444;
    --info-color: #f59e0b;
    --background-color: #fffbeb;
    --card-bg-color: #ffffff;
    --text-color: #92400e;
    --text-muted-color: #a16207;
    --border-color: #fed7aa;
    --shadow-color: rgba(245, 158, 11, 0.1);
    --header-height: 80px;
    --sidebar-width: 320px;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --primary-color: #4dabf7;
    --primary-hover-color: #74c0fc;
    --secondary-color: #adb5bd;
    --success-color: #51cf66;
    --warning-color: #ffd43b;
    --danger-color: #ff6b6b;
    --info-color: #22b8cf;
    --background-color: #1a1a1a;
    --card-bg-color: #2c2c2c;
    --text-color: #e9ecef;
    --text-muted-color: #adb5bd;
    --border-color: #495057;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* ==========================================================================
   로딩 화면 개선
   ========================================================================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ea580c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 2rem;
}

.car-loader {
    position: relative;
    width: 200px;
    height: 60px;
    margin: 0 auto 20px;
}

.car-loader .fa-car-side {
    font-size: 48px;
    color: #fff;
    position: absolute;
    bottom: 10px;
    left: 0;
    animation: drive 2.5s cubic-bezier(0.645, 0.045, 0.355, 1.000) infinite;
}

.road {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #fff;
    overflow: hidden;
}

.road span {
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background-image: linear-gradient(90deg, #fff 50%, transparent 50%);
    background-size: 20px 4px;
    animation: move-road 0.8s linear infinite;
}

.loader-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.loader-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.loader-info {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.loader-info p {
    margin: 0.3rem 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.loader-info strong {
    color: #ffffff;
    font-weight: 600;
}

@keyframes drive {
    0% { transform: translateX(-50px); }
    50% { transform: translateX(180px); }
    100% { transform: translateX(-50px); }
}

@keyframes move-road {
    0% { left: -100%; }
    100% { left: 0%; }
}



/* ==========================================================================
   헤더 및 네비게이션 개선
   ========================================================================== */
.main-header {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.95), rgba(254, 215, 170, 0.85));
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1), 0 4px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
}

[data-theme="dark"] .main-header {
    background: linear-gradient(135deg, rgba(44, 44, 44, 0.95), rgba(60, 60, 60, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3), 0 4px 15px rgba(0, 0, 0, 0.15);
}

.header-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    transition: color var(--transition-speed);
    white-space: nowrap;
}

.header-left .current-address {
    font-size: 0.8rem;
    color: var(--text-muted-color);
    margin-top: 4px;
}



/* 실시간 통계 정보 패널 */
.stats-info-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    min-height: 120px;
    width: 100px;
}

[data-theme="dark"] .stats-info-panel {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.stats-item {
    text-align: center;
    padding: 0 10px;
}

.stats-label {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    margin-bottom: 2px;
    white-space: nowrap;
}

.stats-value {
    font-size: 20px !important;
    font-weight: 600;
    color: var(--text-color);
}

.stats-value.available {
    color: var(--success-color);
}

.stats-value.occupied {
    color: var(--danger-color);
}

.stats-percentage {
    display: none;
}



/* 언어 스위처 */
.language-switcher {
    display: flex;
    gap: 6px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 10px 18px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-width: 65px;
}

.lang-btn:hover,
.lang-btn.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* 우측 플로팅 버튼들 */
.floating-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

@media (max-width: 768px) {
    .floating-buttons {
        bottom: 30px;
        right: 20px;
    }
}

.floating-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.floating-btn.tram-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.floating-btn.tram-btn:hover {
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.floating-btn.chat-btn {
    background: #F7E600 !important;
}

.floating-btn.chat-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 255, 0, 0.4);
}

/* 카카오톡 오픈채팅방 버튼 */
.kakao-chat-buttons {
    display: flex;
    gap: 0.5rem;
}

.kakao-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #fee500, #ffeb3b);
    color: #3c1e1e;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(254, 229, 0, 0.3);
}

.kakao-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(254, 229, 0, 0.4);
    background: linear-gradient(135deg, #ffeb3b, #fdd835);
}

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

.kakao-btn i {
    font-size: 1rem;
    color: #3c1e1e !important;
}

[data-theme="dark"] .kakao-btn {
    color: #2c2c2c;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}



/* 메뉴 토글 */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    border-radius: 10px;
    transition: background var(--transition-speed) ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    position: relative;
    transition: all var(--transition-speed) ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: all var(--transition-speed) ease;
}

.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { bottom: -8px; }

/* 메뉴 토글 활성화 상태 */
.hamburger-icon.active {
    background-color: transparent;
}

.hamburger-icon.active::before {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-icon.active::after {
    transform: translateY(-8px) rotate(-45deg);
}

/* 메뉴 열린 상태 */
body.menu-open .main-header {
    background: var(--primary-color);
}

/* ==========================================================================
   메인 레이아웃
   ========================================================================== */
.main-layout {
    display: flex;
    height: 100vh;
    padding-top: calc(var(--header-height) + 40px);
}

/* 필터 모달 */
.filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.filter-modal.show {
    display: flex;
}

.filter-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.filter-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(254, 243, 199, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(254, 215, 170, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.filter-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
}

.filter-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.filter-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.filter-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.filter-modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.5);
}

.filter-modal-footer .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

/* 주차 현황 요약 */
.parking-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.03);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
}

.summary-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.summary-icon.available {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.summary-icon.occupied {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.summary-icon.total {
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary-color);
}

.summary-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.summary-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted-color);
    font-weight: 500;
}

/* 카드 스타일 */
.card {
    background: var(--card-bg-color);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

[data-theme="dark"] .card {
    background: var(--card-bg-color);
    border-color: var(--border-color);
}

/* 다크모드 폼 요소 가시성 개선 */
[data-theme="dark"] .form-check-label,
[data-theme="dark"] .form-label,
[data-theme="dark"] .input-method-toggle label {
    color: var(--text-color) !important;
}

[data-theme="dark"] .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
}

.card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 필터 그룹 */
.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

/* 반경 필터 */
.radius-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.radius-input-group input[type="range"] {
    flex: 1;
}

#radius-display {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 60px;
    text-align: right;
}

/* 시간 컨트롤 스타일 개선 */
.time-controls {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.time-controls.active {
    display: block;
}

.input-method-toggle {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.input-method-toggle input[type="radio"] {
    margin-right: 5px;
}

.input-method-toggle label {
    cursor: pointer;
    font-weight: 500;
    color: #495057;
}

.time-select-group,
.time-range-group {
    margin-bottom: 15px;
}

.time-select-group label,
.time-range-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.time-select-group input[type="time"],
.time-range-group input[type="time"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.3s ease;
}

.time-select-group input[type="time"]:focus,
.time-range-group input[type="time"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#time-now-btn {
    width: 100%;
    padding: 8px 16px;
    margin-top: 10px;
    border: 2px solid #6c757d;
    background: white;
    color: #6c757d;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

#time-now-btn:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

/* 모바일에서 시간 컨트롤 최적화 */
@media (max-width: 768px) {
    /* 헤더 모바일 최적화 */
    .main-header {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
        height: 60px;
    }
    
    .site-title {
        font-size: 1.2rem;
    }
    
    .header-controls {
        gap: 8px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
        padding: 8px;
        margin: 0 4px;
    }
    
    /* 팝업 모바일 최적화 */
    .mapboxgl-popup-content {
        font-size: 14px;
        max-width: 280px;
        padding: 12px;
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .sensor-popup .sensor-header h3 {
        font-size: 1.1rem;
    }
    
    .detail-item {
        padding: 8px 0;
        font-size: 13px;
    }
    
    .detail-item .label {
        font-weight: 600;
        min-width: 80px;
    }
    
    /* 필터 모달 모바일 최적화 */
    .filter-modal-content {
        width: 95%;
        max-width: 350px;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .time-controls {
        padding: 12px;
        margin: 8px 0;
    }
    
    .time-select-group label,
    .time-range-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .time-select-group input[type="time"],
    .time-range-group input[type="time"] {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    #time-now-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* 빠른 필터 버튼 모바일 최적화 */
    .quick-filter-buttons {
        gap: 8px;
    }
    
    .quick-filter-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* 통계 패널 모바일 최적화 */
    .stats-info-panel {
        padding: 12px;
        max-width: 280px;
    }
    
    .stats-item {
        font-size: 13px;
    }
    
    /* 토스트 알림 모바일 최적화 */
    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
        font-size: 14px;
    }
}

/* 빠른 필터 버튼 */
.quick-filter-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.quick-filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.quick-filter-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.quick-filter-btn.active {
    background: linear-gradient(135deg, #ffd700, #ff6b35);
    border-color: #ff6b35;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.quick-filter-btn i {
    font-size: 1.5rem;
}

.quick-filter-btn span {
    text-align: center;
    line-height: 1.2;
}

[data-theme="dark"] .quick-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .quick-filter-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 통계 그리드 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: var(--background-color);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
}

[data-theme="dark"] .stat-item {
    background: var(--border-color);
}

.stat-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.stat-item.total { border-left: 4px solid var(--info-color); }
.stat-item.available { border-left: 4px solid var(--success-color); }
.stat-item.occupied { border-left: 4px solid var(--danger-color); }
.stat-item.unknown { border-left: 4px solid var(--warning-color); }

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted-color);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

/* API 상태 */
.api-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--background-color);
    border-radius: 8px;
    margin-top: 1rem;
}

[data-theme="dark"] .api-status {
    background: var(--border-color);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background: var(--danger-color);
}

/* 액션 버튼 */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* 네비게이션 내 액션 버튼 디자인 */
.header-controls .action-buttons .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}

.header-controls .action-buttons .action-btn:hover {
    background: var(--primary-hover-color);
}

/* 컨트롤 버튼 */
.control-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    margin: 0 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.control-btn:hover::before {
    transform: translateX(100%);
}

.control-btn i {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* 텍스트 버튼 공통 스타일 */
.locate-text-btn,
.filter-text-btn {
    width: auto !important;
    min-width: 80px;
    padding: 0 16px !important;
    border-radius: 20px !important;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    height: 40px;
}

.locate-text-btn span,
.filter-text-btn span {
    color: inherit;
}

.filter-text-btn {
    position: relative;
}

.filter-btn {
    position: relative;
}

.filter-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.filter-count.hidden {
    display: none;
}

/* 스위치 컨트롤 */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
    height: 24px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition-speed);
    border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
  background-color: white;
    transition: var(--transition-speed);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 테마 스위치 */
.theme-switch-wrapper {
    position: relative;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #ffd700, #ffab00);
    transition: var(--transition-speed);
    border-radius: 30px;
    display: flex;
    align-items: center;
    padding: 3px;
}

.theme-switch .slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    background: white;
    transition: var(--transition-speed);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.theme-switch input:checked + .slider {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.theme-switch input:checked + .slider:before {
    transform: translateX(30px);
}

.theme-switch .slider .icon {
    position: absolute;
    transition: var(--transition-speed);
    font-size: 0.8rem;
    z-index: 1;
}

.theme-switch .slider .sun {
    left: 6px;
    color: #ff8c00;
}

.theme-switch .slider .moon {
    right: 6px;
    color: #4dabf7;
    opacity: 0;
}

.theme-switch input:checked ~ .slider .sun {
    opacity: 0;
}

.theme-switch input:checked ~ .slider .moon {
    opacity: 1;
}

/* ==========================================================================
   메인 콘텐츠 영역
   ========================================================================== */
.main-content {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}



#map {
    width: 100%;
    height: 100%;
    display: block;
}





.list-header h2 {
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

.list-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

.parking-list {
    display: grid;
    gap: 1rem;
}

.parking-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.parking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* 향상된 목록 아이템 스타일 */
.parking-item.enhanced {
    padding: 1.25rem;
    border-radius: 15px;
}

.parking-item.enhanced .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.parking-item.enhanced .item-title h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.parking-item.enhanced .bay-id {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted-color);
}

.parking-item.enhanced .item-distance .distance {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.parking-item.enhanced .item-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.05);
}

.parking-item.enhanced .item-status.status-available {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.parking-item.enhanced .item-status.status-occupied {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.parking-item.enhanced .item-status.status-unknown {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.parking-item.enhanced .status-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.parking-item.enhanced .price-tag {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--warning-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.parking-item.enhanced .item-details {
    margin-bottom: 1rem;
}

.parking-item.enhanced .detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted-color);
}

.parking-item.enhanced .detail-row:last-child {
    margin-bottom: 0;
}

.parking-item.enhanced .detail-row i {
    width: 14px;
    text-align: center;
    color: var(--primary-color);
}

.parking-item.enhanced .item-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.parking-item.enhanced .action-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.parking-item.enhanced .action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

/* 통계 뷰 */
.stats-container {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.stats-header h2 {
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-speed) ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.stats-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-muted-color);
    font-weight: 500;
}

.stats-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.stats-percentage {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
}

.stats-card.available .stats-value { color: var(--success-color); }
.stats-card.occupied .stats-value { color: var(--danger-color); }
.stats-card.unknown .stats-value { color: var(--warning-color); }

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.chart-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.5rem;
}

.chart-item h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-weight: 600;
}

/* ==========================================================================
   Mapbox 팝업 커스터마이징
   ========================================================================== */
.mapboxgl-popup-content {
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: none;
    padding: 0;
    max-width: 300px;
    background: var(--card-bg-color);
    color: var(--text-color);
}

/* 다크모드에서 마커 가시성 향상 */
[data-theme="dark"] .mapboxgl-marker {
    filter: brightness(1.8) contrast(1.5) saturate(1.3);
}

/* 다크모드에서 폼 요소 가시성 개선 */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="text"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="text"]:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

[data-theme="dark"] option {
    background: var(--card-bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .mapboxgl-popup-content {
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.sensor-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 380px;
    min-width: 320px;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    max-height: 70vh;
    overflow-y: auto;
}

.sensor-popup .sensor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.sensor-popup .sensor-header .sensor-status {
    order: 1;
    flex-shrink: 0;
}

.sensor-popup .sensor-header h3 {
    order: 2;
    flex: 1;
    margin: 0;
    margin-left: 10px;
    font-size: 16px;
    color: #495057;
}

.sensor-details {
    margin-bottom: 15px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.detail-item i {
    width: 16px;
    text-align: center;
}

.detail-item .label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
}

.detail-item .value {
    color: #2c3e50;
    font-weight: 500;
    flex: 1;
}

.detail-section {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 10px;
}

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

.detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 10px 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sensor-details p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #495057;
}

.sensor-details strong {
    color: #2c3e50;
    font-weight: 600;
}

.bay-restrictions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
}

.bay-restrictions h4 {
    color: #007bff;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bay-restrictions h4::before {
    content: "📋";
    font-size: 16px;
}

.restriction-details {
    font-size: 13px;
}

.restriction-item {
    margin: 5px 0;
    color: #495057;
    line-height: 1.3;
}

.type-desc {
    margin: 5px 0;
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}

.pricing-info {
    background: #e8f5e8;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

.pricing-info h4 {
    color: #28a745;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pricing-info h4::before {
    content: "💰";
    font-size: 16px;
}

.price-schedule {
    font-size: 13px;
}

.price-item {
    margin: 8px 0;
    padding: 6px 8px;
    background: white;
    border-radius: 5px;
    border: 1px solid #d4edda;
}

.price-time {
    font-weight: 600;
    color: #155724;
    margin-bottom: 2px;
}

.price-detail {
    color: #495057;
    font-size: 12px;
}

.zone-restrictions {
    background: #fff3cd;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    border-left: 4px solid #ffc107;
}

.zone-restrictions h4 {
    color: #856404;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.zone-restrictions h4::before {
    content: "🚗";
    font-size: 16px;
}

.zone-details {
    font-size: 13px;
}

.zone-item {
    margin: 8px 0;
    padding: 6px 8px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ffeaa7;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zone-days {
    font-weight: 600;
    color: #856404;
}

.zone-time {
    color: #495057;
    font-size: 12px;
}

.zone-display {
    color: #6c757d;
    font-size: 11px;
    font-style: italic;
}

.directions-section {
    text-align: center;
    margin-bottom: 15px;
}

.directions-link {
    display: inline-block;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.directions-link:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    color: white;
    text-decoration: none;
}

.reliability-info {
    background: #f1f3f4;
    border-radius: 8px;
    padding: 10px;
    border-left: 4px solid #6c757d;
}

.reliability-info p {
    margin: 0;
    font-size: 11px;
    color: #6c757d;
    line-height: 1.4;
    font-style: italic;
}

/* 센서 상태 */
.sensor-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sensor-status.status-available {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sensor-status.status-occupied {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sensor-status.status-unavailable,
.sensor-status.status-unknown {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ==========================================================================
   토스트 알림
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    min-width: 300px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    overflow: hidden;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--primary-color);
    color: white;
}

.toast-message {
    flex-grow: 1;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
}

.toast-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.toast-info { 
    border-left: 4px solid var(--info-color); 
    background: linear-gradient(to right, rgba(245, 158, 11, 0.1), transparent);
}

.toast-success { 
    border-left: 4px solid var(--success-color);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.1), transparent);
}

.toast-warning { 
    border-left: 4px solid var(--warning-color);
    background: linear-gradient(to right, rgba(251, 191, 36, 0.1), transparent);
}

.toast-error { 
    border-left: 4px solid var(--danger-color);
    background: linear-gradient(to right, rgba(239, 68, 68, 0.1), transparent);
}

/* ==========================================================================
   애니메이션
   ========================================================================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* ==========================================================================
   반응형 디자인
   ========================================================================== */
@media (max-width: 768px) {
    .header {
        padding: 10px 20px;
        border-radius: 0 0 20px 20px;
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.9));
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .header-content {
        display: grid;
        grid-template-columns: 50px 1fr 50px;
        align-items: center;
        gap: 8px;
        position: relative;
        min-height: 44px;
    }
    
    .header h1 {
        font-size: 16px;
        margin: 0;
        padding: 0;
        text-align: center;
        font-weight: 700;
        color: white;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
        grid-column: 2;
        line-height: 1.2;
    }
    
    .header-controls {
        display: none;
    }
    
    /* Bootstrap 5 기반 모바일 현재위치 버튼 */
    .mobile-current-location-btn {
        bottom: 100px !important;
        right: 20px !important;
        width: 56px !important;
        height: 56px !important;
        border-radius: 50% !important;
        border: none !important;
        background: linear-gradient(135deg, #28a745, #20c997) !important;
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 1000 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .mobile-current-location-btn:hover {
        transform: translateY(-3px) scale(1.1) !important;
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4) !important;
        background: linear-gradient(135deg, #20c997, #17a2b8) !important;
    }
    
    .mobile-current-location-btn:active {
        transform: translateY(-1px) scale(1.05) !important;
    }

    .mobile-current-location-btn i {
        font-size: 22px !important;
        color: white !important;
        transition: transform 0.3s ease;
    }

    .mobile-current-location-btn:hover i {
        transform: scale(1.2) rotate(360deg);
    }
    
    .header-stats {
        position: fixed;
        top: 85px;
        right: 12px;
        gap: 4px;
        padding: 8px 6px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        min-width: 80px;
    }
    
    .header-stats .stat-item {
        padding: 6px 8px;
        min-width: 48px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.7);
        border: 1px solid rgba(0, 0, 0, 0.05);
        margin-bottom: 2px;
    }
    
    .header-stats .stat-item:last-child {
        margin-bottom: 0;
    }
    
    .header-stats .stat-label {
        font-size: 10px;
        color: #666;
        font-weight: 500;
    }
    
    .header-stats .stat-value {
        font-size: 14px;
        color: #333;
        font-weight: 700;
    }

    /* 다크모드 모바일 헤더 지원 */
    [data-theme="dark"] .header {
        background: linear-gradient(135deg, rgba(44, 44, 44, 0.95), rgba(60, 60, 60, 0.9));
    }

    [data-theme="dark"] .header h1 {
        color: #e9ecef;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    }

    [data-theme="dark"] .mobile-menu-toggle {
        background: rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    [data-theme="dark"] .mobile-menu-toggle span {
        background: #e9ecef;
    }

    [data-theme="dark"] .header-stats {
        background: rgba(44, 44, 44, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .header-stats .stat-item {
        background: rgba(60, 60, 60, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    [data-theme="dark"] .header-stats .stat-label {
        color: #adb5bd;
    }

    [data-theme="dark"] .header-stats .stat-value {
        color: #e9ecef;
    }

    [data-theme="dark"] .mobile-nav-menu {
        background: linear-gradient(135deg, rgba(44, 44, 44, 0.98), rgba(32, 32, 32, 0.95));
    }

    [data-theme="dark"] .mobile-nav-header {
        background: linear-gradient(135deg, #4dabf7 0%, #74c0fc 100%);
    }

    [data-theme="dark"] .mobile-nav-section {
        background: rgba(60, 60, 60, 0.7);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    [data-theme="dark"] .mobile-nav-section h4 {
        color: #adb5bd;
    }

    [data-theme="dark"] .mobile-nav-section .lang-btn {
        background: rgba(44, 44, 44, 0.9);
        color: #4dabf7;
        border-color: #4dabf7;
    }

    [data-theme="dark"] .mobile-nav-section .lang-btn.active,
    [data-theme="dark"] .mobile-nav-section .lang-btn:hover {
        background: linear-gradient(135deg, #4dabf7, #74c0fc);
        color: white;
    }

    /* Bootstrap 5 기반 모바일 네비게이션 토글 버튼 */
         .mobile-nav-toggle {
         width: 40px;
         height: 40px;
         border-radius: 12px;
         background: linear-gradient(135deg, #ff9a56, #ff6b35); /* 주황색 그라디언트 */
         border: none;
         color: white;
         display: flex;
         align-items: center;
         justify-content: center;
         transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
         box-shadow: 0 4px 12px rgba(255, 154, 86, 0.4); /* 주황색에 맞는 그림자 */
     }

         .mobile-nav-toggle:hover {
         transform: rotate(90deg) scale(1.1);
         box-shadow: 0 6px 20px rgba(255, 154, 86, 0.6); /* 호버 시 더 진한 주황색 그림자 */
         background: linear-gradient(135deg, #ff6b35, #e55a2b); /* 호버 시 더 진한 주황색 */
     }

    .mobile-nav-toggle i {
        font-size: 16px;
        transition: transform 0.3s ease;
    }

    /* 현재위치 버튼을 플로팅 버튼과 동일한 스타일로 적용 */
         .current-location-btn {
         position: fixed !important;
         top: 260px; /* 통계정보와 더 가깝게 (270px에서 260px로 줄임) */
         right: 20px; /* .header-stats와 동일한 우측 위치 */
         width: 56px;
         height: 56px;
         border-radius: 50%;
         background: linear-gradient(135deg, #28a745, #20c997);
         border: none;
         color: white;
         display: flex;
         align-items: center;
         justify-content: center;
         box-shadow: 0 8px 32px rgba(40, 167, 69, 0.4);
         z-index: 1000;
         transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     }

    .current-location-btn:hover {
        transform: rotate(360deg) scale(1.2);
        box-shadow: 0 12px 40px rgba(40, 167, 69, 0.6);
        background: linear-gradient(135deg, #34ce57, #17a2b8);
    }

    .current-location-btn i {
        font-size: 20px;
        transition: transform 0.3s ease;
    }

    .current-location-btn:hover i {
        transform: scale(1.1);
    }

    /* Offcanvas 메뉴 최적화 */
    #mobileOffcanvas {
        --bs-offcanvas-width: 240px !important;
        border-radius: 0 20px 20px 0;
        border: none;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }

    #mobileOffcanvas .offcanvas-header {
        background: linear-gradient(135deg, #f59e0b, #d97706) !important;
        padding: 16px 20px;
        border-radius: 0 20px 0 0;
        min-height: 60px;
    }

    #mobileOffcanvas .btn-close-white {
        opacity: 0.9;
        font-size: 14px;
        transition: all 0.3s ease;
    }

    #mobileOffcanvas .btn-close-white:hover {
        opacity: 1;
        transform: rotate(90deg) scale(1.1);
    }

    #mobileOffcanvas .offcanvas-body {
        padding: 20px 16px;
        background: var(--card-bg-color);
    }

    /* 메뉴 버튼들 최적화 */
    #mobileOffcanvas .btn-group .btn {
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 500;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    #mobileOffcanvas .btn-outline-primary {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    #mobileOffcanvas .btn-outline-primary:hover,
    #mobileOffcanvas .btn-outline-primary.active,
    #mobileOffcanvas .btn-check:checked + .btn-outline-primary {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
        border-color: var(--primary-color);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }

    #mobileOffcanvas .btn-primary {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
        border: none;
        font-weight: 600;
        padding: 10px 16px;
        border-radius: 10px;
    }

    #mobileOffcanvas .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    }

    #mobileOffcanvas .btn-outline-secondary {
        border-color: #6c757d;
        color: #6c757d;
        font-weight: 500;
    }

    #mobileOffcanvas .btn-outline-secondary:hover {
        background: linear-gradient(135deg, #6c757d, #495057);
        border-color: #6c757d;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    }

    /* 폼 라벨 최적화 */
    #mobileOffcanvas .form-label {
        font-size: 12px;
        font-weight: 600;
        color: var(--text-muted-color);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
    }

    #mobileOffcanvas .form-label i {
        color: var(--primary-color);
        margin-right: 6px;
    }

    /* 폼 스위치 최적화 */
    #mobileOffcanvas .form-check-input:checked {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
    }

    #mobileOffcanvas .form-check-label {
        font-size: 14px;
        font-weight: 500;
        color: var(--text-color);
        margin-left: 8px;
    }

    /* 다크모드 지원 */
    [data-theme="dark"] #mobileOffcanvas {
        background: var(--card-bg-color);
    }

    [data-theme="dark"] #mobileOffcanvas .offcanvas-body {
        background: var(--card-bg-color);
    }

    [data-theme="dark"] #mobileOffcanvas .form-label {
        color: var(--text-muted-color);
    }

    [data-theme="dark"] #mobileOffcanvas .form-check-label {
        color: var(--text-color);
    }

    [data-theme="dark"] #mobileOffcanvas .btn-outline-primary {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    [data-theme="dark"] #mobileOffcanvas .btn-outline-primary:hover,
    [data-theme="dark"] #mobileOffcanvas .btn-outline-primary.active,
    [data-theme="dark"] #mobileOffcanvas .btn-check:checked + .btn-outline-primary {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-hover-color));
        border-color: var(--primary-color);
        color: white;
    }

    /* 모바일 최적화 */
    @media (max-width: 576px) {
        #mobileOffcanvas {
            --bs-offcanvas-width: 200px !important;
        }

        #mobileOffcanvas .offcanvas-body {
            padding: 16px 12px;
        }

        #mobileOffcanvas .btn {
            padding: 8px 10px;
            font-size: 12px;
        }

        #mobileOffcanvas .form-label {
            font-size: 11px;
            margin-bottom: 6px;
        }

        .mobile-nav-toggle {
            width: 36px;
            height: 36px;
            border-radius: 10px;
        }

        .mobile-nav-toggle i {
            font-size: 14px;
        }

                 .current-location-btn {
             width: 50px;
             height: 50px;
             top: 245px; /* 통계정보와 더 가깝게 (260px에서 245px로 줄임) */
             right: 15px; /* header-stats와 비슷한 위치 */
         }

        .current-location-btn i {
            font-size: 18px;
        }
    }
}

/* 데스크톱 필터 버튼 스타일 */
.header-controls .btn {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.header-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    color: white;
}

.header-controls .btn.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.header-controls .btn.btn-secondary:hover {
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
    color: white;
}

/* 헤더 레이아웃 개선 */
.header {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.header-stats {
    position: fixed;
    top: 110px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    z-index: 900;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    width: 70px;
    min-height: 140px;
}

.header-stats .stat-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 6px 4px;
    text-align: center;
    width: 100%;
    min-height: 40px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-stats .stat-item.total {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-left: 3px solid #2196f3;
}

.header-stats .stat-item.available {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-left: 3px solid #4caf50;
}

.header-stats .stat-item.occupied {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    border-left: 3px solid #f44336;
}

.header-stats .stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.header-stats .stat-label {
    font-size: 10px;
    color: #666;
    margin-bottom: 2px;
    font-weight: 500;
    line-height: 1;
}

.header-stats .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

[data-theme="dark"] .header-stats {
    background: rgba(44, 44, 44, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .header-stats .stat-item {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .header-stats .stat-label {
    color: #adb5bd;
}

[data-theme="dark"] .header-stats .stat-value {
    color: #e9ecef;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

@media (min-width: 769px) {
    .mobile-menu-toggle,
    .mobile-nav-menu {
        display: none !important;
    }
    
    .header .d-none.d-md-flex {
        display: flex !important;
    }
    
    .header .d-md-none {
        display: none !important;
    }
}

/* 카카오 메뉴 오버레이 */
.kakao-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.kakao-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    z-index: 2001;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    min-width: 280px;
    display: none;
}

@media (max-width: 768px) {
    .kakao-menu {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        max-width: none;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
    }
}

.kakao-menu-header {
    background: linear-gradient(135deg, #fee500, #ffeb3b);
    color: #3c1e1e;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kakao-menu-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.kakao-menu-close {
    background: none;
    border: none;
    color: #3c1e1e;
    font-size: 20px;
    cursor: pointer;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.kakao-menu-close:hover {
    background: rgba(60, 30, 30, 0.1);
}

.kakao-menu-content {
    padding: 15px;
}

.kakao-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

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

.kakao-menu-item:hover {
    background: linear-gradient(135deg, #fee500, #ffeb3b);
    color: #3c1e1e;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(254, 229, 0, 0.3);
}

.kakao-menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.kakao-menu-item span {
    font-weight: 600;
}

/* Hide Mapbox attribution and controls */
.mapboxgl-ctrl-bottom-left {
    display: none !important;
}

/* Raw JSON details in sensor popup */
.json-details {
    margin-top: 10px;
}

.json-details summary {
    font-weight: 600;
    cursor: pointer;
}

.json-details pre {
    max-height: 200px;
    overflow: auto;
    background: var(--card-bg-color);
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--text-color);
}

.sensor-info {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 450px;
    width: 90%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (max-width: 768px) {
    .sensor-info {
        bottom: 180px;
        width: 95%;
        max-width: none;
    }
}

.dark-mode .sensor-info {
    background: rgba(28, 28, 30, 0.95);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

.sensor-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark-mode .sensor-info-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.sensor-info-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: #1c1c1e;
}

.dark-mode .sensor-info-title {
    color: #ffffff;
}

.sensor-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-available {
    background-color: #34c759;
    color: white;
}

.status-occupied {
    background-color: #ff3b30;
    color: white;
}

.sensor-info-group {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}

.dark-mode .sensor-info-group {
    background: rgba(255, 255, 255, 0.05);
}

.sensor-info-group-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1c1c1e;
}

.dark-mode .sensor-info-group-title {
    color: #ffffff;
}

.sensor-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .sensor-info-row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

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

.sensor-info-label {
    font-size: 0.9rem;
    color: #666;
    flex: 1;
}

.dark-mode .sensor-info-label {
    color: #999;
}

.sensor-info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1c1c1e;
    text-align: right;
    flex: 2;
}

.dark-mode .sensor-info-value {
    color: #ffffff;
}

.navigation-button {
    width: 100%;
    padding: 12px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 20px;
}

.navigation-button:hover {
    background: #0066d6;
}

.dark-mode .navigation-button {
    background: #0a84ff;
}

.dark-mode .navigation-button:hover {
    background: #0070e0;
}

/* 필터 스타일 */
.filter-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 250px;
}

.filter-section {
    margin-bottom: 15px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.filter-section select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    font-size: 14px;
    color: #333;
}

/* Dark mode styles */
.dark-mode .filter-container {
    background: rgba(33, 33, 33, 0.9);
}

.dark-mode .filter-section h3 {
    color: #fff;
}

.dark-mode .filter-section select {
    background-color: #333;
    border-color: #444;
    color: #fff;
}

/* Mobile styles */
@media (max-width: 768px) {
    .filter-container {
        top: auto;
        bottom: 20px;
        right: 50%;
        transform: translateX(50%);
        width: calc(100% - 40px);
        max-width: 400px;
    }
}

/* Custom Mapbox popup close button styling */
.mapboxgl-popup-close-button {
    position: absolute;
    right: -75px;
    top: 0px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 1000;
}

.mapboxgl-popup-close-button:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 모바일용 팝업 최적화 */
@media (max-width: 576px) {
    /* mapboxgl popup content 가로 스크롤 방지 */
    .mapboxgl-popup-content {
        max-width: 90vw !important;
        width: 76vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
    }
    
    .sensor-popup {
        max-width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        box-sizing: border-box;
        width: 100%;
        padding: 15px;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .sensor-details {
        display: flex;
        flex-direction: column;
        gap: 15px;
        overflow: visible !important;
        max-height: none !important;
    }

    .sensor-popup .sensor-header .sensor-status {
        font-size: 14px;
        padding: 8px 12px;
    }

    .sensor-popup .sensor-header h3 {
        font-size: 18px;
        margin-left: 12px;
        word-wrap: break-word;
    }

    .sensor-popup .detail-section h4 {
        font-size: 16px;
        margin: 12px 0;
    }

    .sensor-popup .detail-item {
        margin-bottom: 12px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .sensor-popup .detail-item:last-child {
        border-bottom: none;
    }

    .sensor-popup .detail-item .label,
    .sensor-popup .detail-item .value {
        flex: none;
        text-align: left;
        white-space: normal;
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
    }
    
    .sensor-popup .detail-item i {
        min-width: 16px;
        flex-shrink: 0;
    }
    
    .sensor-popup .detail-section {
        background: rgba(248, 249, 250, 0.8);
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .sensor-popup .detail-section h4 {
        margin: 0 0 12px 0;
        padding-bottom: 8px;
        border-bottom: 2px solid #e9ecef;
        font-size: 16px;
        font-weight: 600;
    }

    /* 길찾기 버튼을 하단 중앙에 배치 */
    .sensor-popup .directions-section {
        margin-top: 0;
        text-align: center;
        width: 100%;
        background: rgba(0, 123, 255, 0.05);
        border-radius: 12px;
        padding: 20px 15px;
        border: 1px solid rgba(0, 123, 255, 0.1);
    }

    .sensor-popup .directions-link {
        display: inline-block;
        padding: 14px 28px;
        background: linear-gradient(135deg, #007bff, #0056b3);
        color: white;
        text-decoration: none;
        border-radius: 25px;
        font-weight: 600;
        font-size: 16px;
        transition: all 0.3s ease;
        width: auto;
        min-width: 140px;
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    }

    .sensor-popup .directions-link:hover {
        background: linear-gradient(135deg, #0056b3, #004085);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    }

    /* 모바일 팝업 닫기 버튼 위치 조정 */
    .mapboxgl-popup-close-button {
        top: 5px;
        right: 5px;
        width: 30px;
        height: 30px;
        font-size: 16px;
        position: absolute !important;
        z-index: 1001;
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: 50% !important;
    }
}

/* Kakao chat button 색상 변경 */
.floating-btn.chat-btn {
    background: #F7E600 !important;
}
.floating-btn.chat-btn i {
    color: #3c1e1e !important;
}
.floating-btn.chat-btn:hover {
    background: #FFEB00 !important;
}

/* 햄버거 메뉴 버튼을 왼쪽으로 배치 */
.mobile-menu-toggle {
    right: auto;
    left: 12px;
}

/* 모바일 내비게이션 메뉴를 왼쪽에서 슬라이드 인/아웃 */
.mobile-nav-menu {
    right: auto;
    left: -280px;
}
.mobile-nav-menu.active {
    right: auto;
    left: 0;
}

/* Custom mobile menu styling for small screens */
@media (max-width: 768px) {
    /* 햄버거 메뉴 버튼을 왼쪽으로 배치 */
    .mobile-menu-toggle {
        right: auto !important;
        left: 12px !important;
    }

    /* 모바일 내비게이션 메뉴를 왼쪽에서 슬라이드 인/아웃 */
    .mobile-nav-menu {
        right: auto !important;
        left: -280px !important;
    }
    .mobile-nav-menu.active {
        left: 0 !important;
        right: auto !important;
    }

    /* 모바일 메뉴 내 버튼 간 간격 추가 */
    .mobile-nav-section .mobile-link {
        margin-bottom: 12px;
    }
}

/* ================================
   Mobile design optimization for small screens
   ================================= */
@media (max-width: 576px) {
    /* 햄버거 메뉴 버튼 크기 및 위치 조정 */
    .mobile-menu-toggle {
        top: 12px !important;
        left: 12px !important;
        width: 36px;
        height: 36px;
    }
    .mobile-menu-toggle span {
        width: 24px;
        height: 3px;
    }

    /* 모바일 사이드 메뉴 너비 축소, 슬라이드 인/아웃 최적화 */
    .mobile-nav-menu {
        width: 75% !important;
        left: -75% !important;
        transition: left 0.3s ease;
        /* 둥근 모서리와 그림자 효과 */
        border-top-right-radius: 12px;
        border-bottom-right-radius: 12px;
        box-shadow: -4px 0 12px rgba(0,0,0,0.2);
    }
    .mobile-nav-menu.active {
        left: 0 !important;
    }

    /* 사이드 메뉴 헤더 및 콘텐츠 패딩 조정 */
    .mobile-nav-header {
        padding: 10px 15px;
    }
    .mobile-nav-content {
        padding: 15px;
    }

    /* 각 섹션 간 간격 확대 */
    .mobile-nav-section {
        margin-bottom: 20px;
    }

    /* 모바일 링크 버튼 폰트 및 패딩 조정 */
    .mobile-link {
        font-size: 16px;
        padding: 14px;
    }

    /* 언어 버튼 크기 및 폰트 조정 */
    .mobile-nav-section .lang-btn {
        padding: 10px;
        font-size: 14px;
    }

    /* 모바일 컨트롤 행 레이아웃 */
    .mobile-controls-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }
    .mobile-controls-row .mobile-link {
        flex: 1;
        font-size: 14px;
        padding: 8px 10px;
    }
    .theme-container {
        display: flex;
        align-items: center;
        gap: 4px;
    }
}

/* Bootstrap btn-group 사용 시 기존 언어 선택 버튼 커스텀 스타일 비활성화 */
.mobile-nav-section .language-switcher,
.mobile-nav-section .language-switcher .lang-btn {
    all: unset;
}

/* 기존 커스텀 모바일 메뉴 숨기기 (Bootstrap Offcanvas 사용) */
.mobile-menu-toggle,
.mobile-nav-overlay,
.mobile-nav-menu,
.mobile-nav-close,
.mobile-nav-header,
.mobile-nav-content {
    display: none !important;
}

/* Offcanvas backdrop 투명화 */
.offcanvas-backdrop.show {
    background-color: transparent !important;
}

/* 모바일 플로팅 메뉴 버튼 사이즈 및 z-index 조정 */
#mobileNavToggle {
    z-index: 1030; /* Offcanvas보다 아래에 */
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a56, #ff6b35) !important; /* 주황색 그라디언트 */
    border: none;
    box-shadow: 0 4px 12px rgba(255, 154, 86, 0.4); /* 주황색에 맞는 그림자 */
    display: flex;
    align-items: center;
    justify-content: center;
}
#mobileNavToggle i {
    font-size: 20px;
    color: white;
}

/* mobileLocationBtn 삭제됨 - current-location-btn으로 교체 */

/* Offcanvas 높이 내용에 맞게 자동으로 조정 */
.offcanvas-start {
    bottom: unset !important;
    height: auto !important;
}

/* Offcanvas 내부 버튼 스타일 조정 */
.offcanvas-body .btn-group-toggle .btn {
    font-size: 1rem;
    padding: 0.6rem;
}
.offcanvas-body .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.offcanvas-body .btn-primary:hover {
    background-color: var(--primary-hover-color);
    border-color: var(--primary-hover-color);
}
.offcanvas-body .btn-lg {
    font-size: 1rem;
    padding: 0.75rem;
}

/* Offcanvas 오픈 시 폰트 색상 및 버튼 스타일 재설정 */
.offcanvas-start {
    background-color: #ffffff; /* 배경 흰색 */
}
.offcanvas-start .offcanvas-body {
    color: #333333; /* 본문 폰트 색상 */
}
.offcanvas-start .offcanvas-body .btn {
    color: #ffffff !important; /* 버튼 텍스트 흰색 */
    background-color: var(--primary-color) !important; /* 주 색상 */
    width: 100%;
    margin-bottom: 0.5rem;
}
.offcanvas-start .offcanvas-body .btn.btn-outline-secondary {
    color: var(--primary-color) !important;
    background-color: #ffffff !important;
    border-color: var(--primary-color) !important;
}

/* 메뉴 버튼 및 현재 위치 버튼 Hover 및 Active 상태 */
#mobileNavToggle:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
    background: linear-gradient(135deg, #ff6b35, #e55a2b) !important; /* 호버 시 더 진한 주황색 */
    box-shadow: 0 6px 20px rgba(255, 154, 86, 0.6); /* 호버 시 더 진한 그림자 */
}
#mobileNavToggle:active {
    transform: scale(0.9);
    transition: transform 0.1s ease;
}

/* Offcanvas 메뉴 위치 조정: 네비게이션 아래에서 시작 */
.offcanvas-start {
    top: calc(var(--header-height) + 0px) !important;
    bottom: unset !important;
    height: auto !important;
}

/* Offcanvas backdrop Blur 효과 */
.offcanvas-backdrop.show {
    background-color: rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(8px);
}

/* 영어 모드 네비게이션 타이틀 폰트 축소 */
html[lang="en"] .site-title {
    font-size: 1.3rem !important;
}

/* Offcanvas 내부 언어 버튼 그룹: Glassy 디자인 */
 .offcanvas-body .btn-group-toggle {
    display: flex;
    gap: 0;
    background-color: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    padding: 2px;
    overflow: hidden;
    margin: 0 auto 1rem;
    width: 100%;
    max-width: 240px;
 }
 .offcanvas-body .btn-group-toggle .btn {
    font-size: 1rem;
    padding: 0.5rem 0;
    flex: 1;
    border: none;
    background-color: transparent;
    color: var(--text-color);
    transition: background-color 0.2s ease;
 }
.offcanvas-body .btn-group-toggle .btn:first-child {
    border-top-left-radius: 40px;
    border-bottom-left-radius: 40px;
}
.offcanvas-body .btn-group-toggle .btn:last-child {
    border-top-right-radius: 40px;
    border-bottom-right-radius: 40px;
}
.offcanvas-body .btn-group-toggle .btn.active {
    background-color: rgba(255,255,255,0.6);
}

/* Bottom Sheet (offcanvas-bottom) 스타일 */
.offcanvas-bottom {
    top: calc(var(--header-height)) !important;
    bottom: 0 !important;
    --bs-offcanvas-height: 50vh;
    height: auto !important;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    background-color: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(15px);
}
.offcanvas-bottom .offcanvas-body {
    padding: 1rem;
    backdrop-filter: blur(15px);
    background-color: transparent;
}

/* Bottom Sheet Overlay */
.bottom-sheet-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.2);
    backdrop-filter: blur(6px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}
.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 기존 bottom-sheet 스타일 제거됨 - 새로운 디자인으로 대체 */

.bottom-sheet .sheet-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
}
.bottom-sheet .sheet-dragger {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}
.bottom-sheet .sheet-close {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.bottom-sheet .sheet-content {
    padding: 16px;
    overflow-y: auto;
}

/* Bottom Sheet Styles - Apple Glass Liquid Design */
.sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1045;
}

.sheet-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1050;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1), 0 -1px 20px rgba(0, 0, 0, 0.05);
    max-height: 70vh;
    overflow: hidden;
}

.bottom-sheet.show {
    transform: translateY(0);
}

.bottom-sheet-header {
    padding: 16px 20px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.bottom-sheet-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.bottom-sheet-header .btn-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.bottom-sheet-header .btn-close:hover {
    opacity: 1;
}

.bottom-sheet-content {
    padding: 20px;
    max-height: calc(70vh - 60px);
    overflow-y: auto;
}

/* 언어 토글 버튼 그룹 - Glass 효과 */
.bottom-sheet-content .btn-group {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    margin-bottom: 20px;
}

.bottom-sheet-content .btn-group .btn {
    border: none;
    background: transparent;
    color: #333333 !important; /* 기본 텍스트 색상을 진한 색으로 */
    font-weight: 500;
    padding: 12px 0;
    transition: all 0.3s ease;
    flex: 1;
    border-radius: 16px;
    margin: 0 2px;
}

.bottom-sheet-content .btn-group .btn.active {
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary-color) !important; /* 활성 상태는 주색 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 주요 액션 버튼들 */
.bottom-sheet-content .btn-primary {
    background: var(--primary-color) !important; /* 단색 배경으로 변경 */
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-weight: 600;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.bottom-sheet-content .btn-primary:hover,
.bottom-sheet-content .btn-primary:focus {
    background: #0056b3 !important; /* 호버 시 더 진한 색 */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 102, 204, 0.4);
}

/* 테마 스위치 - PC 버전과 동일한 디자인 */
.bottom-sheet-content .theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.bottom-sheet-content .theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.bottom-sheet-content .theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bottom-sheet-content .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: 0.4s;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bottom-sheet-content .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
    background: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bottom-sheet-content input:checked + .slider {
    background: var(--primary-color);
}

.bottom-sheet-content input:checked + .slider:before {
    transform: translateX(30px);
}

.bottom-sheet-content .slider .icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: opacity 0.3s ease;
}

.bottom-sheet-content .slider .sun {
    left: 6px;
    color: #ffa500;
}

.bottom-sheet-content .slider .moon {
    right: 6px;
    color: #4a90e2;
}

.bottom-sheet-content input:checked + .slider .sun {
    opacity: 0.3;
}

.bottom-sheet-content input:not(:checked) + .slider .moon {
    opacity: 0.3;
}

.bottom-sheet-content .theme-label {
    margin-left: 12px;
    font-weight: 500;
    color: var(--text-color);
}

/* 다크 모드 지원 */
[data-theme="dark"] .bottom-sheet {
    background: rgba(28, 28, 30, 0.9);
    color: white;
}

[data-theme="dark"] .bottom-sheet-content .btn-group {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .bottom-sheet-content .btn-group .btn.active {
    background: rgba(99, 99, 102, 0.8);
    color: white;
}

[data-theme="dark"] .bottom-sheet-content .slider {
    background: rgba(44, 44, 46, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .bottom-sheet-content {
        padding: 16px;
    }
    
    .bottom-sheet-content .btn-primary {
        padding: 14px;
        font-size: 16px;
    }
}

/* 필터 모달 요일 선택 반응형 */
#day-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
#day-filter .btn {
    flex: 1 1 3rem;
    min-width: 3rem;
}

/* 아이콘이 들어간 필터 레이블용 스타일 */
.filter-icon {
    margin-right: 0.5em;
    color: var(--text-color);
}

/* Dark mode time input styling */
[data-theme="dark"] input[type="time"] {
    background-color: #343a40;
    color: #ffffff;
    border: 1px solid #495057;
}

/* Mobile menu popover custom style */
.sheet-backdrop {
    display: none !important;
}
.bottom-sheet {
    position: fixed !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    border-radius: 12px !important;
    transform: scale(0);
    transform-origin: center;
    transition: all 0.3s ease-out !important;
    overflow-y: auto !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
    z-index: 1050 !important;
}

/* PC 버전 스타일 */
@media (min-width: 769px) {
    .bottom-sheet {
        top: 50% !important;
        left: 50% !important;
        width: 90% !important;
        max-width: 400px !important;
        max-height: 80vh !important;
        transform: translate(-50%, -50%) scale(0);
    }
}

/* 모바일 버전 스타일 */
@media (max-width: 768px) {
    .bottom-sheet {
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-height: 90vh !important;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%) scale(1);
    }
}
/* PC 버전 show 스타일 */
@media (min-width: 769px) {
    .bottom-sheet.show {
        transform: translate(-50%, -50%) scale(1) !important;
    }
}

/* 모바일 버전 show 스타일 */
@media (max-width: 768px) {
    .bottom-sheet.show {
        transform: translateY(0) scale(1) !important;
    }
}

/* Dark mode filter settings backgrounds */
[data-theme="dark"] .input-method-toggle,
[data-theme="dark"] .time-controls {
    background: var(--card-bg-color) !important;
    border-color: var(--border-color) !important;
}

/* Dark mode filter labels */
[data-theme="dark"] .time-select-group label,
[data-theme="dark"] .time-range-group label {
    color: var(--text-color) !important;
}

/* 모바일 Offcanvas 높이 조정 */
#mobileOffcanvas {
    --bs-offcanvas-height: auto !important;
    height: auto !important;
    top: calc(var(--header-height) + 10px) !important;
    bottom: auto !important;
    border-radius: 0 8px 8px 0 !important;
}

/* 다크모드 테마 레이블 가시성 (모바일 Offcanvas 포함) */
[data-theme="dark"] .theme-switch-wrapper .theme-label {
    color: black !important;
}

/* 다크모드 가격 필터 입력 가시성 */
[data-theme="dark"] #price-filter {
    background-color: var(--card-bg-color) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
}

/* 모바일 타이틀 폰트 고정 */
@media (max-width: 576px) {
    .header-left h1 {
        font-size: 17px !important;
    }
}

/* days 버튼 줄바꿈 방지 */
#day-filter .btn {
    white-space: nowrap !important;
    font-size: 0.9rem;
}

/* 모바일에서만 다크모드 테마 레이블 검정색 적용 */
@media (max-width: 576px) {
    [data-theme="dark"] .theme-switch-wrapper .theme-label {
        color: black !important;
    }
}

/* PC 네비게이션: .header-content 중앙-좌우 정렬 복원 */
@media (min-width: 768px) {
    .header-content {
        justify-content: space-between !important;
    }
    /* 다크모드 네비게이션 버튼 가시성 향상 */
    [data-theme="dark"] .header-controls .action-btn {
        background-color: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
    [data-theme="dark"] .header-controls .action-btn:hover {
        background-color: rgba(255, 255, 255, 0.2) !important;
    }
}

/* 모바일 오프캔버스 헤더 중앙 정렬 */
@media (max-width: 576px) {
    #mobileOffcanvas .offcanvas-header {
        justify-content: center !important;
        position: relative;
        padding: 5px 15px !important;
        min-height: 50px !important;
    }
    #mobileOffcanvas .offcanvas-header .offcanvas-title {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        font-size: 1rem;
    }
    #mobileOffcanvas .offcanvas-header .btn-close {
        position: absolute;
        right: 1rem;
    }

    /* bottom-sheet 위치 조정 */
    .bottom-sheet {
        bottom: calc(var(--header-height) + 328px) !important;
    }
    
    /* 작은 화면에서 모바일 컴포넌트 최적화 */
    .mobile-current-location-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
        bottom: 100px;
        right: 12px;
    }
    
    .mobile-menu-toggle {
        width: 38px;
        height: 38px;
    }
    
    .mobile-menu-toggle span {
        width: 16px;
    }
    
    .mobile-nav-menu {
        width: 280px;
        right: -280px;
    }
    
    .header-stats {
        top: 85px;
        right: 8px;
        padding: 6px 4px;
        min-width: 79px;
    }
    
    .header-stats .stat-item {
        padding: 4px 6px;
        min-width: 40px;
    }
    
    .header-stats .stat-label {
        font-size: 9px;
    }
    
    .header-stats .stat-value {
        font-size: 12px;
    }
}

/* ==============================================
   Bootstrap 5 기반 모바일 UI 개선
   ============================================== */

/* Bootstrap 5 기반 Offcanvas 메뉴 스타일링 */
#mobileOffcanvas {
    --bs-offcanvas-bg: rgba(255, 255, 255, 0.98);
    --bs-offcanvas-border-width: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

/* offcanvas 헤더 개선 */
#mobileOffcanvas .offcanvas-header {
    padding: 0.75rem 1.5rem;
    border-bottom: none;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-top-right-radius: 0;
    min-height: 50px;
}

#mobileOffcanvas .offcanvas-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

#mobileOffcanvas .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
    transition: all 0.3s ease;
}

#mobileOffcanvas .btn-close-white:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* offcanvas 바디 개선 */
#mobileOffcanvas .offcanvas-body {
    padding: 1.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
}

/* 버튼 그룹 스타일링 */
#mobileOffcanvas .btn-group .btn {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-width: 2px;
    transition: all 0.3s ease;
}

#mobileOffcanvas .btn-outline-primary {
    border-color: #f59e0b;
    color: #f59e0b;
}

#mobileOffcanvas .btn-outline-primary:hover,
#mobileOffcanvas .btn-outline-primary.active {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* 기능 버튼들 */
#mobileOffcanvas .btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    font-weight: 600;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#mobileOffcanvas .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 123, 255, 0.3);
}

#mobileOffcanvas .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
    font-weight: 600;
}

#mobileOffcanvas .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
}

#mobileOffcanvas .btn-outline-info {
    border-color: #17a2b8;
    color: #17a2b8;
    font-weight: 600;
}

#mobileOffcanvas .btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
    transform: translateY(-1px);
}

#mobileOffcanvas .btn-outline-success {
    border-color: #28a745;
    color: #28a745;
    font-weight: 600;
}

#mobileOffcanvas .btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    transform: translateY(-1px);
}

/* 폼 라벨 스타일링 */
#mobileOffcanvas .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* 폼 스위치 개선 */
#mobileOffcanvas .form-check-input:checked {
    background-color: #f59e0b;
    border-color: #f59e0b;
}

#mobileOffcanvas .form-check-label {
    font-weight: 500;
    color: #495057;
}

/* 다크모드 지원 */
[data-theme="dark"] #mobileOffcanvas {
    --bs-offcanvas-bg: rgba(44, 44, 44, 0.98);
}

[data-theme="dark"] #mobileOffcanvas .offcanvas-body {
    background: rgba(44, 44, 44, 0.95);
}

[data-theme="dark"] #mobileOffcanvas .form-label {
    color: #adb5bd;
}

[data-theme="dark"] #mobileOffcanvas .form-check-label {
    color: #e9ecef;
}

[data-theme="dark"] #mobileOffcanvas .btn-outline-primary {
    border-color: #ffc107;
    color: #ffc107;
}

[data-theme="dark"] #mobileOffcanvas .btn-outline-primary:hover,
[data-theme="dark"] #mobileOffcanvas .btn-outline-primary.active {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

/* 추가 모바일 최적화 */
@media (max-width: 576px) {
    #mobileOffcanvas {
        --bs-offcanvas-width: 300px;
    }
    
    #mobileOffcanvas .offcanvas-body {
        padding: 1rem;
    }
    
    #mobileOffcanvas .btn {
        font-size: 0.875rem;
        padding: 0.6rem 0.8rem;
    }
    
    #mobileOffcanvas .form-label {
        font-size: 0.75rem;
    }
}

/* 모바일 센서 팝업 가로 스크롤 방지 및 길찾기 버튼 중앙 정렬 */
@media (max-width: 576px) {
    .mapboxgl-popup-content {
        max-width: 90vw !important;
        width: 76vw !important;
        max-height: 65vh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
        position: relative !important;
        /* 스크롤 모멘텀 개선 */
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
        /* 스크롤 성능 개선 */
        will-change: scroll-position !important;
        transform: translateZ(0) !important;
        /* iOS Safari 스크롤 개선 */
        -webkit-transform: translateZ(0) !important;
        -webkit-backface-visibility: hidden !important;
        /* 스크롤바 스타일링 */
        scrollbar-width: thin !important;
        scrollbar-color: rgba(0,0,0,0.3) transparent !important;
    }
    
    /* 웹킷 기반 브라우저 스크롤바 스타일링 */
    .mapboxgl-popup-content::-webkit-scrollbar {
        width: 4px !important;
    }
    
    .mapboxgl-popup-content::-webkit-scrollbar-track {
        background: transparent !important;
    }
    
    .mapboxgl-popup-content::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.3) !important;
        border-radius: 2px !important;
    }
    
    /* 팝업 내부 콘텐츠 스크롤 최적화 */
    .sensor-popup {
        position: relative !important;
        overflow: visible !important;
    }
    
    .sensor-details {
        overflow: visible !important;
        /* 내부 스크롤 방지로 메인 스크롤만 사용 */
        max-height: none !important;
    }
    
    .sensor-popup .directions-section {
        width: 100% !important;
        text-align: center !important;
        padding: 15px 0 10px 0 !important;
        margin-top: 15px !important;
        border-top: 1px solid #eee !important;
        background: white !important;
    }
    .sensor-popup .directions-link {
        display: inline-block !important;
        margin: 0 auto !important;
        padding: 10px 20px !important;
        background: #007bff !important;
        color: white !important;
        text-decoration: none !important;
        border-radius: 6px !important;
        font-weight: 600 !important;
        transition: all 0.3s ease !important;
    }
    .sensor-popup .directions-link:hover {
        background: #0056b3 !important;
        color: white !important;
        text-decoration: none !important;
        transform: translateY(-1px) !important;
    }
}

/* 모바일 전용 header h1 font-size 조정 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 18px;
    }
}

