/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --color-bg:        #f8f9fa;
  --color-surface:   #ffffff;
  --color-border:    #dee2e6;
  --color-text:      #212529;
  --color-muted:     #6c757d;
  --color-primary:   #0d6efd;
  --color-primary-h: #0b5ed7;
  --color-danger:    #dc3545;
  --color-danger-h:  #bb2d3b;
  --color-success-bg:#d1e7dd;
  --color-success-tx:#0a3622;
  --color-alert-bg:  #f8d7da;
  --color-alert-tx:  #58151c;
  --radius:          0.5rem;
  --shadow:          0 1px 3px rgba(0,0,0,.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1.5;
}

/* ── Layout wrapper ── */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem;
}

/* Auto-wrap every <body> child if no .container used */
body > * { padding-left: 1rem; padding-right: 1rem; }
body > .container { padding-left: 1rem; padding-right: 1rem; }

/* ── Flash messages ── */
.flash-notice,
.flash-alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  font-weight: 500;
}
.flash-notice { background: var(--color-success-bg); color: var(--color-success-tx); }
.flash-alert  { background: var(--color-alert-bg);   color: var(--color-alert-tx); }

/* ── Typography ── */
h1 { font-size: 1.6rem; margin: 1rem 0 0.5rem; }
h2 { font-size: 1.2rem; margin: 1.25rem 0 0.5rem; }

/* ── Nav ── */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.nav a, .nav form { margin: 0; }

/* ── Buttons & links-as-buttons ── */
.btn,
input[type="submit"],
button[type="submit"] {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--color-primary);
  color: #fff;
  transition: background 0.15s;
  -webkit-appearance: none;
}
.btn:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  background: var(--color-primary-h);
}
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger-h); }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-secondary:hover { background: #e9f0ff; }

/* ── Forms ── */
.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.field {
  margin-bottom: 1rem;
}
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.15);
}

/* ── Checkbox rows ── */
.check-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0;
}
.check-row input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}
.check-row label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  margin: 0;
}

/* ── Toggle-reveal sections ── */
.toggle-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}
.toggle-section-header {
  background: var(--color-bg);
  padding: 0 0.75rem;
}
.toggle-section-body {
  padding: 0.75rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* ── Form actions row ── */
.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.5rem;
  flex-wrap: wrap;
}

/* ── Error list ── */
.error-list {
  background: var(--color-alert-bg);
  color: var(--color-alert-tx);
  border: 1px solid #f1aeb5;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.error-list ul { margin: 0; padding-left: 1.25rem; }
.error-list li { margin-bottom: 0.25rem; }

/* ── Event cards (dashboard) ── */
.event-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.event-card-meta {
  font-size: 0.85rem;
  color: var(--color-muted);
}
.event-card-types {
  font-weight: 600;
  font-size: 0.95rem;
}
.event-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e9ecef;
  color: var(--color-text);
  margin-right: 0.25rem;
}

/* ── Show page detail ── */
.detail-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--color-muted); font-weight: 500; }
