/* ══════════════════════════════════════════════════════════════
   비스타밸리 피클볼 클럽 — 디자인 시스템
   코트 그린 · 피클볼 라임 · 허니 골드 · 페이퍼
   (클래스명은 기존과 동일하게 유지하여 전 페이지에 일괄 반영)
   ══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Gothic+A1:wght@400;500;600;700;800;900&display=swap');

:root {
  /* 브랜드 코어 팔레트 */
  --court-dark:  #0b2620;
  --court:       #123b33;
  --court-play:  #1c6353;
  --court-glow:  #2a7d68;
  --pop:         #dbe74e;   /* 피클볼 라임 */
  --pop-deep:    #b6c22f;
  --honey:       #e6a23c;   /* 골드 */
  --honey-deep:  #c9821f;
  --ink:         #16211c;
  --paper:       #f4f6ef;
  --paper-2:     #eceee3;
  --line:        #d9ddcd;
  --muted:       #5c6b60;

  /* 호환용 별칭 (인라인 var(--pickle-*) 사용처 유지) */
  --pickle-green:       #1c6353;
  --pickle-green-light: #2a7d68;
  --pickle-green-dark:  #123b33;
  --pickle-yellow:      #e6a23c;
  --pickle-ball:        #dbe74e;
  --court-bg:           #eef3e6;
  --sidebar-width: 240px;

  --shadow-sm: 0 2px 10px rgba(18,59,51,.08);
  --shadow-md: 0 8px 24px rgba(18,59,51,.12);
  --radius:    16px;
}

body {
  font-family: 'Gothic A1', 'Malgun Gothic', 'Segoe UI', sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  /* 피클볼 패들·공 패턴 + 옅은 코트 글로우 */
  background-image:
    url('/images/pickle-pattern.svg'),
    radial-gradient(circle at 100% 0, rgba(219,231,78,.10), transparent 42%),
    radial-gradient(circle at 0 100%, rgba(28,99,83,.08), transparent 40%);
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: 260px 260px, auto, auto;
  background-position: 0 0, 0 0, 0 0;
  background-attachment: fixed, fixed, fixed;
}

h1,h2,h3,h4,h5,h6 { letter-spacing: -.01em; }

/* ── Navbar ── */
.navbar {
  background: linear-gradient(135deg, var(--court-dark) 0%, var(--court) 55%, var(--court-play) 100%) !important;
  box-shadow: 0 2px 14px rgba(11,38,32,.28);
  border-bottom: 3px solid var(--pop);
}
.navbar-brand {
  font-family: 'Black Han Sans', 'Gothic A1', sans-serif;
  font-weight: 400;
  font-size: 1.28rem;
  letter-spacing: .01em;
  color: #fff !important;
}
.navbar-brand img { filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.navbar-brand .badge {
  background: var(--pop);
  color: var(--court-dark);
  font-size: 0.6rem;
  font-weight: 700;
  vertical-align: middle;
}
.nav-link { color: rgba(255,255,255,0.86) !important; font-size: 0.9rem; font-weight: 500; transition: color .15s; }
.nav-link:hover, .nav-link.active { color: var(--pop) !important; }
.nav-link i { margin-right: 4px; }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; }
.dropdown-item { border-radius: 8px; font-size: .9rem; padding: 7px 12px; }
.dropdown-item:active { background: var(--court-play); }
.dropdown-item.active { background: var(--court-play); }

/* ── Cards ── */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.card-header.bg-pickle, .bg-pickle {
  background: linear-gradient(135deg, var(--court) 0%, var(--court-play) 100%) !important;
  color: #fff !important;
  border-bottom: none;
}

/* ── Buttons ── */
.btn-pickle {
  background: linear-gradient(135deg, var(--court-play), var(--court-glow));
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 22px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(28,99,83,.28);
  transition: all 0.2s;
}
.btn-pickle:hover {
  background: linear-gradient(135deg, var(--court), var(--court-play));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(28,99,83,.36);
}
.btn-outline-pickle {
  border: 2px solid var(--court-play) !important;
  color: var(--court-play) !important;
  border-radius: 999px;
  padding: 7px 20px;
  font-weight: 700;
  background: #fff !important;
  transition: all 0.2s;
}
.btn-outline-pickle:hover {
  background: var(--court-play) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(28,99,83,.30);
}
/* 노랑 강조 버튼(추가 등)도 골드톤으로 */
.btn-warning {
  background: var(--honey) !important;
  border-color: var(--honey) !important;
  color: #3a2a08 !important;
  font-weight: 700;
}
.btn-warning:hover { background: var(--honey-deep) !important; border-color: var(--honey-deep) !important; }
.btn-primary { background: var(--court-play); border-color: var(--court-play); }
.btn-primary:hover { background: var(--court); border-color: var(--court); }

/* ── Court badges ── */
.court-badge {
  display: inline-block;
  width: 28px; height: 28px;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}
.court-A { background: #e4572e; }
.court-B { background: #1b6ca8; }
.court-C { background: #1c6353; }
.court-D { background: #e6a23c; }
.court-E { background: #7b52ab; }

/* ── Schedule grid ── */
.schedule-slot {
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
  font-size: 0.88rem;
}
.schedule-slot:hover { transform: translateY(-1px); }
.schedule-slot.available { background: #e9f4e4; border-color: #b6d9a6; }
.schedule-slot.reserved { background: #e4f1ee; border-color: #9ccabd; }
.schedule-slot.full { background: #fdeae2; border-color: #f2b39c; }
.schedule-slot.my-reserved { background: #fbf3dd; border-color: var(--honey); }
.schedule-slot.past {
  background: var(--paper-2) !important;
  border-color: var(--line) !important;
  cursor: default;
  opacity: 0.6;
}
.schedule-slot.past:hover { transform: none !important; box-shadow: none !important; }
.schedule-slot.selected-reserve {
  background: #bfe0ad !important;
  border-color: var(--court-play) !important;
  box-shadow: 0 0 0 3px rgba(28,99,83,.22);
}
.schedule-slot.selected-cancel {
  background: #f6c9bb !important;
  border-color: #e4572e !important;
  box-shadow: 0 0 0 3px rgba(228,87,46,.22);
}
/* 액션 바 */
#actionBar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(18,59,51,0.97);
  backdrop-filter: blur(4px);
  border-top: 3px solid var(--pop);
  z-index: 1050;
  padding: 12px 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}
#actionBar.d-none { transform: translateY(100%); }
body.has-action-bar .container { padding-bottom: 80px; }

/* ── Calendar ── */
.calendar-day {
  min-height: 70px;
  border-radius: 10px;
  padding: 4px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.85rem;
}
.calendar-day:hover { background: var(--court-bg); }
.calendar-day.has-schedule { background: #cfe6c6; }
.calendar-day.today { border: 2px solid var(--court-play); }
.calendar-day.selected { background: var(--court-play); color: white; }
.calendar-day.other-month { opacity: 0.35; }
.calendar-day.past { opacity: 0.45; cursor: default; }
.calendar-day.past:hover { background: transparent !important; }
.calendar-day.past.has-schedule { background: #e6e6e6; }
.calendar-day.past.selected { background: #9e9e9e; color: white; }
.calendar-day .day-num { font-weight: 600; font-size: 1rem; }
.calendar-day .court-dots { margin-top: 2px; }
.calendar-day .court-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin: 1px;
}

/* ── Login page ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--court-dark) 0%, var(--court) 45%, var(--court-play) 100%);
  position: relative;
  overflow: hidden;
}
/* 코트 라인 · 라임 글로우 + 피클볼 패들·공 패턴 */
.login-wrapper::before {
  content: "";
  position: absolute; inset: 0;
  background:
    url('/images/pickle-pattern-light.svg') 0 0 / 240px 240px repeat,
    radial-gradient(circle at 80% 15%, rgba(219,231,78,.16), transparent 40%),
    radial-gradient(circle at 15% 85%, rgba(219,231,78,.10), transparent 45%);
  pointer-events: none;
}
.login-card {
  width: 100%;
  max-width: 440px;
  border-radius: 22px;
  border: none;
  box-shadow: 0 18px 50px rgba(0,0,0,0.32);
  position: relative;
  z-index: 1;
}
.login-logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pop), var(--honey));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
}

/* ── Stats ── */
.stat-card {
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  color: white;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; font-family: 'Black Han Sans', 'Gothic A1', sans-serif; }
.stat-card .stat-label { font-size: 0.85rem; opacity: 0.9; font-weight: 500; }
.stat-card.green  { background: linear-gradient(135deg, var(--court), var(--court-play)); }
.stat-card.blue   { background: linear-gradient(135deg, #124f5e, #1b7f8c); }
.stat-card.orange { background: linear-gradient(135deg, var(--honey-deep), var(--honey)); }
.stat-card.purple { background: linear-gradient(135deg, #4a3d75, #6f5aa8); }

/* ── Table ── */
.table-hover tbody tr:hover { background: var(--court-bg); }
thead th { background: var(--paper-2); font-weight: 700; font-size: 0.88rem; color: var(--court); }

/* ── Toast ── */
.toast-container { position: fixed; top: 70px; right: 16px; z-index: 9999; }
.toast { border-radius: 12px; box-shadow: var(--shadow-md); }

/* ── Mobile ── */
@media (max-width: 768px) {
  .navbar-brand { font-size: 1rem; }
  .schedule-slot { font-size: 0.8rem; padding: 6px 8px; }
  .calendar-day { min-height: 50px; }
  .stat-card .stat-num { font-size: 1.5rem; }
  .hide-mobile { display: none !important; }
  .table-responsive { font-size: 0.82rem; }
}

/* ── Attendance badge ── */
.badge-attend { background: var(--court-play); color: white; }
.badge-absent { background: #8a8f88; color: white; }

/* ── Page header ── */
.page-header {
  background: linear-gradient(135deg, var(--court-dark) 0%, var(--court) 55%, var(--court-play) 100%);
  color: white;
  border-radius: 18px;
  padding: 22px 26px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* 피클볼 · 코트 라인 모티프 */
.page-header::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--pop), var(--pop-deep) 70%, transparent 72%);
  opacity: .16;
  pointer-events: none;
}
.page-header h4 { margin: 0; font-weight: 800; font-family: 'Black Han Sans','Gothic A1',sans-serif; letter-spacing: .01em; position: relative; }
.page-header p { margin: 5px 0 0; opacity: 0.85; font-size: 0.9rem; position: relative; }

/* ── Form ── */
.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 0.92rem;
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--court-play);
  box-shadow: 0 0 0 0.2rem rgba(28,99,83,0.16);
}

/* ── Nav pills ── */
.nav-pills .nav-link.active { background: var(--court-play); }
.nav-pills .nav-link { color: var(--court-play); font-weight: 600; }

/* ── Week days header ── */
.week-header div {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 0;
}
.week-header div:first-child { color: #e4572e; }
.week-header div:last-child { color: #1b6ca8; }

/* ── Clean circle-style calendar (schedule page) ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.cal-cell {
  text-align: center;
  padding: 4px 2px;
  cursor: pointer;
}
.cal-cell.past { cursor: default; }
.cal-day {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  font-size: 0.9rem; font-weight: 600;
  transition: background 0.15s;
}
.cal-cell:not(.past):hover .cal-day:not(.today):not(.selected) { background: var(--court-bg); }
.cal-day.today    { background: var(--court-play); }
.cal-day.selected { background: var(--court-dark); }
.cal-day.has-sched { background: var(--honey); }
.cal-day.today span, .cal-day.selected span,
.cal-day.has-sched span { color: white !important; }
.cal-day.other-month span { color: #b7bdb0 !important; }
.cal-cell:not(.past):hover .cal-day.has-sched:not(.today):not(.selected) { background: var(--honey-deep); }
.cal-cell.past .cal-day:not(.today):not(.selected) { opacity: 0.4; }
.cal-dots {
  display: flex; justify-content: center; gap: 2px;
  margin-top: 2px; min-height: 7px;
}
@media (max-width: 576px) {
  .cal-day { width: 26px; height: 26px; font-size: 0.75rem; }
  .cal-cell { padding: 2px 1px; }
}

/* ── Compact stat cards for 4-per-row mobile layout ── */
@media (max-width: 576px) {
  .stat-card { padding: 10px 4px; }
  .stat-card .stat-num { font-size: 1.1rem; }
  .stat-card .stat-label { font-size: 0.62rem; }
}

/* ── Spinner ── */
.loading-overlay {
  position: fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(244,246,239,0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
}
.spinner-border { color: var(--court-play); }

/* ── 텍스트 유틸 ── */
.text-pickle { color: var(--court-play) !important; }
a { color: var(--court-play); }
a:hover { color: var(--court); }
