:root {
  --sidebar-width: 380px;
  --primary-color: #2e7d32;
  --secondary-color: #4caf50;
  --accent-color: #ff9800;
  --text-color: #333;
  --bg-color: #f9f9f9;
  --shadow: 0 4px 12px rgba(0,0,0,0.15);
}

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text-color);
  overflow: hidden; /* Prevent body scroll, use map/sidebar scroll */
}

#app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Sidebar Common Styles */
.sidebar {
  position: absolute;
  top: 0;
  height: 100%;
  width: var(--sidebar-width);
  background-color: white;
  z-index: 2000;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

/* Left Sidebar (Details) */
.sidebar.left {
  left: 0;
  transform: translateX(-100%);
}
.sidebar.left.active {
  transform: translateX(0);
}

/* Right Sidebar (List) */
.sidebar.right {
  right: 0;
  transform: translateX(100%);
}
.sidebar.right.active {
  transform: translateX(0);
}

.sidebar-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.sidebar-content {
  overflow-y: auto;
  flex-grow: 1;
  padding: 1rem;
}

button[aria-label^="Close"] {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}

/* Toggle Button */
.map-control-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1500;
  background: white;
  border: none;
  padding: 0.8rem 1.2rem;
  border-radius: 50px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  cursor: pointer;
  font-weight: bold;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s, background-color 0.2s;
}

.map-control-btn:hover {
  transform: translateY(-2px);
  background-color: #f1f8e9;
}

/* Mountain Info Content Styles (Left Sidebar) */
.mountain-info {
  padding: 0;
  overflow-y: auto;
  flex-grow: 1;
}
.mountain-header { padding: 1.5rem; background: #e8f5e9; }
.info-section { padding: 1.5rem; border-bottom: 1px solid #eee; }
.info-header { font-size: 1.1rem; font-weight: 700; color: var(--primary-color); margin-bottom: 1rem; }

/* Mountain List Styles (Right Sidebar) */
.site-intro-small {
  background: #e8f5e9;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-align: center;
  color: #2e7d32;
}

.mountain-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mountain-card-mini {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mountain-card-mini:hover {
  border-color: var(--secondary-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  background-color: #fafafa;
}

.mountain-card-mini h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #333;
}

.mountain-card-mini p {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
}

.sidebar-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 0.8rem;
  color: #888;
}

.sidebar-footer a {
  color: #666;
  text-decoration: none;
}

/* Reused Detail Styles */
.course-card { background: white; border: 1px solid #e0e0e0; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.course-title { font-weight: 700; color: #2c3e50; display: block; margin-bottom: 0.5rem; }
.course-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 0.8rem; font-size: 0.85rem; background: #f5f5f5; padding: 0.5rem; border-radius: 4px; text-align: center; }
.stat-item span { display: block; font-weight: 600; color: #333; }
.btn-group { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.btn { padding: 0.5rem 1rem; border-radius: 4px; border: none; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: white; text-decoration: none; display: inline-flex; align-items: center; }
.btn-weather { background-color: #03a9f4; }
.btn-control { background-color: #ef5350; }
.btn-gpx { background-color: var(--primary-color); width: 100%; justify-content: center; margin-top: 0.5rem; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 0.8rem; font-size: 0.9rem; margin-bottom: 0.8rem; }
.detail-item { display: flex; align-items: flex-start; gap: 0.5rem; }
.detail-icon { width: 20px; text-align: center; }
.altitude-bar { height: 6px; background: linear-gradient(to right, #81c784, #2e7d32, #1b5e20); border-radius: 3px; margin: 0.5rem 0; }
.altitude-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: #888; }

/* Responsive */
@media (max-width: 600px) {
  .sidebar {
    width: 100%;
    height: 60%; /* Bottom sheet style */
    top: auto;
    bottom: 0;
    transform: translateY(100%);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
  }
  
  .sidebar.left.active { transform: translateY(0); }
  .sidebar.right.active { transform: translateY(0); }
  
  .map-control-btn {
    top: auto;
    bottom: 2rem;
    right: 50%;
    transform: translateX(50%);
    width: auto;
  }
}