/* Main Application Styles */

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  flex: 1;
  width: 100%;
}

/* Hero Section */
.hero-card {
  background: linear-gradient(135deg, var(--forest-dark) 0%, var(--forest) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
}

.hero-card::after {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 240px;
  height: 240px;
  background-image: url('/icons/ccsa-emblem.png');
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

.hero-tag {
  display: inline-block;
  background: rgba(243, 236, 87, 0.2);
  color: var(--sun);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  border: 1px solid rgba(243, 236, 87, 0.4);
}

.hero-card h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #FFFFFF;
  line-height: 1.15;
  margin-bottom: 16px;
  max-width: 700px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 650px;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Club Facts Grid */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.fact-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 16px;
}

.fact-number {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--sun);
  line-height: 1;
  margin-bottom: 4px;
}

.fact-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

/* Next Rally Card */
.next-rally-card {
  background-color: var(--surface-card);
  border: 2px solid var(--forest);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

@media (max-width: 768px) {
  .next-rally-card {
    grid-template-columns: 1fr;
  }
}

.countdown-box {
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  text-align: center;
  min-width: 220px;
}

.countdown-units {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-card);
  border-radius: 4px;
  padding: 2px 8px;
  min-width: 44px;
}

.countdown-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

/* Calendar Styles */
.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.calendar-month-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--ink);
}

.view-toggle-group {
  display: inline-flex;
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.view-toggle-btn {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.view-toggle-btn.active {
  background-color: var(--surface-card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Mon-Sun Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.calendar-header-day {
  background-color: var(--surface-alt);
  padding: 10px 4px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--border);
}

.calendar-day-cell {
  min-height: 90px;
  padding: 4px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
}

.calendar-day-cell:nth-child(7n) {
  border-right: none;
}

.calendar-day-cell.other-month {
  background-color: rgba(0, 0, 0, 0.02);
  opacity: 0.45;
}

.calendar-day-cell.today {
  background-color: rgba(243, 236, 87, 0.15);
}

.day-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 4px;
  color: var(--muted);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendar-day-cell.today .day-number {
  background-color: var(--sun);
  color: var(--forest-dark);
  font-weight: 900;
}

/* Rally Bar across calendar days */
.rally-bar {
  margin-top: 4px;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #FFFFFF;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.15s ease;
  line-height: 1.2;
}

.rally-bar:hover {
  opacity: 0.9;
}

.rally-bar.bar-start {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.rally-bar.bar-mid {
  border-radius: 0;
}
.rally-bar.bar-end {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-content {
  background-color: var(--surface-card);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background-color: var(--surface-card);
  z-index: 10;
}

.modal-body {
  padding: 24px;
  flex: 1;
}

.modal-close-btn {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.modal-close-btn:hover {
  background-color: var(--surface-alt);
  color: var(--ink);
}

/* Stepper & Form Controls */
.stepper-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  overflow: hidden;
}

.stepper-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  background-color: var(--surface-alt);
  user-select: none;
}

.stepper-btn:hover {
  background-color: var(--border);
}

.stepper-value {
  width: 44px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-strong);
  transition: 0.2s ease;
  border-radius: 30px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: #FFFFFF;
  transition: 0.2s ease;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Sticky RSVP Footer */
.rsvp-sticky-footer {
  position: sticky;
  bottom: 0;
  background-color: var(--surface-card);
  border-top: 2px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.06);
  z-index: 10;
}

.total-display {
  display: flex;
  flex-direction: column;
}

.total-amount {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

/* Install PWA Banner */
.install-banner {
  background: linear-gradient(90deg, var(--forest) 0%, var(--forest-light) 100%);
  color: #FFFFFF;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.install-banner-text {
  font-weight: 600;
  font-size: 0.95rem;
}

/* Social Feed */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.social-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.social-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.social-caption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.4;
}

/* Tables (Admin / Finance) */
.data-table-container {
  overflow-x: auto;
  background-color: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background-color: var(--surface-alt);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: rgba(0,0,0,0.015);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background-color: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
