/* 선택 모드에서 hover 비활성화 */
body.has-selected-course .course-row:not(.selected):hover {
    background-color: transparent !important;
    cursor: default;
}

body.has-selected-course .mobile-course-card:not(.selected):hover {
    background-color: transparent !important;
    cursor: default;
}

/* 선택된 코스가 있을 때 전체 다운로드 버튼과 필터 숨기기 */
body.has-selected-course .download-all-section,
body.has-selected-course .filter-section {
    display: none !important;
}

/* 선택된 코스가 있을 때 테이블 헤더 숨기기 */
body.has-selected-course .courses-table thead {
    display: none !important;
}

.permanent-container {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 30px;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0 auto;
}

.permanent-header {
    text-align: center;
    margin-bottom: 5px;
    padding: 40px 20px;
    border-bottom: 1px solid #2a2a2a;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.permanent-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff9494, transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.permanent-header h2 {
    color: #ff9494;
    font-size: 2.5em;
    margin-top:0px;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ff9494 0%, #ffb5b5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.permanent-header p {
    color: #b0b0b0;
    font-size: 1.1em;
    margin-top:0px;
    margin-bottom: 12px;
    line-height: 1.6;
    font-weight: 400;
}

.permanent-header p:first-of-type {
    font-size: 1.15em;
    color: #c0c0c0;
}

.permanent-header a {
    color: #ff9494;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding-bottom: 2px;
}

.permanent-header a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ffb5b5;
    transition: width 0.3s ease;
}

.permanent-header a:hover {
    color: #ffb5b5;
}

.permanent-header a:hover::after {
    width: 100%;
}

.permanent-header .update-info {
    display: inline-block;
    background-color: rgba(255, 148, 148, 0.1);
    border: 1px solid rgba(255, 148, 148, 0.2);
    border-radius: 20px;
    padding: 2px 10px;
    margin-top: 0px;
    margin-bottom: 0px;
    font-size: 0.9em;
    color: #ff9494;
    transition: all 0.3s ease;
}

.permanent-header .update-info:hover {
    background-color: rgba(255, 148, 148, 0.15);
    transform: translateY(-1px);
}

.permanent-header .update-info:last-child {
    background-color: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    color: #FFD700;
    margin-left: 8px;
}

.permanent-header .update-info:last-child:hover {
    background-color: rgba(255, 215, 0, 0.15);
}

.download-section {
    background-color: #252525;
    border: 2px solid #ff9494;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    text-align: center;
    transition: all 0.3s ease;
}

.download-section:hover {
    background-color: #2a2a2a;
    box-shadow: 0 4px 15px rgba(255, 148, 148, 0.2);
}

/* 필터 섹션 - 더욱 슬림하게 수정 */
.filter-section {
    background-color: #252525;
    border-radius: 8px;
    padding: 8px 15px;
    margin: 4px 0;
    border: 1px solid #333;
}

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

.filter-group {
    flex: 1;
    min-width: 180px;
    position: relative;
}

.filter-label {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff9494;
    font-weight: 500;
    font-size: 0.6em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    background-color: transparent;
    padding: 0px;
}

.slider-container {
    position: relative;
    margin-bottom: 0;
    padding: 15px 20px 5px 20px;
}

.slider-track {
    position: relative;
    height: 3px;
    background-color: #3a3a3a;
    border-radius: 2px;
    margin: 0;
}

.slider-range {
    position: absolute;
    height: 100%;
    background-color: #ff9494;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.slider-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 18px;
    background-color: #2a2a2a;
    border: 1px solid #ff9494;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-thumb::after {
    content: attr(data-value);
    font-size: 0.55em;
    color: #ff9494;
    font-weight: 600;
    white-space: nowrap;
}

.slider-thumb:hover {
    background-color: #333;
    border-color: #ffb5b5;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 2px 6px rgba(255, 148, 148, 0.4);
}

.slider-thumb.active {
    background-color: #333;
    border-color: #ffb5b5;
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 2px 8px rgba(255, 148, 148, 0.6);
}

/* 기존 슬라이더 값 표시 숨기기 */
.slider-values {
    display: none;
}

/* 필터 통계 제거 */
.filter-stats {
    display: none;
}

.download-all-section {
    margin: 4px 0;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* 다운로드 버튼을 배지 스타일로 변경 */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0px;
    background-color: #ff9494;
    border: 1px solid #444;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    color: black;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;  /* 텍스트 줄바꿈 방지 추가 */
}

.download-btn:hover {
    background-color: #333;
    border-color: #555;
    color: #aaa;
    transform: none;
    box-shadow: none;
}

.download-btn.active,
.download-btn:active {
    background-color: rgba(255, 148, 148, 0.2);
    border-color: #ff9494;
    color: #ff9494;
}

/* 배지 필터 스타일 */
.filter-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;  /* 화면이 좁을 때 줄바꿈 허용 */
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #888;
    white-space: nowrap;  /* 텍스트 줄바꿈 방지 */
}

.filter-badge:hover {
    background-color: #333;
    border-color: #555;
    color: #aaa;
}

.filter-badge.active {
    background-color: rgba(255, 148, 148, 0.2);
    border-color: #ff9494;
    color: #ff9494;
}

.filter-badge.active:hover {
    background-color: rgba(255, 148, 148, 0.3);
}

.filter-badge-icon {
    font-size: 0.9em;
}

.filter-badge-text {
    font-weight: 500;
    white-space: nowrap;  /* 텍스트 줄바꿈 방지 추가 */
}

/* 별표 배지 - 텍스트 없는 버전 */
.filter-badge[data-filter="starred"] {
    padding: 1px 4px;
}

.filter-badge[data-filter="starred"] .filter-badge-icon {
    color: #FFD700;
    font-size: 1em;
}

.filter-badge[data-filter="starred"].active {
    background-color: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
    color: #FFD700;
}

/* 회색 별표 배지 */
.filter-badge[data-filter="unstarred"] {
    padding: 1px 4px;
}

.filter-badge[data-filter="unstarred"] .filter-badge-icon {
    color: #888;
    font-size: 1em;
}

.filter-badge[data-filter="unstarred"].active {
    background-color: rgba(136, 136, 136, 0.2);
    border-color: #888;
    color: #aaa;
}

.filter-badge[data-filter="unstarred"].active .filter-badge-icon {
    color: #aaa;
}

/* 어드벤처 배지 */
.filter-badge[data-filter="adventure"] .filter-badge-icon {
    color: #4CAF50;
}

.filter-badge[data-filter="adventure"].active {
    background-color: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    color: #4CAF50;
}

/* 백두대간 배지 */
.filter-badge[data-filter="baekdu"] .filter-badge-icon {
    color: #2196F3;
}

.filter-badge[data-filter="baekdu"].active {
    background-color: rgba(33, 150, 243, 0.2);
    border-color: #2196F3;
    color: #2196F3;
}

/* 딸기 배지 */
.filter-badge[data-filter="strawberry"] .filter-badge-icon {
    color: #FF1744;
}

.filter-badge[data-filter="strawberry"].active {
    background-color: rgba(255, 23, 68, 0.2);
    border-color: #FF1744;
    color: #FF1744;
}

/* 갈매기 배지 */
.filter-badge[data-filter="seagull"] .filter-badge-icon {
    color: #00BCD4;
}

.filter-badge[data-filter="seagull"].active {
    background-color: rgba(0, 188, 212, 0.2);
    border-color: #00BCD4;
    color: #00BCD4;
}

/* 강에서 바다로 배지 */
.filter-badge[data-filter="riverToSea"] .filter-badge-icon {
    color: #9C27B0;
}

.filter-badge[data-filter="riverToSea"].active {
    background-color: rgba(156, 39, 176, 0.2);
    border-color: #9C27B0;
    color: #9C27B0;
}

/* 고도 프로필 섹션 - 수정됨 */
.elevation-profile-section {
    margin: 5px 0;
    background-color: #252525;
    border-radius: 8px;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
}

.elevation-profile-chart {
    padding: 0px;
    height: 150px; /* 원래의 절반 높이 */
    position: relative;
}

#elevation-chart {
    width: 100% !important;
    height: 100% !important;
}

/* 테이블 스타일 */
.courses-table-wrapper {
    margin-top: 5px;
    overflow-x: auto;
    background-color: #252525;
    border-radius: 8px;
    border: 1px solid #333;
}

.courses-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.courses-table thead {
    background-color: #2a2a2a;
    border-bottom: 2px solid #ff9494;
}

.courses-table th {
    padding: 5px;
    text-align: left;
    color: #ff9494;
    font-weight: 600;
    white-space: nowrap;
}

.courses-table th.column-star {
    width: 30px;
    text-align: center;
    font-size: 0.8em;
    color: #FFD700;
}

.courses-table th.column-number {
    width: 60px;
    white-space: nowrap;
    font-size: 0.85em;
}

.courses-table th.column-name {
    font-size: 0.85em;
    min-width: 130px;
}

.courses-table th.column-info {
    font-size: 0.85em;
    min-width: 370px;
    text-align: left;
}

.courses-table th.column-download {
    font-size: 0.85em;
    width: 0px;
    text-align: center;
}

.courses-table tbody tr {
    border-bottom: 1px solid #333;
    transition: all 0.2s ease;
}

.courses-table tbody tr:hover {
    background-color: #2a2a2a;
}

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

.courses-table tbody tr.filtered-out {
    display: none;
}

.courses-table td {
    padding: 5px !important;
    color: #e0e0e0;
}

.courses-table td.column-star {
    text-align: center;
    width: 30px;
    padding: 12px 5px;
}

.courses-table td.column-number {
    white-space: nowrap;
    width: 60px;
    padding: 12px 5px;
}

.courses-table td.column-name {
    padding: 12px 10px;
}

.courses-table td.column-info {
    padding: 12px 10px;
    text-align: left;
}

.course-name {
    font-weight: 500;
    color: #e0e0e0;
    font-size: 0.95em;
}

.course-info-cards {
    display: inline-flex;
    gap: 2px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.info-card {
    display: inline-flex;
    align-items: center;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 0.75em;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.info-card:hover {
    background-color: #333;
    border-color: #444;
}

.info-label {
    color: #888;
    margin-right: 4px;
    font-weight: 400;
}

.info-value {
    color: #b0b0b0;
    font-weight: 500;
}

.distance-card {
    background-color: #1a3a1a;
    border-color: #2a4a2a;
}

.distance-card .info-value {
    color: #4CAF50;
}

.elevation-card {
    background-color: #3a2a1a;
    border-color: #4a3a2a;
}

.elevation-card .info-value {
    color: #FF9800;
}

.time-card {
    background-color: #1a2a3a;
    border-color: #2a3a4a;
}

.time-card .info-value {
    color: #2196F3;
}

.route-card {
    background-color: #2a2a3a;
    border-color: #3a3a4a;
}

.route-card .info-value {
    color: #B39DDB;
}

.courses-table td.column-download {
    text-align: center;
}

.download-links {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
}

.course-star {
    color: #FFD700;
    font-weight: bold;
    font-size: 1em;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    animation: twinkle 2s ease-in-out infinite;
}

.leaflet-container .leaflet-control-attribution{
    display: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.course-number {
    color: #ff9494;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.9em;
}

.download-link {
    display: inline-block;
    padding: 0px 5px;
    background-color: #333;
    color: #e0e0e0;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85em;
    transition: all 0.3s ease;
    border: 1px solid #444;
}

.download-link:hover {
    background-color: #ff9494;
    color: #1a1a1a;
    border-color: #ff9494;
    transform: translateY(-1px);
}

.gpx-link {
    background-color: #ff9494;
    color:black;
    font-weight: 500;
}

.gpx-link:hover {
    background-color: #ff8e14;
}

.tcx-link {
    background-color: #ff9494;
    color:black;
    font-weight: 500;
}

.tcx-link:hover {
    background-color: #ff8e14;
}

.update-info {
    text-align: center;
    color: #888;
    font-size: 0.9em;
    margin-top: 20px;
}

/* 지도 섹션 스타일 */
.permanent-map-section {
    margin: 4px 0;
    background-color: #252525;
    border-radius: 8px;
    padding: 0px;
    border: 1px solid #333;
    position: relative;
}

/* 지도 컨트롤 컨테이너 */
.map-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 줌 컨트롤 그룹 */
.zoom-controls {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: none !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65) !important;
    border-radius: 4px;
    overflow: hidden;
}

.zoom-controls .map-control-btn {
    background: #1a1a1a !important;
    color: #ff9494 !important;
    border: none !important;
    border-radius: 0;
    width: 30px !important;
    height: 30px !important;
    padding: 0;
    margin: 0;
    transition: all 0.2s !important;
    box-shadow: none !important;
}

.zoom-controls .map-control-btn:first-child {
    border-radius: 4px 4px 0 0 !important;
}

.zoom-controls .map-control-btn:last-child {
    border-radius: 0 0 4px 4px !important;
    border-top: 1px solid rgba(0,0,0,0.2) !important;
}

.zoom-controls .map-control-btn:hover {
    background: #2a2a2a !important;
}

.zoom-controls .map-control-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.zoom-in-btn svg {
    margin-top: 5px;
}

/* 전체화면 버튼 */
.map-fullscreen-btn {
    background: #1a1a1a !important;
    color: #ff9494 !important;
    border: 0px solid rgba(0,0,0,0.2) !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0;
    margin: 0;
    border-radius: 4px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65) !important;
}

.map-fullscreen-btn:hover {
    background: #2a2a2a !important;
    color: #ff9494 !important;
    transform: none !important;
}

.map-fullscreen-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 현재 위치 버튼 */
.map-location-btn {
    background: #1a1a1a !important;
    color: #ff9494 !important;
    border: 0px solid rgba(0,0,0,0.2) !important;
    width: 30px !important;
    height: 30px !important;
    padding: 0;
    margin: 0;
    border-radius: 4px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65) !important;
}

.map-location-btn:hover {
    background: #2a2a2a !important;
    color: #ff9494 !important;
    transform: none !important;
}

.map-location-btn.active {
    background: #2196F3 !important;
    color: white !important;
}

.map-location-btn.active:hover {
    background: #1976D2 !important;
}

.map-location-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 현재 위치 아이콘 애니메이션 */
.current-location-icon {
    z-index: 2000 !important;
}

.current-location-icon svg {
    animation: pulse-scale 2s ease-in-out infinite;
}

@keyframes pulse-scale {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
/* 가장 가까운 지점 아이콘 */
.closest-point-icon {
    z-index: 1999 !important;
}

.closest-point-icon svg {
    animation: gentle-pulse 2s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}
/* 위치 찾는 중 표시 */
.location-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(26, 26, 26, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    border-radius: 8px;
}

.location-loading-content {
    background-color: rgba(37, 37, 37, 0.95);
    padding: 20px 30px;
    border-radius: 8px;
    border: 1px solid #ff9494;
    display: flex;
    align-items: center;
    gap: 15px;
}

.location-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 148, 148, 0.3);
    border-top: 3px solid #ff9494;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.location-loading-text {
    color: #ff9494;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 전체화면 모드 스타일 */
.permanent-map-section.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    margin: 0;
    border-radius: 0;
    padding: 0;
    max-width: none !important;
    width: 100% !important;
    height: 100% !important;
}

.permanent-map-section.fullscreen .permanent-courses-map {
    height: 100% !important;
    border-radius: 0;
}

.permanent-map-section.fullscreen .map-controls {
    top: 20px;
    right: 20px;
}

.permanent-courses-map {
    width: 100%;
    height: 500px;
    border-radius: 6px;
    position: relative;
    background-color: #1a1a1a;
    overflow: hidden;
}

/* Progressive Loading 스타일 */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(26, 26, 26, 0.95);
    color: #ff9494;
    padding: 20px 40px;
    border-radius: 8px;
    border: 1px solid #ff9494;
    font-weight: 500;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 148, 148, 0.3);
    border-top-color: #ff9494;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-progress {
    display: inline-block;
    margin-left: 10px;
    color: #ffb5b5;
    font-size: 0.9em;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* CP 마커 스타일 */
.cp-icon {
    z-index: 1500 !important;
}
.cp-icon div {
    z-index: 1501 !important;
}

/* 출발/도착 마커 스타일 */
.start-icon,
.finish-flag-icon {
    z-index: 1600 !important;
}
/* CP 팝업 스타일 */
.cp-popup-wrapper {
    min-width: 200px;
}

.cp-popup-wrapper .leaflet-popup-content-wrapper {
    background-color: rgba(26, 26, 26, 0.95);
    color: #e0e0e0;
    border: 1px solid #2196F3;
    border-radius: 8px;
}
.leaflet-popup-content {
    margin: 5px !important;
    width:193px !important;
}
.cp-popup-wrapper .leaflet-popup-tip {
    background-color: rgba(26, 26, 26, 0.95);
    border-bottom: 1px solid #2196F3;
}

.cp-popup h4 {
    margin: 0 0 4px 0;
    color: #2196F3;
    font-size: 1.1em;
    font-weight: 600;
}

.cp-popup p {
    margin: 0.1em 0 !important;
    font-size: 0.9em;
    line-height: 1.4;
}

.cp-popup .cp-distance {
    color: #4CAF50;
    font-size: 1em;
    font-weight: 600;
    margin: 0;
}

.cp-popup .cp-image {
    margin-top: 0.2em;
    border-radius: 4px;
    overflow: hidden;
}

.cp-popup .cp-image img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

/* 선택되지 않은 코스 투명도 */
.course-row.dimmed {
    opacity: 0.3;
}

.mobile-course-card.dimmed {
    opacity: 0.3;
}

.mobile-course-card.filtered-out {
    display: none;
}

/* 테이블 행 하이라이트 효과 */
.course-row.highlighted {
    background-color: rgba(255, 148, 148, 0.1) !important;
}

.course-row.selected {
    background-color: rgba(255, 148, 148, 0.15) !important;
    border-left: 3px solid #ff9494;
    opacity: 1 !important;
}

.course-row.flash {
    animation: flash-animation 1.5s ease-out;
}

@keyframes flash-animation {
    0%, 100% { background-color: transparent; }
    25%, 75% { background-color: rgba(255, 148, 148, 0.2); }
    50% { background-color: rgba(255, 148, 148, 0.3); }
}

/* Leaflet 기본 컨트롤 숨기기 */
.leaflet-control-zoom {
    display: none !important;
}

.leaflet-control-attribution {
    background-color: rgba(37, 37, 37, 0.8) !important;
    color: #888 !important;
}

.leaflet-control-attribution a {
    color: #ff9494 !important;
}

/* 비활성화된 polyline 스타일 */
.leaflet-pane path.non-interactive {
    pointer-events: none !important;
    cursor: default !important;
}

/* 모바일 전용 요소들 (기본적으로 숨김) */
.mobile-course-cards {
    display: none;
}

/* 모바일 카드 하이라이트 및 애니메이션 효과 */
.mobile-course-card.highlighted {
    background-color: rgba(255, 148, 148, 0.1) !important;
}

.mobile-course-card.selected {
    background-color: rgba(255, 148, 148, 0.15) !important;
    border: 1px solid #ff9494 !important;
    box-shadow: 0 2px 8px rgba(255, 148, 148, 0.2);
    opacity: 1 !important;
}

.mobile-course-card.flash {
    animation: mobile-flash-animation 1.5s ease-out;
}

@keyframes mobile-flash-animation {
    0%, 100% { 
        background-color: transparent;
        transform: scale(1);
    }
    25%, 75% { 
        background-color: rgba(255, 148, 148, 0.2);
        transform: scale(1.02);
    }
    50% { 
        background-color: rgba(255, 148, 148, 0.3);
        transform: scale(1.03);
    }
}

/* 모바일 반응형 디자인 (600px 이하) */
@media (max-width: 600px) {
    .permanent-container {
        padding: 0px;
        background-color: transparent;
    }
    
    .permanent-header {
        padding: 20px 15px;
        margin-bottom: 2px;
        padding-bottom: 0px;
    }
    
    .permanent-header::before {
        display: none;
    }
    
    .permanent-header h2 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .permanent-header p {
        font-size: 0.75em !important;
        margin-bottom: 8px;
    }
    
    .permanent-header .update-info {
        display: block;
        margin: 8px auto;
        font-size: 0.8em;
        padding: 1px;
    }
    
    .permanent-header .update-info:last-child {
        margin-left: auto;
    }
    
    .download-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .download-section h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .download-all-section {
        margin: 2px 0;
        gap: 3px;
        text-align: center;
        flex-direction: row;
        align-items: center;
    }
    
    .filter-badges {
        margin-top: 3px;
    }
    
    /* 테이블 숨기고 카드 형식으로 표시 */
    .courses-table-wrapper {
        display: none;
    }
    
    /* 모바일 카드 레이아웃 */
    .mobile-course-cards {
        display: block;
        margin-top: 3px;
    }
    
    .mobile-course-card {
        background-color: #252525;
        border: 1px solid #333;
        border-radius: 6px;
        padding: 5px;
        margin-bottom: 2px;
        transition: all 0.2s ease;
    }
    
    .mobile-course-card:active {
        background-color: #2a2a2a;
    }
    
    /* 모바일에서 호버 시 하이라이트 */
    .mobile-course-card:hover {
        background-color: rgba(255, 148, 148, 0.05);
        border-color: #444;
    }
    
    /* 첫 번째 줄: 별표, 번호, 이름, 다운로드 버튼 */
    .mobile-card-first-line {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 8px;
        white-space: nowrap;
    }
    
    .mobile-course-star {
        color: #FFD700;
        font-size: 0.9em;
        flex-shrink: 0;
        text-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
    }
    
    .mobile-course-number {
        color: #ff9494;
        font-weight: 600;
        font-size: 0.75em;
        flex-shrink: 0;
    }
    
    .mobile-course-name {
        color: #e0e0e0;
        font-size: 0.85em;
        font-weight: 500;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .mobile-card-downloads {
        display: flex;
        gap: 2px;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .mobile-info-badges {
        display: flex;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .mobile-info-badge {
        display: inline-flex;
        align-items: center;
        background-color: #2a2a2a;
        border: 1px solid #3a3a3a;
        border-radius: 3px;
        padding: 2px 5px;
        font-size: 0.65em;
        white-space: nowrap;
    }
    
    .mobile-info-badge.distance {
        background-color: #1a3a1a;
        border-color: #2a4a2a;
        color: #4CAF50;
    }
    
    .mobile-info-badge.elevation {
        background-color: #3a2a1a;
        border-color: #4a3a2a;
        color: #FF9800;
    }
    
    .mobile-info-badge.time {
        background-color: #1a2a3a;
        border-color: #2a3a4a;
        color: #2196F3;
    }
    
    /* 두 번째 줄: 거리/고도/시간 배지와 출발/도착 경로 */
    .mobile-card-second-line {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .mobile-card-route {
        font-size: 0.7em;
        color: #888;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .mobile-download-link {
        padding: 0px 3px;
        background-color: #333;
        color: #e0e0e0;
        text-decoration: none;
        border-radius: 3px;
        font-size: 0.7em;
        border: 1px solid #444;
        font-weight: 500;
    }
    
    .mobile-download-link.gpx {
        background-color: #ff9494;
        color:#1a1a1a;
    }
    
    .mobile-download-link.tcx {
        background-color: #ff9494;
        color:#1a1a1a;
    }
    
    .update-info {
        font-size: 0.75em;
        margin-top: 15px;
    }
    
    /* 지도 섹션 모바일 스타일 */
    .permanent-map-section {
        margin: 2px 0;
        padding: 0px;
    }
    
    .permanent-courses-map {
        height: 300px;
    }
    
    .zoom-controls .map-control-btn,
    .map-fullscreen-btn,
    .map-location-btn {
        width: 26px !important;
        height: 26px !important;
    }
    
    .zoom-controls .map-control-btn svg,
    .map-fullscreen-btn svg,
    .map-location-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* 고도 프로필 모바일 스타일 - 수정됨 */
    .elevation-profile-section {
        margin: 3px 0;
    }
    
    .elevation-profile-chart {
        padding: 0px;
        height: 120px; /* 모바일에서도 작게 */
    }
    
    /* 필터 섹션 모바일 스타일 - 더욱 슬림하게 수정 */
    .filter-section {
        padding: 6px 10px;
        margin: 3px 0;
    }
    
    .filter-controls {
        gap: 10px;
        flex-direction: column;
    }
    
    .filter-group {
        min-width: 100%;
        position: relative;
    }
    
    .filter-label {
        position: absolute;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
        color: #ff9494;
        font-size: 0.55em;
        z-index: 10;
        background-color: transparent;
        padding: 0px;
    }
    
    .slider-container {
        padding: 12px 15px 3px 15px;
    }
    
    .slider-track {
        height: 2px;
    }
    
    .slider-thumb {
        width: 42px;
        height: 16px;
    }
    
    .slider-thumb::after {
        font-size: 0.5em;
    }
    
    /* 위치 찾는 중 모바일 스타일 */
    .location-loading-content {
        padding: 15px 20px;
    }
    
    .location-loading-spinner {
        width: 20px;
        height: 20px;
    }
    
    .location-loading-text {
        font-size: 14px;
    }
    
    /* CP 팝업 모바일 스타일 */
    .cp-popup-wrapper {
        min-width: 150px;
    }
    
    .cp-popup h4 {
        font-size: 1em;
    }
    
    .cp-popup p {
        font-size: 0.85em;
    }
    
    .cp-popup .cp-distance {
        font-size: 0.95em;
    }
    
    .cp-popup .cp-image {
        margin-top: 8px;
    }
    
    .cp-popup .cp-image img {
        max-height: 150px;
    }
    
    /* Progressive Loading 모바일 스타일 */
    .map-loading {
        padding: 15px 25px;
        font-size: 0.9em;
    }
    
    .loading-spinner {
        width: 18px;
        height: 18px;
    }
    
    .loading-progress {
        font-size: 0.85em;
    }
}