:root {
  --primary: #2ac1bc; /* 배달의민족 시그니처 민트 컬러 */
  --primary-glow: rgba(42, 193, 188, 0.3);
  --secondary: #ff5252;
  --secondary-glow: rgba(255, 82, 82, 0.3);
  --accent: #2ac1bc;
  --accent-glow: rgba(42, 193, 188, 0.2);
  --bg-dark: #f4f6f8; /* 깔끔하고 신선한 배민 스타일 아이보리/라이트 배경 */
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-glass: #e2e8f0;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.25s ease-in-out;
  --shadow-neon: 0 8px 24px 0 rgba(42, 193, 188, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #f8fafc;
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 80px; /* Space for Baemin Bottom Nav */
}

/* 1. Baemin Top Header & Location Bar */
.baemin-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #2ac1bc; /* 배민 시그니처 민트 상단바 */
  padding: 0.8rem 1.2rem 1rem 1.2rem;
  box-shadow: 0 4px 16px rgba(42, 193, 188, 0.25);
}

.baemin-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  color: white;
}

.baemin-location-selector {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.baemin-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.baemin-icon-btn {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  padding: 0.45rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
}

.sos-btn {
  text-decoration: none;
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.lang-select-opt:hover {
  background: rgba(42, 193, 188, 0.25) !important;
  border-color: #2ac1bc !important;
}

/* Baemin Signature Huge White Search Input */
.baemin-search-container {
  position: relative;
  width: 100%;
}

.baemin-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #2ac1bc;
  font-size: 1.1rem;
}

.baemin-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  outline: none;
}

.baemin-search-input::placeholder {
  color: #94a3b8;
  font-weight: 600;
}

/* 2. Main Baemin App Container */
.baemin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 1rem;
}

/* Baemin Top Big 4 Square Category Cards Grid */
.baemin-big-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .baemin-big-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.baemin-cat-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.baemin-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.cat-mint { background: linear-gradient(135deg, #e6fcf5, #c0f6e4); border-color: #2ac1bc; }
.cat-pink { background: linear-gradient(135deg, #fff0f6, #ffdeeb); border-color: #ff85c0; }
.cat-yellow { background: linear-gradient(135deg, #fff9db, #fff3bf); border-color: #ffd43b; }
.cat-blue { background: linear-gradient(135deg, #e7f5ff, #d0ebff); border-color: #74c0fc; }

.cat-card-text h3 {
  font-size: 1.1rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.cat-card-text p {
  font-size: 0.78rem;
  color: #475569;
  font-weight: 600;
}

.cat-card-icon {
  font-size: 2.2rem;
}

/* TourAPI Live Indicator Banner */
.baemin-live-banner {
  background: #ffffff;
  border: 1.5px solid #2ac1bc;
  border-radius: 14px;
  padding: 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(42, 193, 188, 0.12);
}

.live-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
}

.live-pulse {
  width: 10px;
  height: 10px;
  background: #2ac1bc;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(42, 193, 188, 0.7);
  animation: pulse-green 1.6s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(42, 193, 188, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(42, 193, 188, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(42, 193, 188, 0); }
}

/* Category Filter Pills (Horizontal Baemin Filter Bar) */
.baemin-filter-pills-section {
  background: #ffffff;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.8rem;
}

.baemin-pills-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.4rem 0.2rem 0.6rem 0.2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 193, 188, 0.4) transparent;
}

.baemin-pills-row::-webkit-scrollbar {
  height: 4px;
}

.baemin-pills-row::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.baemin-pills-row::-webkit-scrollbar-thumb {
  background: rgba(42, 193, 188, 0.4);
  border-radius: 4px;
}

.baemin-pills-row::-webkit-scrollbar-thumb:hover {
  background: #2ac1bc;
}

.filter-chip {
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.45rem 0.95rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: #2ac1bc !important;
  color: white !important;
  border-color: #2ac1bc !important;
  box-shadow: 0 3px 10px rgba(42, 193, 188, 0.3);
}

.baemin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.baemin-section-header h2 {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
}

/* Baemin Signature Fixed Bottom Navigation Bar */
.baemin-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.baemin-bottom-nav .nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
}

.baemin-bottom-nav .nav-item i {
  font-size: 1.25rem;
}

.baemin-bottom-nav .nav-item.active {
  color: #2ac1bc;
}

/* Hero Section */
.hero-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9)), url('https://images.unsplash.com/photo-1540555700478-4be289fbecef?auto=format&fit=crop&w=1400&q=80') center/cover;
  padding: 3.5rem 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-glass);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.6) 60%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-tag {
  display: inline-block;
  background: rgba(139, 92, 246, 0.25);
  border: 1px solid var(--primary);
  color: #c084fc;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.8rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ec4899;
}

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

/* Filters & Search */
.filter-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 30px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-tags {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-chip:hover, .filter-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Course Grid */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Baemin Mint App-Style Course Cards */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.6rem;
  margin-bottom: 3.5rem;
}

.course-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  will-change: transform;
}

.course-card:hover {
  transform: translateY(-8px);
  border-color: #2ac1bc;
  box-shadow: 0 12px 30px rgba(42, 193, 188, 0.2);
}

.card-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.course-card:hover .card-img-wrapper img {
  transform: scale(1.08);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  color: #0f172a;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card-stamps-count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: #2ac1bc;
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(42, 193, 188, 0.35);
}

.card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-artist {
  color: #0284c7;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-desc {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.2rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.9rem;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.card-btn {
  background: #2ac1bc;
  color: white;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(42, 193, 188, 0.3);
}

.card-btn:hover {
  background: #10b981;
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Detail & Map Screen */
.course-detail-view {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

.back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  cursor: pointer;
  margin-bottom: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: var(--transition);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.detail-header-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  border: 1px solid var(--border-glass);
  margin-bottom: 1.5rem;
}

.detail-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.detail-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.detail-desc {
  line-height: 1.6;
  color: #475569;
}

.map-layout-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .map-layout-grid {
    grid-template-columns: 1fr;
  }
}

.map-container {
  height: 480px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

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

/* Spot Timeline List */
.spots-list-sidebar {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  border: 1px solid var(--border-glass);
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.spot-item-card {
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: var(--transition);
  position: relative;
}

.spot-item-card.active {
  border-color: var(--primary);
  background: rgba(42, 193, 188, 0.08);
}

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

.spot-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.spot-stamp-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.spot-stamp-status.unlocked {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.spot-mission-text {
  font-size: 0.8rem;
  color: #059669;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.checkin-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.checkin-btn:hover {
  opacity: 0.9;
}

.checkin-btn.completed {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
  cursor: default;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: #1e293b;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.8rem;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.6);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

/* Digital Stamp Animation Popup */
.stamp-popup-content {
  text-align: center;
}

.stamp-graphic {
  width: 130px;
  height: 130px;
  margin: 1.5rem auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, rgba(139, 92, 246, 0.4) 100%);
  border: 4px dashed #ec4899;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  animation: stampPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes stampPop {
  0% { transform: scale(3) rotate(-30deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Photo Card Frame Generator Modal */
.photocard-preview {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-md);
  background: #090d16;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  margin: 1rem 0;
  border: 2px solid var(--primary);
  background-size: cover;
  background-position: center;
}

.photocard-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
}

.photocard-header {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.photocard-footer {
  position: relative;
  z-index: 2;
  text-align: left;
}

/* Digital Passport Styling */
.passport-container {
  background: linear-gradient(145deg, #1e1b4b, #311b92);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 2px solid rgba(192, 132, 252, 0.3);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.passport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.passport-stamp-item {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 2px dashed rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  text-align: center;
  padding: 0.4rem;
  color: var(--text-muted);
}

.passport-stamp-item.collected {
  background: radial-gradient(circle, rgba(236,72,153,0.3) 0%, rgba(139,92,246,0.5) 100%);
  border: 2px solid #ec4899;
  color: white;
  box-shadow: 0 0 12px var(--primary-glow);
}


/* ====================================================
   Interactive Passport Flip-Book Modal Styles
   ==================================================== */
.passport-book-modal-card {
  background: #0f172a;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
  animation: zoomIn 0.3s ease;
  overflow: hidden;
}

.passport-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.passport-book-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.passport-page-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.passport-nav-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.passport-nav-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: var(--primary);
}

.passport-page-badge {
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid #fbbf24;
  color: #fbbf24;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
}

.passport-book-stage {
  position: relative;
  min-height: 480px;
  perspective: 1200px;
}

.passport-page-sheet {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: rotateY(-20deg) scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.passport-page-sheet.active {
  opacity: 1;
  pointer-events: auto;
  transform: rotateY(0deg) scale(1);
}

.passport-cover-design {
  background: linear-gradient(145deg, #1e1b4b, #0f172a, #311b92);
  border-radius: 16px;
  border: 3px solid #fbbf24;
  padding: 2.5rem 1.5rem;
  text-align: center;
  height: 100%;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5);
  position: relative;
}

.passport-gold-emblem {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: #fbbf24;
  margin-bottom: 1.5rem;
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.passport-cover-country {
  color: #fef08a;
  font-size: 1.2rem;
  letter-spacing: 3px;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.passport-cover-title {
  color: #fbbf24;
  font-size: 1.6rem;
  letter-spacing: 2px;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.passport-cover-sub {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.passport-gold-line {
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fbbf24, transparent);
  margin-bottom: 2rem;
}

.passport-open-cover-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1e1b4b;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 25px;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(251, 191, 36, 0.4);
  transition: var(--transition);
}

.passport-open-cover-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(251, 191, 36, 0.6);
}

.passport-inner-paper {
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  padding: 1.5rem;
  height: 100%;
  min-height: 480px;
  color: #0f172a;
  position: relative;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.08);
  overflow-y: auto;
}

.passport-watermark-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 3rem;
  font-weight: 900;
  color: rgba(148, 163, 184, 0.12);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 4px;
}

.passport-page-title {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.passport-id-card-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.passport-id-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
  color: #475569;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 0.4rem;
}

.passport-id-main {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.passport-id-avatar {
  width: 90px;
  height: 110px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 900;
  border: 2px solid #cbd5e1;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.passport-id-fields {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.p-field .p-label {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 700;
}

.passport-id-bottom {
  margin-top: 1rem;
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.8rem;
}

.passport-signature {
  font-size: 0.75rem;
  color: #475569;
  margin-bottom: 0.6rem;
}

.passport-mrz {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #1e293b;
  background: #e2e8f0;
  padding: 0.6rem;
  border-radius: 6px;
  line-height: 1.3;
}

.passport-stamps-grid-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}

.passport-stamp-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed #cbd5e1;
  background: rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  font-size: 0.7rem;
  text-align: center;
  color: #94a3b8;
  transition: var(--transition);
  position: relative;
}

.passport-stamp-cell.collected {
  background: radial-gradient(circle, rgba(236,72,153,0.15) 0%, rgba(139,92,246,0.25) 100%);
  border: 2.5px dashed #ec4899;
  color: #be185d;
  box-shadow: 0 4px 12px rgba(236,72,153,0.2);
  transform: rotate(-4deg);
}

.passport-badges-grid-view {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.5rem;
}


/* Mobile Responsive Custom Google Login Button */
.custom-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 24px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}

.custom-google-btn:hover, .custom-google-btn:active {
  background: #f8f9fa;
  border-color: #d2e3fc;
  box-shadow: 0 4px 10px rgba(66, 133, 244, 0.25);
  transform: translateY(-1px);
}

.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .modal-card, .passport-book-modal-card {
    padding: 1.2rem 1rem !important;
    width: 94vw !important;
    max-height: 88vh !important;
    border-radius: 16px !important;
  }
  
  #login-nickname, #login-country {
    padding: 0.65rem 0.8rem !important;
    font-size: 0.9rem !important;
  }
  
  .checkin-btn {
    padding: 0.75rem !important;
    font-size: 0.95rem !important;
  }
}


/* ==========================================
   📱 Mobile UI/UX Optimization (500px & Below)
   ========================================== */
@media (max-width: 600px) {
  /* Prevent horizontal scroll overflow */
  body, html {
    overflow-x: hidden;
    width: 100%;
  }

  /* Header adjustments for mobile */
  .baemin-header {
    padding: 0.8rem 1rem;
  }
  .location-name {
    font-size: 0.85rem;
  }
  .baemin-icon-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  /* Live Map Split Container on Mobile: Stack Vertically */
  .live-map-grid-container {
    grid-template-columns: 1fr !important;
  }
  #interactive-live-feed-map {
    height: 320px !important;
  }

  /* Passport Stage Responsiveness */
  .passport-book-stage {
    padding: 1rem 0.5rem !important;
  }
  .passport-id-card-layout {
    padding: 1rem !important;
  }
  .passport-id-main {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  /* Bottom Navigation Padding Safe Zone */
  .baemin-main {
    padding-bottom: 90px !important;
  }
  .baemin-bottom-nav {
    height: 64px;
    padding: 0 0.5rem;
  }
  .baemin-bottom-nav .nav-item {
    font-size: 0.72rem;
  }
  .baemin-bottom-nav .nav-item i {
    font-size: 1.1rem;
  }

  /* Course Card Grid Responsive Spacing */
  .course-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  #page-course-rank-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================
   📱 Ultimate Mobile UX/UI Enhancements (480px & Under)
   ========================================== */
@media (max-width: 500px) {
  /* 1. Header Layout on Small Screens */
  .baemin-top-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .baemin-header-right {
    gap: 0.35rem;
  }
  .baemin-icon-btn span {
    font-size: 0.7rem !important;
  }
  .sos-btn {
    padding: 0.35rem 0.6rem !important;
  }

  /* 2. Big Category Cards & Filters horizontally scrollable */
  .baemin-big-category-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr)) !important;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .baemin-pills-row {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  /* 3. Modal Responsive Width & Padding */
  .modal-card, .passport-book-modal-card {
    width: 94% !important;
    max-width: 94% !important;
    padding: 1.2rem !important;
    margin: 1rem auto !important;
  }

  /* 4. Leaderboard Banner Responsiveness */
  #page-top-1-course-card {
    padding: 1.2rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  #page-top-1-btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* 5. Touch Friendly Tap Target Size */
  button, input, select {
    min-height: 42px;
  }
}


/* ==========================================
   🌙 Dark Mode Styling Implementation
   ========================================== */
body.dark-mode {
  background-color: #090d16 !important;
  color: #f1f5f9 !important;
}
body.dark-mode .baemin-header {
  background: #0f172a !important;
  border-bottom-color: #1e293b !important;
}
body.dark-mode .baemin-main {
  background: #090d16 !important;
}
body.dark-mode .course-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.dark-mode .card-title {
  color: #f8fafc !important;
}
body.dark-mode .card-desc {
  color: #cbd5e1 !important;
}
body.dark-mode .baemin-cat-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.dark-mode .baemin-cat-card h3 {
  color: #f8fafc !important;
}
body.dark-mode .baemin-bottom-nav {
  background: #0f172a !important;
  border-top-color: #1e293b !important;
}


/* ==========================================
   🌙 Ultra Dark Mode Comprehensive Styles
   ========================================== */
body.dark-mode {
  background-color: #0b0f19 !important;
  color: #f1f5f9 !important;
}
body.dark-mode .baemin-header {
  background: #111827 !important;
  border-bottom-color: #1f2937 !important;
}
body.dark-mode .baemin-main {
  background: #0b0f19 !important;
}
body.dark-mode .course-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.dark-mode .course-card-body {
  background: #1e293b !important;
}
body.dark-mode .card-title {
  color: #f8fafc !important;
}
body.dark-mode .card-desc {
  color: #cbd5e1 !important;
}
body.dark-mode .baemin-cat-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.dark-mode .baemin-cat-card h3 {
  color: #f8fafc !important;
}
body.dark-mode .baemin-bottom-nav {
  background: #111827 !important;
  border-top-color: #1f2937 !important;
}
body.dark-mode .detail-header-card {
  background: linear-gradient(135deg, #090d16, #111827) !important;
  border-color: #2ac1bc !important;
}
body.dark-mode div[style*="background: #f8fafc"] {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.dark-mode strong[style*="color: #0f172a"] {
  color: #f8fafc !important;
}
