/* =========================================
   Cannon River Coworking — Calendar Styles
   ========================================= */

/* --- Page Hero --- */
.cal-hero {
  padding: 140px 24px 72px;
  background: linear-gradient(160deg, #3d4a24 0%, #5e6e3a 60%, #6b8050 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cal-hero::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 64px;
  background: var(--white);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.cal-hero .hero-eyebrow { color: rgba(255,255,255,.65); display: block; margin-bottom: 12px; }
.cal-hero-title {
  font-family: 'Century Gothic', 'Futura', 'Trebuchet MS', sans-serif;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--white);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.cal-hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.75);
  max-width: 520px;
  margin: 0 auto;
}

/* --- Calendar Section --- */
.cal-section {
  padding: 72px 24px 96px;
  background: var(--white);
}

/* --- Calendar Widget --- */
.cal-widget {
  max-width: 100%;
  margin: 0;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 4px 40px rgba(0,0,0,.10), 0 1px 8px rgba(0,0,0,.06);
  overflow: hidden;
}

/* Header row: prev / month-year / next */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  background: var(--river-dark);
  color: var(--white);
}
.cal-header h2 {
  font-family: 'Century Gothic', 'Futura', 'Trebuchet MS', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.cal-nav-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: var(--white);
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.cal-nav-btn:hover { background: rgba(255,255,255,.28); }

/* Day-of-week header */
.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--river);
}
.cal-dow span {
  padding: 10px 0;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.80);
}

/* Grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid #eee;
  border-top: 1px solid #eee;
}
.cal-day {
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
  min-height: 90px;
  padding: 8px;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.cal-day:hover { background: var(--sand); }
.cal-day.other-month { background: #fafafa; }
.cal-day.other-month .cal-day-num { color: #ccc; }
.cal-day.today .cal-day-num {
  background: var(--accent);
  color: var(--white);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.cal-day-num {
  font-size: .88rem;
  font-weight: 600;
  color: var(--bark);
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}
.cal-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-dot--event    { background: #3a7ec8; }
.cal-dot--bookable { background: #3a9e5f; }
.cal-dot--booked   { background: #bbb; }

/* Legend */
.cal-legend {
  display: flex;
  gap: 24px;
  padding: 14px 28px;
  background: var(--sand);
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  color: var(--mid);
}
.cal-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Modal Overlay --- */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.cal-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.cal-modal {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 16px 60px rgba(0,0,0,.24);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(16px) scale(.98);
  transition: transform .22s ease;
}
.cal-modal-overlay.open .cal-modal {
  transform: translateY(0) scale(1);
}
.cal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}
.cal-modal-date {
  font-family: 'Century Gothic', 'Futura', 'Trebuchet MS', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--bark);
}
.cal-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--light);
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
}
.cal-modal-close:hover { background: var(--sand); color: var(--bark); }
.cal-modal-body { padding: 20px 28px 28px; }
.cal-no-events {
  color: var(--light);
  font-size: .9rem;
  text-align: center;
  padding: 24px 0;
}

/* Event card in modal */
.cal-event-card {
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  border-left: 4px solid transparent;
}
.cal-event-card--event {
  background: #eef5ff;
  border-left-color: #3a7ec8;
}
.cal-event-card--bookable {
  background: #eafaf2;
  border-left-color: #3a9e5f;
}
.cal-event-card--booked {
  background: #f4f4f4;
  border-left-color: #ccc;
  opacity: .75;
}
.cal-event-type-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.badge--event    { background: #3a7ec8; color: #fff; }
.badge--bookable { background: #3a9e5f; color: #fff; }
.badge--booked   { background: #aaa; color: #fff; }
.cal-event-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bark);
  margin-bottom: 4px;
}
.cal-event-time {
  font-size: .82rem;
  color: var(--mid);
  margin-bottom: 6px;
}
.cal-event-desc {
  font-size: .87rem;
  color: var(--mid);
  line-height: 1.55;
  margin-bottom: 6px;
}
.cal-event-loc {
  font-size: .78rem;
  color: var(--light);
}

/* Book button */
.cal-book-btn {
  margin-top: 10px;
  display: inline-block;
  background: #3a9e5f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform .1s;
}
.cal-book-btn:hover { background: #2e8050; transform: translateY(-1px); }

/* Booking form */
.cal-booking-form {
  background: #f0faf5;
  border-radius: 12px;
  padding: 18px;
  margin-top: 10px;
}
.cal-booking-form h4 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--bark);
  margin-bottom: 14px;
}
.cal-form-group {
  margin-bottom: 12px;
}
.cal-form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--bark);
  margin-bottom: 4px;
}
.cal-form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #d0e8d8;
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  background: var(--white);
  color: var(--charcoal);
  outline: none;
  transition: border-color var(--transition);
}
.cal-form-group input:focus { border-color: #3a9e5f; }
.cal-booking-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.cal-confirm-btn {
  background: #3a9e5f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.cal-confirm-btn:hover { background: #2e8050; }
.cal-cancel-btn {
  background: none;
  color: var(--mid);
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: .88rem;
  cursor: pointer;
  transition: background var(--transition);
}
.cal-cancel-btn:hover { background: var(--sand); }
.cal-booked-label {
  font-size: .82rem;
  color: #888;
  font-style: italic;
  margin-top: 8px;
}
.cal-success-msg {
  background: #d4f4e2;
  color: #1a6b3a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .87rem;
  font-weight: 600;
  margin-top: 10px;
  display: none;
}
.cal-success-msg.show { display: block; }

/* --- Two-column layout: calendar + upcoming --- */
.cal-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .cal-layout { grid-template-columns: 1fr; }
}

/* --- Upcoming Events Sidebar --- */
.cal-upcoming {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 4px 40px rgba(0,0,0,.10), 0 1px 8px rgba(0,0,0,.06);
  overflow: hidden;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
}
.cal-upcoming-title {
  font-family: 'Century Gothic', 'Futura', 'Trebuchet MS', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  background: var(--river-dark);
  padding: 18px 20px;
  flex-shrink: 0;
}
#cal-upcoming-list {
  overflow-y: auto;
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cal-upcoming-empty {
  color: var(--light);
  font-size: .88rem;
  text-align: center;
  padding: 24px 12px;
}
.cal-upcoming-item {
  border-radius: 10px;
  padding: 12px 14px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: filter .15s;
}
.cal-upcoming-item:hover { filter: brightness(.96); }
.cal-upcoming-item--event    { background: #eef5ff; border-left-color: #3a7ec8; }
.cal-upcoming-item--bookable { background: #eafaf2; border-left-color: #3a9e5f; }
.cal-upcoming-item--booked   { background: #f4f4f4; border-left-color: #ccc; opacity: .7; }
.cal-upcoming-date {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 3px;
}
.cal-upcoming-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--bark);
  margin-bottom: 2px;
}
.cal-upcoming-time {
  font-size: .78rem;
  color: var(--mid);
}
.cal-upcoming-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  margin-top: 5px;
  letter-spacing: .04em;
}
.cal-upcoming-badge--event    { background: #3a7ec8; color: #fff; }
.cal-upcoming-badge--bookable { background: #3a9e5f; color: #fff; }
.cal-upcoming-badge--booked   { background: #aaa;    color: #fff; }

/* Firebase not configured banner */
.cal-config-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: .9rem;
  color: #856404;
}
.cal-config-banner strong { display: block; margin-bottom: 4px; }

/* --- Responsive --- */
@media (max-width: 640px) {
  .cal-day { min-height: 52px; padding: 4px; }
  .cal-day-num { font-size: .75rem; width: 22px; height: 22px; }
  .cal-dot { width: 5px; height: 5px; }
  .cal-header h2 { font-size: 1.1rem; }
  .cal-modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .cal-modal-overlay { align-items: flex-end; padding: 0; }
  .cal-modal-header { padding: 20px 20px 0; }
  .cal-modal-body { padding: 16px 20px 24px; }
  .cal-header { padding: 18px 16px 16px; }
  .cal-legend { padding: 12px 16px; gap: 14px; }
}
