:root {
  --tennis-green: #2e7d32;
  --tennis-green-light: #43a047;
  --tennis-green-dark: #1b5e20;
  --tennis-yellow: #f9a825;
  --tennis-ball: #cddc39;
  --court-bg: #f1f8e9;
  --sidebar-width: 240px;
}

body {
  font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* Navbar */
.navbar {
  background: linear-gradient(135deg, var(--tennis-green-dark), var(--tennis-green)) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: white !important;
}
.navbar-brand .badge {
  background: var(--tennis-yellow);
  color: #333;
  font-size: 0.6rem;
  vertical-align: middle;
}
.nav-link { color: rgba(255,255,255,0.9) !important; font-size: 0.9rem; }
.nav-link:hover, .nav-link.active { color: var(--tennis-yellow) !important; }
.nav-link i { margin-right: 4px; }

/* Cards */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.card-header {
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
}
.card-header.bg-tennis {
  background: linear-gradient(135deg, var(--tennis-green-dark), var(--tennis-green)) !important;
  color: white;
}

/* Buttons */
.btn-tennis {
  background: linear-gradient(135deg, var(--tennis-green), var(--tennis-green-light));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-tennis:hover {
  background: linear-gradient(135deg, var(--tennis-green-dark), var(--tennis-green));
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46,125,50,0.3);
}
.btn-outline-tennis {
  border: 2px solid var(--tennis-green);
  color: var(--tennis-green);
  border-radius: 8px;
  padding: 6px 18px;
  font-weight: 600;
  background: transparent;
}
.btn-outline-tennis:hover {
  background: var(--tennis-green);
  color: white;
}

/* 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: #e53935; }
.court-B { background: #1e88e5; }
.court-C { background: #43a047; }
.court-D { background: #fb8c00; }
.court-E { background: #8e24aa; }

/* Schedule grid */
.schedule-slot {
  border-radius: 8px;
  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: #e8f5e9; border-color: #a5d6a7; }
.schedule-slot.reserved { background: #e3f2fd; border-color: #90caf9; }
.schedule-slot.full { background: #fce4ec; border-color: #ef9a9a; }
.schedule-slot.my-reserved { background: #fff8e1; border-color: var(--tennis-yellow); }
.schedule-slot.past {
  background: #f5f5f5 !important;
  border-color: #e0e0e0 !important;
  cursor: default;
  opacity: 0.6;
}
.schedule-slot.past:hover { transform: none !important; box-shadow: none !important; }
.schedule-slot.selected-reserve {
  background: #a5d6a7 !important;
  border-color: #2e7d32 !important;
  box-shadow: 0 0 0 3px rgba(46,125,50,0.25);
}
.schedule-slot.selected-cancel {
  background: #ffcdd2 !important;
  border-color: #e53935 !important;
  box-shadow: 0 0 0 3px rgba(229,57,53,0.25);
}
/* 액션 바 */
#actionBar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(27,94,32,0.97);
  backdrop-filter: blur(4px);
  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: 8px;
  padding: 4px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.85rem;
}
.calendar-day:hover { background: #e8f5e9; }
.calendar-day.has-schedule { background: #c8e6c9; }
.calendar-day.today { border: 2px solid var(--tennis-green); }
.calendar-day.selected { background: var(--tennis-green); 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: #eeeeee; }
.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;
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 40%, #43a047 100%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.login-logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tennis-yellow), #ff8f00);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* Stats */
.stat-card {
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: white;
}
.stat-card .stat-num { font-size: 2rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.85rem; opacity: 0.85; }
.stat-card.green { background: linear-gradient(135deg, #2e7d32, #43a047); }
.stat-card.blue { background: linear-gradient(135deg, #1565c0, #1e88e5); }
.stat-card.orange { background: linear-gradient(135deg, #e65100, #fb8c00); }
.stat-card.purple { background: linear-gradient(135deg, #6a1b9a, #8e24aa); }

/* Table */
.table-hover tbody tr:hover { background: #f1f8e9; }
thead th { background: #f5f5f5; font-weight: 600; font-size: 0.88rem; }

/* Toast */
.toast-container { position: fixed; top: 70px; right: 16px; z-index: 9999; }
.toast { border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* 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: #2e7d32; color: white; }
.badge-absent { background: #757575; color: white; }

/* Page header */
.page-header {
  background: linear-gradient(135deg, var(--tennis-green-dark), var(--tennis-green));
  color: white;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.page-header h4 { margin: 0; font-weight: 700; }
.page-header p { margin: 4px 0 0; opacity: 0.85; font-size: 0.9rem; }

/* Form */
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid #ddd;
  font-size: 0.92rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--tennis-green);
  box-shadow: 0 0 0 0.2rem rgba(46,125,50,0.15);
}

/* Nav pills */
.nav-pills .nav-link.active {
  background: var(--tennis-green);
}
.nav-pills .nav-link { color: var(--tennis-green); }

/* Week days header */
.week-header div {
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #666;
  padding: 6px 0;
}
.week-header div:first-child { color: #e53935; }
.week-header div:last-child { color: #1e88e5; }

/* 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: 500;
  transition: background 0.15s;
}
.cal-cell:not(.past):hover .cal-day:not(.today):not(.selected) { background: #e8f5e9; }
.cal-day.today    { background: var(--tennis-green); }
.cal-day.selected { background: var(--tennis-green-dark); }
.cal-day.has-sched { background: #1565c0; }
.cal-day.today span, .cal-day.selected span,
.cal-day.has-sched span { color: white !important; }
.cal-day.other-month span { color: #c0c0c0 !important; }
.cal-cell:not(.past):hover .cal-day.has-sched:not(.today):not(.selected) { background: #1976d2; }
.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(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
}
