/* 에이온투어 - Golf Booking Service */
:root {
  --green-dark: #1B5E20;
  --green: #2E7D32;
  --green-mid: #388E3C;
  --green-light: #4CAF50;
  --green-pale: #E8F5E9;
  --blue: #1976D2;
  --blue-pale: #E3F2FD;
  --orange: #E65100;
  --orange-pale: #FFF3E0;
  --red: #C62828;
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --border: #e0e0e0;
  --bg: #f5f5f5;
  --white: #fff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --nav-h: 64px;
  --header-h: 56px;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: var(--nav-h);
}

/* ── App Shell ── */
#app { min-height: 100vh; }

.page { display: none; flex-direction: column; min-height: calc(100vh - var(--nav-h)); }
.page.active { display: flex; }

/* ── Header ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-dark);
  color: #fff;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.app-header .logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.app-header .logo span { color: #A5D6A7; }
.app-header .header-subtitle {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 4px;
}
.header-actions { margin-left: auto; display: flex; gap: 8px; }
.header-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.header-btn:hover { background: rgba(255,255,255,0.15); }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item.active { color: var(--green-dark); }
.nav-item .nav-icon { font-size: 1.4rem; line-height: 1; }
.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  display: none;
}
.nav-badge.visible { display: flex; }

/* ── Page Content ── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

/* ── Cards & Lists ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 4px;
}
.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Time Card ── */
.time-card {
  background: var(--white);
  margin: 0 12px 8px;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.time-card:active { transform: scale(0.98); box-shadow: none; }
.time-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.time-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-join { background: var(--blue-pale); color: var(--blue); }
.badge-transfer { background: var(--orange-pale); color: var(--orange); }
.time-main { flex: 1; }
.time-club { font-size: 1rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.time-region { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.time-seats {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}
.time-seats.urgent { color: var(--red); }
.time-details {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.time-dt { display: flex; align-items: center; gap: 4px; font-size: 0.88rem; font-weight: 600; }
.time-dt .date { color: var(--text-secondary); }
.time-dt .clock { color: var(--green-dark); font-size: 1rem; font-weight: 700; }
.time-course { font-size: 0.78rem; color: var(--text-muted); }
.time-price { font-size: 1rem; font-weight: 700; color: var(--green-dark); margin-left: auto; }
.time-price small { font-size: 0.7rem; font-weight: 400; color: var(--text-muted); }

/* ── Date Group ── */
.date-group-header {
  padding: 12px 16px 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}
.date-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--green-pale);
}

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  background: var(--white);
  margin: 0 12px 8px;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.skel-line { height: 14px; margin-bottom: 8px; }
.skel-line.w-60 { width: 60%; }
.skel-line.w-40 { width: 40%; }
.skel-line.w-80 { width: 80%; }

/* ── Search ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 8px;
}
.search-input-wrap {
  flex: 1;
  position: relative;
}
.search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 40px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  font-size: 0.9rem;
  outline: none;
  background: var(--white);
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--green-light); }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
}
.filter-btn {
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.filter-btn.active { border-color: var(--green); background: var(--green-pale); }

/* ── Filter Chips ── */
.filter-chips {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chip.active { border-color: var(--green); background: var(--green-pale); color: var(--green-dark); font-weight: 700; }

/* ── Filter Panel ── */
.filter-panel {
  display: none;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.filter-panel.open { display: block; }
.filter-row { margin-bottom: 12px; }
.filter-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.filter-select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--white);
  outline: none;
}
.price-range { display: flex; align-items: center; gap: 8px; }
.price-input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  outline: none;
  text-align: right;
}
.filter-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-filter-reset {
  flex: 1;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.88rem;
  cursor: pointer;
}
.btn-filter-apply {
  flex: 2;
  height: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--green-dark);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Detail Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none;
  align-items: flex-end;
}
.modal-overlay.open { display: flex; }
.modal-sheet {
  width: 100%;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 0 0 calc(env(safe-area-inset-bottom, 0) + 24px);
  max-height: 92vh;
  overflow-y: auto;
  animation: sheet-up 0.25s ease-out;
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 16px;
}
.modal-header { padding: 0 20px 16px; border-bottom: 1px solid var(--border); }
.modal-club { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.modal-meta { font-size: 0.85rem; color: var(--text-muted); }
.modal-body { padding: 16px 20px; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f5f5f5; }
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 0.85rem; color: var(--text-secondary); }
.detail-value { font-size: 0.92rem; font-weight: 600; }
.modal-actions { padding: 16px 20px 0; display: flex; gap: 10px; }
.btn-kakao {
  flex: 1;
  height: 50px;
  background: #FEE500;
  color: #191600;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.btn-tel {
  flex: 1;
  height: 50px;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.btn-fav {
  width: 50px;
  height: 50px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-fav.active { border-color: var(--red); color: var(--red); }

/* ── Forms ── */
.form-page {
  background: var(--white);
  min-height: calc(100vh - var(--nav-h));
  padding: 20px 20px 40px;
}
.form-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.form-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--green-light); }
.form-input.error { border-color: var(--red); }
.form-error { font-size: 0.78rem; color: var(--red); margin-top: 4px; }
.btn-primary {
  width: 100%;
  height: 52px;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--green); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.btn-outline {
  width: 100%;
  height: 52px;
  background: var(--white);
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.form-divider { text-align: center; margin: 16px 0; color: var(--text-muted); font-size: 0.85rem; }

/* ── Terms checkboxes ── */
.terms-group { margin: 16px 0; }
.terms-all {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--green-pale);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 8px;
}
.terms-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.terms-item a { color: var(--green); text-decoration: underline; margin-left: auto; font-size: 0.78rem; }
.checkbox { width: 20px; height: 20px; accent-color: var(--green-dark); cursor: pointer; }
.terms-text { font-size: 0.88rem; flex: 1; }
.terms-required { color: var(--red); font-weight: 700; }

/* ── My Page ── */
.mypage-section {
  background: var(--white);
  margin: 0 0 8px;
  padding: 0;
}
.mypage-profile {
  background: var(--green-dark);
  color: #fff;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.profile-name { font-size: 1.1rem; font-weight: 700; }
.profile-phone { font-size: 0.85rem; opacity: 0.8; margin-top: 2px; }
.mypage-menu-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  font-size: 0.95rem;
  gap: 12px;
  color: var(--text);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.mypage-menu-item:last-child { border-bottom: none; }
.mypage-menu-item .menu-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.mypage-menu-item .menu-arrow { margin-left: auto; color: var(--text-muted); }
.mypage-menu-item.danger { color: var(--red); }
.login-cta {
  background: var(--white);
  padding: 32px 20px;
  text-align: center;
}
.login-cta .cta-icon { font-size: 3rem; margin-bottom: 12px; }
.login-cta .cta-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.login-cta .cta-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; }

/* ── Favorites ── */
.fav-club-card {
  background: var(--white);
  margin: 0 12px 8px;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.fav-club-icon { font-size: 1.5rem; }
.fav-club-info { flex: 1; }
.fav-club-name { font-size: 0.95rem; font-weight: 700; }
.fav-club-count { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.fav-remove-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
}

/* ── Alerts ── */
.alert-card {
  background: var(--white);
  margin: 0 12px 8px;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.alert-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.alert-title { font-size: 0.95rem; font-weight: 600; }
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--green-light); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.88rem;
  white-space: nowrap;
  animation: toast-in 0.2s ease-out, toast-out 0.2s ease-in 2.3s forwards;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.empty-desc { font-size: 0.85rem; text-align: center; }

/* ── Footer ── */
.app-footer {
  background: #f9f9f9;
  border-top: 1px solid var(--border);
  padding: 20px 20px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.footer-links { display: flex; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.footer-links a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (min-width: 768px) {
  body { max-width: 480px; margin: 0 auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .toast-container { max-width: 440px; }
}

/* ── Utilities ── */
.text-center { text-align: center; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.hidden { display: none !important; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
