/* ============================================
   멜번 러닝맵 - 메인 스타일시트
   밝은 하얀색 베이스 + 주황색 포인트
   ============================================ */

/* CSS 변수 정의 */
:root {
  /* 배경 색상 (밝은 하얀색 계열) */
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --bg-cream: #fff7ed;
  
  /* 텍스트 색상 */
  --text-dark: #2c3e50;
  --text-gray: #6c757d;
  --text-light: #adb5bd;
  
  /* 테두리 색상 */
  --border-light: #e9ecef;
  --border-gray: #dee2e6;
  
  /* 주황색 포인트 */
  --primary-orange: #ff6b35;
  --secondary-orange: #ff8c42;
  --light-orange: #ffa35c;
  --pale-orange: #fed7aa;
  
  /* 그라데이션 */
  --gradient-orange: linear-gradient(135deg, #ff6b35, #ff8c42);
  
  /* 호버 */
  --hover-orange: #ff8c42;
  
  /* 그림자 */
  --shadow-orange: 0 4px 12px rgba(255, 107, 53, 0.2);
  --shadow-orange-sm: 0 2px 8px rgba(255, 107, 53, 0.15);
  --shadow-orange-md: 0 4px 12px rgba(255, 107, 53, 0.2);
  --shadow-orange-lg: 0 8px 20px rgba(255, 107, 53, 0.25);
  
  /* 난이도 색상 */
  --easy-green: #22c55e;
  --medium-orange: #ff6b35;
  --hard-red: #ef4444;
  
  /* 지도 색상 */
  --route-line: #ff6b35;
  --route-line-width: 4px;
  --marker-start: #22c55e;
  --marker-end: #ef4444;
  
  /* 거리별 마커 색상 */
  --marker-3-4km: #4ade80;
  --marker-4-5km: #22c55e;
  --marker-5-10km: #3b82f6;
  --marker-10-15km: #a855f7;
  --marker-15-21km: #f97316;
  --marker-25-30km: #ef4444;
  
  /* 타이포그래피 */
  --font-primary: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  
  /* 폰트 크기 */
  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px */
  --text-lg: 1.125rem;  /* 18px */
  --text-xl: 1.25rem;   /* 20px */
  --text-2xl: 1.5rem;   /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem;  /* 36px */
  --text-5xl: 3rem;     /* 48px */
  
  /* 폰트 굵기 */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  
  /* 간격 */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  
  /* 컨테이너 */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;  /* 완전한 원 */
  
  /* 그림자 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);
  
  /* 전환 효과 */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;
  --transition-all: all 300ms ease;
  --transition-colors: color 300ms ease, background-color 300ms ease, border-color 300ms ease;
  --transition-transform: transform 300ms ease;
}

/* 글로벌 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

/* 베이스 스타일 */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-white);
  min-height: 100vh;
}

/* 링크 */
a {
  color: var(--primary-orange);
  text-decoration: none;
  transition: var(--transition-colors);
}

a:hover {
  color: var(--hover-orange);
  text-decoration: none;
}

/* 이미지 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 버튼 리셋 */
button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* 입력 필드 */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* 리스트 */
ul,
ol {
  list-style: none;
}

/* 제목 */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-bold);
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
}

/* 단락 */
p {
  margin-bottom: var(--space-4);
}

/* 컨테이너 */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--space-4);
}

/* 유틸리티 클래스 */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* 텍스트 정렬 */
.text-left {
  text-align: left;
}

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

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

/* 텍스트 색상 */
.text-primary {
  color: var(--primary-orange);
}

.text-secondary {
  color: var(--text-gray);
}

.text-muted {
  color: var(--text-light);
}

/* 배경 색상 */
.bg-white {
  background-color: var(--bg-white);
}

.bg-light {
  background-color: var(--bg-light);
}

.bg-cream {
  background-color: var(--bg-cream);
}

.bg-primary {
  background-color: var(--primary-orange);
}

/* Flexbox 유틸리티 */
.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.justify-content-start {
  justify-content: flex-start;
}

.justify-content-center {
  justify-content: center;
}

.justify-content-end {
  justify-content: flex-end;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-start {
  align-items: flex-start;
}

.align-items-center {
  align-items: center;
}

.align-items-end {
  align-items: flex-end;
}

.gap-1 {
  gap: var(--space-1);
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

.gap-6 {
  gap: var(--space-6);
}

/* 간격 유틸리티 */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.pt-1 { padding-top: var(--space-1); }
.pt-2 { padding-top: var(--space-2); }
.pt-3 { padding-top: var(--space-3); }
.pt-4 { padding-top: var(--space-4); }
.pt-6 { padding-top: var(--space-6); }
.pt-8 { padding-top: var(--space-8); }

.pb-1 { padding-bottom: var(--space-1); }
.pb-2 { padding-bottom: var(--space-2); }
.pb-3 { padding-bottom: var(--space-3); }
.pb-4 { padding-bottom: var(--space-4); }
.pb-6 { padding-bottom: var(--space-6); }
.pb-8 { padding-bottom: var(--space-8); }

/* 반응형 유틸리티 */
@media (max-width: 767px) {
  :root {
    --text-4xl: 2rem;    /* 32px */
    --text-3xl: 1.5rem;  /* 24px */
  }
  
  .container {
    padding: 0 var(--space-3);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .container {
    max-width: var(--container-md);
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: var(--container-lg);
  }
}


/* ============================================
   히어로 섹션 슬라이더
   ============================================ */

/* 히어로 슬라이더 컨테이너 */
.hero-slider {
  position: relative;
  width: 100%;
  min-height: 70vh;
  max-height: 800px;
  overflow: hidden;
  background: linear-gradient(135deg, #ff6b35, #ff8c42);
}

/* 슬라이드 아이템 */
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 2s ease-in-out;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  z-index: 1;
}

/* 슬라이드 이미지 - 최적화 */
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  filter: brightness(0.85);
  transform: scale(1.05);
}

/* 오버레이 - 그라데이션 개선 */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* 히어로 콘텐츠 - 레이아웃 개선 */
.hero-content {
  position: relative;
  z-index: 3;
  min-height: 70vh;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  color: white;
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: white;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.8s ease-out;
  line-height: 1.2;
  max-width: 900px;
}

.hero-content p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 2.5rem;
  max-width: 700px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.8s ease-out 0.2s both;
  line-height: 1.6;
}

.hero-content .btn {
  animation: fadeInUp 0.8s ease-out 0.4s both;
  font-size: 1rem;
  padding: 0.875rem 2rem;
}

/* 슬라이더 인디케이터 */
.hero-indicators {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  z-index: 5;
}

.hero-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: var(--transition-all);
}

.hero-indicator.active {
  background: var(--primary-orange);
  border-color: white;
  transform: scale(1.2);
}

.hero-indicator:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  50% {
    transform: scale(1.3);
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.6);
  }
}

/* 반응형 - 태블릿 */
@media (max-width: 1023px) {
  .hero-slider {
    min-height: 60vh;
    max-height: 700px;
  }
  
  .hero-content {
    min-height: 60vh;
    max-height: 700px;
    padding: 4rem 2rem 3rem;
  }
  
  .hero-content h1 {
    margin-bottom: 1.25rem;
  }
  
  .hero-content p {
    margin-bottom: 2rem;
  }
}

/* 반응형 - 모바일 */
@media (max-width: 767px) {
  .hero-slider {
    min-height: 85vh;
    max-height: none;
  }
  
  .hero-content {
    min-height: 85vh;
    max-height: none;
    padding: 5rem 1.5rem 3rem;
    justify-content: flex-start;
    padding-top: 8rem;
  }
  
  .hero-content h1 {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
    margin-bottom: 1rem;
  }
  
  .hero-content p {
    font-size: clamp(0.875rem, 4vw, 1.125rem);
    margin-bottom: 2rem;
  }
  
  .hero-indicators {
    bottom: 2rem;
  }
  
  .hero-indicator {
    width: 10px;
    height: 10px;
  }
  
  .hero-content .btn {
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
  }
}

/* 가로 모드 최적화 */
@media (orientation: landscape) and (max-height: 600px) {
  .hero-slider {
    min-height: 100vh;
  }
  
  .hero-content {
    min-height: 100vh;
    padding: 3rem 2rem 2rem;
  }
  
  .hero-content h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.75rem;
  }
  
  .hero-content p {
    font-size: clamp(0.875rem, 2vw, 1rem);
    margin-bottom: 1.5rem;
  }
  
  .hero-indicators {
    bottom: 1rem;
  }
}


/* ============================================
   컴포넌트 스타일
   ============================================ */

/* 버튼 스타일 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
  transition: var(--transition-all);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary 버튼 (주황색) */
.btn-primary {
  background: var(--gradient-orange);
  color: white;
  box-shadow: var(--shadow-orange-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--hover-orange);
  transform: translateY(-2px);
  box-shadow: var(--shadow-orange-md);
  color: white;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary 버튼 (하얀색 배경 + 주황색 테두리) */
.btn-secondary {
  background: var(--bg-white);
  color: var(--primary-orange);
  border: 2px solid var(--primary-orange);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-orange);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-orange-sm);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
}

/* Outline 버튼 */
.btn-outline {
  background: transparent;
  color: var(--text-dark);
  border: 1px solid var(--border-gray);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-light);
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

/* 버튼 크기 */
.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* 카드 스타일 */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-all);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--pale-orange);
}

.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-dark);
  margin-bottom: var(--space-2);
}

.card-body {
  margin-bottom: var(--space-4);
}

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 배지 스타일 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  white-space: nowrap;
}

.badge-easy {
  background: var(--easy-green);
  color: white;
}

.badge-medium {
  background: var(--medium-orange);
  color: white;
}

.badge-hard {
  background: var(--hard-red);
  color: white;
}

.badge-primary {
  background: var(--primary-orange);
  color: white;
}

.badge-secondary {
  background: var(--bg-light);
  color: var(--text-gray);
  border: 1px solid var(--border-gray);
}

/* 입력 필드 스타일 */
.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-dark);
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: var(--transition-all);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-control::placeholder {
  color: var(--text-light);
}

/* 검색 입력 */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-icon {
  position: absolute;
  left: var(--space-4);
  color: var(--text-light);
  font-size: var(--text-lg);
  pointer-events: none;
}

.search-input {
  padding-left: calc(var(--space-4) + var(--space-8));
}

.search-input-wrapper:focus-within .search-input-icon {
  color: var(--primary-orange);
}

/* Select 드롭다운 */
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--text-dark);
  background: var(--bg-white);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-all);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236c757d' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  background-size: 16px;
  padding-right: calc(var(--space-4) + var(--space-6));
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* 체크박스 */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border-gray);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-all);
}

.form-check-input:checked {
  background-color: var(--primary-orange);
  border-color: var(--primary-orange);
}

.form-check-label {
  cursor: pointer;
  user-select: none;
}

/* 알림 메시지 */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* 로딩 스피너 */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.spinner-lg {
  width: 3rem;
  height: 3rem;
  border-width: 4px;
}

/* 툴팁 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-dark);
  color: white;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  white-space: nowrap;
  z-index: 1000;
  transition: var(--transition-base);
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* 모달 오버레이 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  transform: scale(0.9);
  transition: var(--transition-base);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--text-3xl);
  color: var(--text-gray);
  cursor: pointer;
  transition: var(--transition-colors);
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--primary-orange);
}

.modal-body {
  margin-bottom: var(--space-6);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
}


/* ============================================
   헤더 및 네비게이션
   ============================================ */

/* Sticky 헤더 */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-all);
}

.sticky-header.scrolled {
  box-shadow: var(--shadow-md);
}

/* 네비게이션 바 */
.navbar-running {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) 0;
  position: relative;
}

/* 브랜드 로고 */
.navbar-brand-running {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  transition: var(--transition-transform);
}

.navbar-brand-running:hover {
  transform: translateY(-2px);
}

.logo-img {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-all);
}

.navbar-brand-running:hover .logo-img {
  box-shadow: var(--shadow-md);
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.875rem;
  color: var(--primary-orange);
  margin: 0;
  font-weight: 600;
}

/* 네비게이션 메뉴 */
.navbar-menu-running {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-link-running {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition-all);
  white-space: nowrap;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-link-running:hover {
  background: var(--pale-orange);
  color: var(--primary-orange);
  transform: translateY(-2px);
}

.nav-link-running.active {
  background: var(--primary-orange);
  color: var(--bg-white);
}

.nav-link-running i {
  font-size: 1.1rem;
}

.nav-link-home {
  background: var(--bg-light);
}

.nav-link-home:hover {
  background: var(--secondary-orange);
  color: var(--bg-white);
}

/* 모바일 토글 버튼 */
.navbar-toggler-running {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  z-index: 1001;
}

.toggler-icon {
  width: 25px;
  height: 3px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: var(--transition-all);
}

.navbar-toggler-running.active .toggler-icon:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggler-running.active .toggler-icon:nth-child(2) {
  opacity: 0;
}

.navbar-toggler-running.active .toggler-icon:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* 모달 오버레이 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--text-gray);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-all);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--primary-orange);
  transform: rotate(90deg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
}

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ============================================
   코스 카드 컴포넌트
   ============================================ */

/* 코스 그리드 */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-6);
}

.course-grid.list-view {
  grid-template-columns: 1fr;
}

/* 코스 카드 */
.course-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition-all);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--pale-orange);
}

/* 카드 이미지 */
.course-card-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #ff6b35, #ff8c42);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 이미지 로드 실패 시 대체 콘텐츠 */
.course-card-image::before {
  content: '🏃';
  font-size: 64px;
  position: absolute;
  opacity: 0.3;
  z-index: 0;
}

.course-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-transform);
  position: relative;
  z-index: 1;
  background: transparent;
}

.course-card-image img[src=""],
.course-card-image img:not([src]),
.course-card-image img[src="null"] {
  display: none;
}

.course-card:hover .course-card-image img {
  transform: scale(1.05);
}

/* 난이도 배지 */
.course-difficulty-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 100;
  white-space: nowrap;
  pointer-events: none;
}

.course-difficulty-badge .badge {
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 70px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* 난이도 배지 내 이모티콘 제거 */
.course-difficulty-badge .badge::before {
  content: none !important;
}

/* 카드 오버레이 (호버 시 지도 버튼) */
.course-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-all);
}

.course-card:hover .course-card-overlay {
  opacity: 1;
}

.btn-map-quick {
  background: var(--bg-white);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-all);
  box-shadow: var(--shadow-md);
}

.btn-map-quick:hover {
  background: var(--primary-orange);
  transform: scale(1.1);
}

.btn-map-quick i {
  font-size: 1.5rem;
  color: var(--primary-orange);
  transition: var(--transition-all);
}

.btn-map-quick:hover i {
  color: var(--bg-white);
}

/* 카드 콘텐츠 */
.course-card-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.course-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.3;
}

.course-card-subtitle {
  font-size: 0.875rem;
  color: var(--text-gray);
  margin: 0;
  font-weight: 500;
}

/* 카드 통계 */
.course-card-stats {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.course-card-stats .stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-dark);
  font-weight: 600;
}

.course-card-stats .stat-item i {
  font-size: 1rem;
}

.text-primary {
  color: var(--primary-orange) !important;
}

.text-warning {
  color: #ffc107 !important;
}

.text-danger {
  color: #dc3545 !important;
}

/* 카드 특징 */
.course-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--pale-orange);
  color: var(--primary-orange);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.feature-tag i {
  font-size: 0.875rem;
}

/* 카드 위치 */
.course-card-location {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-gray);
  font-size: 0.875rem;
  margin-top: auto;
}

.course-card-location i {
  color: var(--primary-orange);
  font-size: 1rem;
}

/* 빈 상태 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-gray);
}

.empty-state i {
  font-size: 4rem;
  color: var(--text-light);
  margin-bottom: var(--space-4);
  display: block;
}

.empty-state p {
  font-size: 1.125rem;
  margin: 0;
}

/* 리스트 뷰 스타일 */
.course-grid.list-view .course-card {
  flex-direction: row;
  max-height: 200px;
}

.course-grid.list-view .course-card-image {
  width: 300px;
  height: 100%;
  flex-shrink: 0;
}

.course-grid.list-view .course-card-content {
  flex: 1;
  padding: var(--space-4);
}

.course-grid.list-view .course-card-stats {
  flex-direction: row;
  border-top: none;
  border-bottom: none;
  padding: 0;
}

.course-grid.list-view .course-card-features {
  margin-top: auto;
}


/* ============================================
   푸터
   ============================================ */

.footer-running {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: var(--bg-white);
  padding: 4rem 0 2rem;
  margin-top: 6rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bg-white);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-title i {
  color: var(--primary-orange);
  font-size: 1.25rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links li a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: var(--transition-all);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer-links li a:hover {
  color: var(--primary-orange);
  transform: translateX(4px);
}

.footer-links li a i {
  font-size: 1rem;
  width: 20px;
}

.footer-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-6);
  text-align: center;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9375rem;
  margin: 0 0 var(--space-3) 0;
  font-weight: 600;
}

.footer-note {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
  line-height: 1.6;
  margin: 0;
}


/* ============================================
   이미지 최적화
   ============================================ */

/* Lazy Loading 플레이스홀더 */
img[loading="lazy"] {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

/* 이미지 로딩 애니메이션 */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.image-loading {
  animation: shimmer 2s infinite;
  background: linear-gradient(
    to right,
    #f5f5f5 0%,
    #e0e0e0 50%,
    #f5f5f5 100%
  );
  background-size: 1000px 100%;
}

/* 이미지 최적화 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* WebP 지원 */
.webp .course-card-image img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* 이미지 페이드인 효과 */
img.loaded {
  animation: fadeIn 0.3s ease-in;
}

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


/* ============================================
   Mapbox 저작권 및 기본 컨트롤 숨김
   ============================================ */
.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-logo,
.mapboxgl-compact {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right,
.mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-top-left {
  display: none !important;
}

/* Mapbox Navigation Control 완전히 숨김 */
.mapboxgl-ctrl-group {
  display: none !important;
}

/* ============================================
   지도 마커 스타일
   ============================================ */
.custom-marker {
  pointer-events: auto !important;
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
}

.custom-marker:hover {
  transform: scale(1.2);
  z-index: 1000 !important;
}

.start-marker,
.end-marker {
  pointer-events: auto !important;
  cursor: pointer;
  user-select: none;
}

/* Mapbox 마커 컨테이너 */
.mapboxgl-marker {
  pointer-events: auto !important;
}

.mapboxgl-popup {
  pointer-events: auto !important;
}

.mapboxgl-popup-content {
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mapboxgl-popup-close-button {
  font-size: 20px;
  padding: 8px;
  color: #6c757d;
}

.mapboxgl-popup-close-button:hover {
  background-color: #f8f9fa;
  color: #2c3e50;
}

/* 시작점/끝점 팝업 모바일 최적화 */
@media (max-width: 767px) {
  .start-point-popup .mapboxgl-popup-content,
  .end-point-popup .mapboxgl-popup-content {
    max-width: 85vw !important;
    font-size: 0.85rem;
  }
  
  .start-point-popup .mapboxgl-popup-tip {
    border-top-color: white;
  }
  
  .end-point-popup .mapboxgl-popup-tip {
    border-top-color: #fef2f2;
  }
}

/* 끝점 팝업 스타일 */
.end-point-popup .mapboxgl-popup-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
