/* Maruke Events — Shared Styles */
/* Design: clean, minimal, serif labels, light backgrounds, subtle borders */

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: #f5f5f0;
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   PIN Gate Overlay
   ============================================ */
.pin-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f5f0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.pin-gate-box {
  text-align: center;
  max-width: 360px;
  width: 90%;
}

.pin-gate-box h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.pin-gate-box p {
  color: #666;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.pin-gate-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  font-family: inherit;
  border: 1px solid #ccc;
  background: #fff;
  text-align: center;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.pin-gate-box input:focus {
  outline: none;
  border-color: #1a1a1a;
}

.pin-gate-box button {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #1a1a1a;
  color: #fff;
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pin-gate-box button:hover {
  background: #333;
}

.error-text {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.container.admin-wide {
  max-width: 1000px;
}

/* ============================================
   Header
   ============================================ */
.site-header {
  padding: 1.5rem 1.25rem 1rem;
  max-width: 720px;
  margin: 0 auto;
}

body.admin-wide .site-header {
  max-width: 1000px;
}

.site-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #1a1a1a;
}

.site-header .subtitle {
  color: #666;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.back-link {
  display: inline-block;
  color: #666;
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.back-link:hover {
  color: #1a1a1a;
}

/* ============================================
   Sections
   ============================================ */
section {
  margin-bottom: 2rem;
}

section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}

/* ============================================
   Section Headings (consistent across event page)
   ============================================ */
.section-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================
   Custom Message
   ============================================ */
.custom-message {
  background: #fff8e6;
  border-left: 3px solid #d4a017;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: #4a4a2a;
}

/* ============================================
   Event Details (definition list layout)
   ============================================ */
.detail-list {
  margin: 0;
  border: 1px solid #ddd;
}

.detail-row {
  display: flex;
  padding: 0;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row dt {
  width: 5.5rem;
  flex-shrink: 0;
  font-weight: 600;
  color: #666;
  padding: 0.4rem 0.5rem;
  border-right: 1px solid #eee;
}

.detail-row dt::after {
  content: ":";
}

.detail-row dd {
  margin: 0;
  color: #1a1a1a;
  padding: 0.4rem 0.5rem;
}

.detail-row dd a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-row dd a:hover {
  color: #555;
}

/* ============================================
   Status Bar
   ============================================ */
.status-bar {
  display: flex;
  gap: 2rem;
  padding: 1rem 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.status-item {
  display: flex;
  flex-direction: column;
}

.status-label {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.status-value.status-green {
  color: #2e7d32;
}

.status-value.status-red {
  color: #c0392b;
}

.status-value.status-gray {
  color: #999;
}

.status-value.status-amber {
  color: #b26a00;
}

/* ============================================
   Player Lists
   ============================================ */
.player-list {
  list-style: none;
  counter-reset: player-counter;
}

.player-list li {
  counter-increment: player-counter;
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.player-list li::before {
  content: counter(player-counter) ".";
  min-width: 2rem;
  color: #999;
  font-size: 0.85rem;
}

.player-list li:nth-child(even) {
  background: #fafaf7;
}

.waitlist {
  margin-top: 0.5rem;
  opacity: 0.7;
}

.waitlist li {
  color: #666;
}

.loading-text {
  color: #999;
  font-style: italic;
}

/* ============================================
   Event Cards (Home Page)
   ============================================ */
.event-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.event-card:hover {
  border-color: #999;
}

.event-card.active {
  border-left: 5px solid #2e5a4e;
}

.event-card.past {
  opacity: 0.55;
}

.event-card-info {
  flex: 1;
  min-width: 0;
}

.event-card-info h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.event-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0;
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
}

.event-card-meta span + span::before {
  content: "\00b7";
  margin: 0 0.4rem;
}

.event-card-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  text-align: right;
  font-size: 0.85rem;
  white-space: nowrap;
  color: #666;
  margin-left: 1.5rem;
  flex-shrink: 0;
}

.event-card-status .spots {
  font-weight: 600;
  color: #1a1a1a;
}

.event-card-status .spots-filling {
  color: #2e7d32;
}

.event-card-status .spots-full {
  color: #c0392b;
}

.event-card-status .waitlist-count {
  color: #b26a00;
  font-size: 0.8rem;
}

.court-badge {
  font-size: 0.75rem;
  color: #2e5a4e;
  font-weight: 600;
}

/* ============================================
   Forms
   ============================================ */
.form-section {
  padding-top: 1.5rem;
  border-top: 1px solid #ddd;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #1a1a1a;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid #ccc;
  background: #fff;
  color: #1a1a1a;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: #1a1a1a;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.form-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
  display: inline-block;
  padding: 0.7rem 2rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #1a1a1a;
  color: #fff;
  border: none;
  cursor: pointer;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.btn-primary:hover {
  background: #333;
}

.btn-secondary {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #ccc;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: #999;
}

/* ============================================
   Result Messages
   ============================================ */
.result-success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.result-success .pin-display {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid #a5d6a7;
  margin: 0.75rem 0;
  font-family: 'Courier New', monospace;
}

.result-error {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #721c24;
}

/* ============================================
   Position Selection Table (signup form)
   ============================================ */
.section-subheading {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.25rem;
}

.field-hint {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.position-select-table {
  max-width: 340px;
  border-collapse: collapse;
  border: 1px solid #ddd;
}

.position-select-table th {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  text-align: center;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ddd;
}

.position-select-table th.pos-col-label {
  text-align: left;
  width: 1%;
  white-space: nowrap;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.position-select-table td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
  border: 1px solid #eee;
}

.position-select-table .pos-col-pref,
.position-select-table .pos-col-check {
  width: 80px;
  text-align: center;
}

.position-select-table .pos-col-label {
  text-align: left;
  font-size: 0.95rem;
  width: 1%;
  white-space: nowrap;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* ============================================
   Skill Level Table
   ============================================ */
.skill-level-table {
  margin-bottom: 1.25rem;
}

.skill-level-table label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.skill-level-table input[type="radio"] {
  width: 1rem;
  height: 1rem;
}

.pos-star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: #ccc;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.pos-star-btn:hover {
  color: #f0c040;
}

.pos-star-btn.selected {
  color: #f0c040;
}

/* ============================================
   Player List Table (position columns)
   ============================================ */
.signup-table {
  width: 100%;
  border-collapse: collapse;
}

.signup-table th {
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  padding: 0.4rem 0.5rem;
  border-bottom: 2px solid #ccc;
  border-right: 1px solid #ddd;
}

.signup-table th:last-child {
  border-right: none;
}

.signup-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #eee;
  border-right: 1px solid #eee;
  font-size: 0.95rem;
}

.signup-table td:last-child {
  border-right: none;
}

.signup-table tr.waitlist-row {
  opacity: 0.6;
}

.pos-chip {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.85rem;
  margin-right: 0.2rem;
}

.pos-chip.preferred {
  background: #e8f5e9;
  color: #2e7d32;
}

.pos-chip.assigned-tbd {
  color: #999;
  font-style: italic;
}
