/* ClubCore Calendar — public + admin */
.cc-cal-wrap { max-width: 1100px; margin: 0 auto; }
.cc-cal-toolbar {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between; margin-bottom: 1rem;
}
.cc-cal-toolbar .cc-cal-nav { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cc-cal-title { font-size: 1.25rem; font-weight: 700; margin: 0; min-width: 12rem; text-align: center; }
.cc-cal-views { display: flex; gap: .35rem; }
.cc-cal-views button, .cc-cal-nav button {
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04);
  color: inherit; border-radius: 8px; padding: .4rem .75rem; cursor: pointer; font: inherit;
}
.cc-cal-views button.is-active, .cc-cal-nav button:hover {
  background: rgba(22,163,74,.2); border-color: #16a34a;
}
.cc-cal-legend { display: flex; gap: 1rem; font-size: .85rem; opacity: .85; margin: .5rem 0 1rem; flex-wrap: wrap; }
.cc-cal-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.cc-cal-dot.free { background: #16a34a; }
.cc-cal-dot.busy { background: #f59e0b; }
.cc-cal-dot.empty { background: rgba(255,255,255,.25); }


/* Event Date Blocker (EDB) — public Camp EDR, brand gold */
.cc-cal-dot.camp-block {
  background: linear-gradient(135deg, #d4af37, #e8c96a);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, .35);
}
.cc-cal-day.has-camp-block {
  background: linear-gradient(160deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .08));
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .55);
  cursor: pointer;
}
.cc-cal-day.has-camp-block:hover {
  background: linear-gradient(160deg, rgba(212, 175, 55, .34), rgba(212, 175, 55, .14));
}
.cc-cal-day.has-camp-block::after {
  content: '';
  position: absolute;
  bottom: .45rem;
  left: 50%;
  transform: translateX(-50%);
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #e8c96a);
}
.cc-cal-day.has-camp-block .cc-cal-daymeta {
  color: #e8c96a;
  opacity: 1;
  font-weight: 600;
}
.cc-cal-block-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.cc-cal-week-cell.has-camp-block {
  background: linear-gradient(180deg, rgba(212, 175, 55, .42), rgba(212, 175, 55, .18));
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .45);
}
.cc-cal-week-cell.has-camp-block:hover {
  background: linear-gradient(180deg, rgba(212, 175, 55, .55), rgba(212, 175, 55, .28));
}
.cc-cal-year-grid span.camp-block {
  background: linear-gradient(135deg, rgba(212, 175, 55, .7), rgba(232, 201, 106, .55));
  color: #111;
  font-weight: 700;
}
.cc-cal-year-grid span.camp-block:hover {
  background: linear-gradient(135deg, #d4af37, #e8c96a);
}

.cc-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  background: rgba(255,255,255,.06); border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
}
.cc-cal-head {
  text-align: center; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .6rem .25rem; background: rgba(0,0,0,.25); opacity: .8;
}
.cc-cal-day {
  min-height: 5.5rem; padding: .4rem; background: rgba(11,13,16,.85);
  cursor: default; position: relative; transition: background .15s;
}
.cc-cal-day.in-month { cursor: pointer; }
.cc-cal-day.in-month:hover { background: rgba(22,163,74,.12); }
.cc-cal-day.out-month { opacity: .35; }
.cc-cal-day.is-today .cc-cal-daynum {
  background: #16a34a; color: #fff; border-radius: 999px; width: 1.6rem; height: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.cc-cal-day.has-free { box-shadow: inset 0 0 0 1px rgba(22,163,74,.35); }
.cc-cal-day.has-free::after {
  content: ''; position: absolute; bottom: .45rem; left: 50%; transform: translateX(-50%);
  width: .45rem; height: .45rem; border-radius: 50%; background: #16a34a;
}
.cc-cal-day.is-selected { background: rgba(22,163,74,.22); box-shadow: inset 0 0 0 2px #16a34a; }
.cc-cal-daynum { font-weight: 600; font-size: .9rem; }
.cc-cal-daymeta { font-size: .7rem; opacity: .75; margin-top: .35rem; line-height: 1.2; }

/* Week view */
.cc-cal-week {
  display: grid; grid-template-columns: 3.5rem repeat(7, 1fr); gap: 2px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px; overflow: hidden;
}
.cc-cal-week .cc-cal-head, .cc-cal-week .cc-time-label {
  background: rgba(0,0,0,.25); padding: .4rem; font-size: .7rem; text-align: center;
}
.cc-cal-week .cc-time-label { opacity: .65; }
.cc-cal-week-cell {
  min-height: 2.2rem; background: rgba(11,13,16,.85); border-top: 1px solid rgba(255,255,255,.04);
  cursor: pointer; position: relative;
}
.cc-cal-week-cell.has-free { background: rgba(22,163,74,.1); }
.cc-cal-week-cell.is-selected { outline: 2px solid #16a34a; z-index: 1; }

/* Year view */
.cc-cal-year {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
}
.cc-cal-year-month { border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: .6rem; background: rgba(11,13,16,.6); }
.cc-cal-year-month h4 { margin: 0 0 .5rem; font-size: .9rem; text-align: center; }
.cc-cal-year-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; font-size: .65rem; }
.cc-cal-year-grid span {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; cursor: pointer;
}
.cc-cal-year-grid span.out { opacity: .25; cursor: default; }
.cc-cal-year-grid span.free { background: rgba(22,163,74,.35); font-weight: 600; }
.cc-cal-year-grid span.free:hover { background: rgba(22,163,74,.55); }
.cc-cal-year-grid span.today { box-shadow: inset 0 0 0 1px #fff; }

/* Modal */
/* —— Booking modal: large premium sheet (Apple-like) —— */
.cc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.75rem);
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  animation: cc-backdrop-in 0.28s ease;
}
.cc-modal-backdrop[hidden] { display: none !important; }
@keyframes cc-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cc-modal {
  width: min(1040px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
  color: #0f172a;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 30px 90px rgba(15, 23, 42, 0.28),
    0 8px 24px rgba(15, 23, 42, 0.12);
  animation: cc-modal-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cc-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.975); }
  to { opacity: 1; transform: none; }
}

.cc-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.6rem 1.1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  position: sticky;
  top: 0;
  z-index: 2;
}
.cc-modal-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}
.cc-modal-header h2,
.cc-modal h2#cc-modal-title {
  margin: 0 0 0.35rem !important;
  font-family: 'Oswald', system-ui, sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem) !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0f172a !important;
  border: 0 !important;
  padding: 0 !important;
}
.cc-modal-sub {
  margin: 0 !important;
  font-size: 0.98rem !important;
  color: #64748b !important;
  opacity: 1 !important;
}
.cc-modal-sub strong {
  color: #b8922a !important;
  font-weight: 700;
}
.cc-modal-close {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.04);
  color: #334155 !important;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.15s ease;
  float: none;
  opacity: 1;
}
.cc-modal-close:hover {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a !important;
  transform: scale(1.04);
}

.cc-modal-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.92fr) minmax(0, 1.35fr);
  gap: 0;
  min-height: 0;
  flex: 1;
}
.cc-modal-aside {
  padding: 1.25rem 1.35rem 1.5rem;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.cc-modal-form {
  padding: 1.25rem 1.5rem 1.5rem;
}
.cc-modal-section-title {
  margin: 0 0 0.35rem !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  color: #0f172a !important;
  text-transform: none !important;
  border: 0 !important;
  padding: 0 !important;
  font-family: Inter, system-ui, sans-serif !important;
}
.cc-modal-hint {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.45;
}

.cc-slot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-height: min(52vh, 28rem);
  overflow: auto;
  padding: 0.15rem 0.1rem 0.35rem;
}
.cc-slot-chip {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: #0f172a !important;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.cc-slot-chip:hover {
  border-color: rgba(184, 146, 42, 0.55);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  background: #fffdf7;
}
.cc-slot-chip.is-active {
  background: linear-gradient(135deg, #d4af37, #e8c96a);
  border-color: transparent;
  color: #1a1408 !important;
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.35);
}

.cc-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}
.cc-field {
  display: grid;
  gap: 0.35rem;
  margin: 0 !important;
  font-size: 0.9rem;
  color: #0f172a !important;
}
.cc-field-full { grid-column: 1 / -1; }
.cc-field > span {
  display: block;
  margin: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 650;
  color: #475569 !important;
  opacity: 1 !important;
}
.cc-field > span em {
  font-style: normal;
  font-weight: 500;
  color: #94a3b8;
}

/* High-specificity form controls — beat Academy theme globals */
.cc-modal input,
.cc-modal select,
.cc-modal textarea,
body.theme-academy .cc-modal input,
body.theme-academy .cc-modal select,
body.theme-academy .cc-modal textarea,
body.theme-academy-nights .cc-modal input,
body.theme-academy-nights .cc-modal select,
body.theme-academy-nights .cc-modal textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  color-scheme: light !important;
  padding: 0.72rem 0.85rem;
  font: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cc-modal input::placeholder,
.cc-modal textarea::placeholder,
body.theme-academy .cc-modal input::placeholder,
body.theme-academy .cc-modal textarea::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  opacity: 1;
}
.cc-modal select option {
  background: #ffffff;
  color: #0f172a;
}
.cc-modal input:focus,
.cc-modal select:focus,
.cc-modal textarea:focus,
body.theme-academy .cc-modal input:focus,
body.theme-academy .cc-modal select:focus,
body.theme-academy .cc-modal textarea:focus {
  outline: none;
  border-color: rgba(212, 175, 55, 0.85) !important;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.18);
}
.cc-modal textarea { min-height: 6.5rem; resize: vertical; }

.cc-captcha-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}
.cc-captcha-row input { flex: 1; }

.cc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.cc-modal .btn {
  min-height: 2.65rem;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
  font-weight: 700;
}
.cc-modal .btn-primary,
body.theme-academy .cc-modal .btn-primary {
  background: linear-gradient(135deg, #d4af37, #e8c96a) !important;
  color: #1a1408 !important;
  border: 0 !important;
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.28);
}
.cc-modal .btn-primary:hover {
  filter: brightness(1.03);
}
.cc-modal .btn-secondary,
body.theme-academy .cc-modal .btn-secondary {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
}
.cc-modal .form-status,
.cc-modal .empty-state,
.cc-modal .admin-muted {
  color: #64748b !important;
  margin-top: 0.75rem;
}
.cc-modal .form-status.is-error { color: #b91c1c !important; }
.cc-modal .form-status.is-success { color: #15803d !important; }

/* Theme locks: headings inside modal never inherit dark page text onto dark surfaces */
body.theme-academy .cc-modal,
body.theme-academy-nights .cc-modal {
  background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,250,252,0.99) 100%) !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}
body.theme-academy .cc-modal h1,
body.theme-academy .cc-modal h2,
body.theme-academy .cc-modal h3,
body.theme-academy .cc-modal label,
body.theme-academy .cc-modal p,
body.theme-academy-nights .cc-modal h1,
body.theme-academy-nights .cc-modal h2,
body.theme-academy-nights .cc-modal h3,
body.theme-academy-nights .cc-modal label,
body.theme-academy-nights .cc-modal p {
  color: #0f172a !important;
}
body.theme-academy .cc-modal .cc-modal-sub,
body.theme-academy .cc-modal .cc-modal-hint,
body.theme-academy-nights .cc-modal .cc-modal-sub,
body.theme-academy-nights .cc-modal .cc-modal-hint {
  color: #64748b !important;
}
body.theme-academy .cc-modal .cc-field > span,
body.theme-academy-nights .cc-modal .cc-field > span {
  color: #475569 !important;
}

/* Optional subtle dark-mode modal for Academy Nights only if preferred light still works;
   keep light sheet for readability as requested for form contrast. */

@media (max-width: 900px) {
  .cc-modal-body { grid-template-columns: 1fr; }
  .cc-modal-aside {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }
  .cc-slot-chips { max-height: 9.5rem; }
}

@media (max-width: 720px) {
  .cc-modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
    margin-top: auto;
  }
  .cc-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .cc-modal-grid { grid-template-columns: 1fr; }
  .cc-modal-actions {
    flex-direction: column-reverse;
  }
  .cc-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .cc-modal-header,
  .cc-modal-form,
  .cc-modal-aside {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

/* Admin calendar */
.admin-body .cc-cal-day { background: #fff; color: #111; min-height: 4.5rem; border: 1px solid #e5e7eb; }
.admin-body .cc-cal-grid { background: #e5e7eb; border-color: #e5e7eb; }
.admin-body .cc-cal-head { background: #f3f4f6; color: #374151; }
.admin-body .cc-cal-day.in-month:hover { background: #ecfdf5; }
.admin-body .cc-cal-day.has-free { box-shadow: inset 0 0 0 1px #86efac; }
.admin-body .cc-cal-day.is-selected { background: #d1fae5; }
.admin-body .cc-cal-views button, .admin-body .cc-cal-nav button {
  border-color: #d1d5db; background: #fff; color: #111;
}
.admin-body .cc-cal-views button.is-active { background: #d1fae5; border-color: #16a34a; }
.admin-body .cc-appt-pill {
  display: block; font-size: .65rem; margin-top: 2px; padding: 1px 4px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-body .cc-appt-pill.pending { background: #fef3c7; color: #92400e; }
.admin-body .cc-appt-pill.accepted { background: #d1fae5; color: #065f46; }
.admin-body .cc-appt-pill.declined { background: #fee2e2; color: #991b1b; }

.cc-thread { display: flex; flex-direction: column; gap: .75rem; margin: 1rem 0; }
.cc-msg {
  border-radius: 10px; padding: .75rem 1rem; border: 1px solid rgba(0,0,0,.08); background: #f9fafb;
}
.cc-msg.system { background: #eff6ff; border-color: #bfdbfe; }
.cc-msg.admin { background: #ecfdf5; border-color: #a7f3d0; }
.cc-msg .cc-msg-meta { font-size: .8rem; opacity: .7; margin-bottom: .35rem; }

/* P3: mobile polish */
@media (max-width: 720px) {
  .cc-cal-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
  }
  .cc-cal-title { font-size: 1.05rem; text-align: left; min-width: 0; }
  .cc-cal-views, .cc-cal-nav { justify-content: flex-start; flex-wrap: wrap; }
  .cc-cal-day { min-height: 3.6rem; padding: .3rem; }
  .cc-cal-daynum { font-size: .8rem; }
  .cc-cal-daymeta { font-size: .62rem; }
  .cc-cal-week { grid-template-columns: 2.4rem repeat(7, 1fr); font-size: .65rem; }
  .cc-cal-year { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .cc-modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
    margin-top: auto;
  }
  .cc-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .cc-slot-chips { max-height: 7.5rem; }
  .cc-modal-actions { flex-direction: column; }
  .cc-modal-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .cc-cal-year { grid-template-columns: 1fr; }
}


/* ADMIN CAL MOBILE v716 */
@media (max-width: 640px) {
  .admin-body .cc-cal-grid {
    gap: 1px;
  }
  .admin-body .cc-cal-day {
    min-height: 3.1rem;
    padding: 0.2rem;
  }
  .admin-body .cc-cal-daynum {
    font-size: 0.75rem;
  }
  .admin-body .cc-cal-daymeta {
    font-size: 0.58rem;
    margin-top: 0.15rem;
  }
  .admin-body .cc-appt-pill {
    display: none; /* keep day clean; open list via requests */
  }
  .admin-body .cc-cal-day.has-free::after {
    bottom: 0.25rem;
    width: 0.35rem;
    height: 0.35rem;
  }
  /* On very small screens show abbreviated weekday heads */
  .admin-body .cc-cal-head {
    font-size: 0.58rem;
    letter-spacing: 0;
    padding: 0.35rem 0;
  }
}
