/* Admin Runs Pages Styles */

/* Index Page - Header with Add run button */
.portal-page-header--with-action {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

@media (min-width: 640px) {
  .portal-page-header--with-action {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}

/* Index Page - Page-specific styles only */

/* Admin Runs Tabs */
.admin-runs-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 48px;
  padding: 6px;
  border-radius: 12px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Run Dates List (Past & Upcoming Tabs) */
.run-dates-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.run-dates-month-group {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.run-dates-month-header {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-text-secondary);
  padding: 16px 20px;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

.run-dates-entries {
  display: flex;
  flex-direction: column;
}

.run-date-row {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s ease;
  gap: 12px;
}

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

.run-date-row:hover {
  background: var(--color-bg-alt);
}

.run-date-day {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.run-date-dots {
  display: none;
}

.run-date-title {
  font-size: 15px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Larger screens - bigger text */
@media (min-width: 640px) {
  .run-dates-month-group {
    max-width: 700px;
  }

  .run-date-row {
    padding: 18px 24px;
  }

  .run-date-day {
    font-size: 18px;
  }

  .run-date-title {
    font-size: 18px;
  }
}

@media (min-width: 1024px) {
  .run-date-row {
    padding: 20px 28px;
  }

  .run-date-day {
    font-size: 20px;
  }

  .run-date-title {
    font-size: 20px;
  }
}

.run-date-arrow {
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  margin-left: auto;
}

/* Responsive styles for run dates */
@media (max-width: 639px) {
  .run-date-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  .run-date-day {
    min-width: auto;
    width: 100%;
    font-size: 14px;
  }

  .run-date-dots {
    display: none;
  }

  .run-date-title {
    flex: 1;
    font-size: 14px;
  }

  .run-date-arrow {
    opacity: 1;
  }
}

.admin-runs-list {
  display: grid;
  gap: 16px;
}

.admin-run-card {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: white;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.admin-run-card:hover {
  border-color: var(--color-black);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-run-card-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-run-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
}

.admin-run-card-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.admin-run-card-details {
  color: var(--color-text);
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  line-height: 1.6;
  letter-spacing: -0.01em;
}

.admin-run-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.admin-run-card-rsvps {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.admin-run-card-arrow {
  display: none;
  color: var(--color-text-secondary);
}

/* Show Page */
.admin-run-show {
  padding: 20px 16px 60px;
}

.admin-run-back {
  margin-bottom: 20px;
}

.admin-run-back a {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
  font-size: 18px;
}

.admin-run-header {
  margin-bottom: 24px;
}

.admin-run-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.admin-run-header p {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0;
}

.admin-run-location {
  font-size: 15px;
  color: var(--color-text);
  margin-top: 4px !important;
}

.override-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: #f0f7ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.override-notice-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.override-notice-text {
  color: #0066cc;
  flex: 1;
}

.admin-run-override-link {
  margin-top: 12px;
}

.override-toggle-btn {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.override-toggle-btn:hover {
  background: var(--color-accent);
  color: white;
}

.admin-flash {
  padding: 14px 16px;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 14px;
}

.admin-flash--alert {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

/* Check-in Code Card */
.check-in-code-card {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 24px;
  text-align: center;
  color: white;
}

.check-in-code-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.7;
  margin-bottom: 12px;
}

.check-in-code-value {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 10px;
  margin-bottom: 20px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

.check-in-code-hidden {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
  opacity: 0.5;
}

.check-in-code-note {
  font-size: 14px;
  opacity: 0.7;
  margin: 0;
}

.check-in-code-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.check-in-code-actions button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.check-in-code-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Run Settings Tabs */
.run-settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.run-settings-info {
  margin-bottom: 24px;
  padding: 12px 16px;
  background: #f0f7ff;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
}

.run-settings-info-text {
  margin: 0;
  font-size: 14px;
  color: #0066cc;
  line-height: 1.5;
}

/* Override Card */
.override-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.override-card.hidden {
  display: none;
}

.check-in-code-card.hidden,
.stats-bar.hidden,
.attendees-card.hidden,
.override-toggle-btn.hidden,
[data-run-settings-target="footpathMap"].hidden {
  display: none !important;
}

.override-header {
  margin-bottom: 20px;
}

.override-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-text);
}

.override-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
}

.override-form {
  margin-top: 20px;
}

/* Add run form – sections and collapsible details */
.admin-run-form-page .admin-run-header {
  margin-bottom: 32px;
}

.admin-run-form-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.admin-run-form-section {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.admin-run-form-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.admin-run-form-section .admin-fields {
  margin-bottom: 0;
}

.admin-run-form-details {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.admin-run-form-details-summary {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
  user-select: none;
}

.admin-run-form-details-summary::-webkit-details-marker {
  display: none;
}

.admin-run-form-details-summary::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid var(--color-text-secondary);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s ease;
}

.admin-run-form-details[open] .admin-run-form-details-summary::before {
  transform: rotate(90deg);
}

.admin-run-form-details-summary:hover {
  background: var(--color-bg-alt);
}

.admin-run-form-details-inner {
  padding: 0 20px 20px 20px;
  border-top: 1px solid var(--color-border);
}

.admin-run-form-details-inner .admin-fields {
  padding-top: 20px;
  margin-bottom: 0;
}

.admin-run-form-actions {
  margin-top: 32px;
}

.admin-fields {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-field-header label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.admin-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: #34c759;
  color: white;
}

.admin-badge--default {
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}

.admin-field-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-field-input {
  flex: 1;
}

.admin-field-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  color: var(--color-text);
  transition: border-color 0.2s ease;
}

.admin-field-control:focus {
  outline: none;
  border-color: var(--color-black);
}

.admin-field-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-field-hint {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.admin-field-clear-btn {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.admin-field-clear-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.override-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.override-cancel-btn {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.override-cancel-btn:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-text-secondary);
}

.override-submit-btn {
  background: var(--color-black);
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.override-submit-btn:hover {
  background: #1a1a1a;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
}

.stat-card--default {
  background: var(--color-bg-alt);
}

.stat-card--success {
  background: #34c759;
  color: white;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-card--default .stat-card-value {
  color: var(--color-text);
}

.stat-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.stat-card--default .stat-card-label {
  color: var(--color-text-secondary);
}

.stat-card--success .stat-card-label {
  opacity: 0.9;
}

/* Attendees List */
.attendees-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
}

.attendees-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}

.attendees-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.attendee-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

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

.attendee-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.attendee-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.attendee-avatar--checked {
  background: #34c759;
  color: white;
}

.attendee-avatar--pending {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.attendee-details {
  flex: 1;
  min-width: 0;
}

.attendee-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.attendee-meta {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.attendee-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.attendee-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #d4edda;
  color: #155724;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.attendee-actions .btn-check-in {
  background: var(--color-black);
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.attendee-actions .btn-undo {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.attendees-empty {
  padding: 48px 20px;
  text-align: center;
}

.attendees-empty p {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* Tablet and up */
@media (min-width: 640px) {
  .admin-runs-list {
    gap: 20px;
  }

  .admin-run-card {
    padding: 24px;
  }

  .admin-run-card-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
  }

  .admin-run-card-content {
    flex: 1;
    min-width: 0;
  }

  .admin-run-card-title {
    font-size: 24px;
    margin-bottom: 18px;
  }

  .admin-run-card-date {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .admin-run-card-details {
    font-size: 17px;
  }

  /* Meta section switches to column layout on larger screens */
  .admin-run-card-meta {
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
  }

  .admin-run-card-rsvps {
    font-size: 19px;
  }

  .admin-run-card-arrow {
    display: flex;
    align-items: center;
  }

  .admin-run-show {
    padding: 40px 24px 80px;
  }

  .admin-run-back {
    margin-bottom: 28px;
  }

  .admin-run-header {
    margin-bottom: 32px;
  }

  .admin-run-header h1 {
    font-size: 36px;
    margin-bottom: 8px;
  }

  .admin-run-header p {
    font-size: 18px;
  }

  .admin-run-location {
    font-size: 16px;
  }

  .override-toggle-btn {
    padding: 10px 20px;
    font-size: 15px;
  }

  .check-in-code-card {
    padding: 40px 32px;
    border-radius: 20px;
    margin-bottom: 32px;
  }

  .check-in-code-label {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .check-in-code-value {
    font-size: 64px;
    letter-spacing: 14px;
    margin-bottom: 24px;
  }

  .check-in-code-actions button {
    padding: 12px 24px;
    font-size: 14px;
  }

  .override-card {
    padding: 32px;
    margin-bottom: 32px;
  }

  .override-header h2 {
    font-size: 22px;
  }

  .override-description {
    font-size: 15px;
  }

  .admin-fields {
    gap: 28px;
  }

  .admin-field-header label {
    font-size: 15px;
  }

  .admin-field-control {
    padding: 12px 14px;
    font-size: 16px;
  }

  .override-submit-btn {
    padding: 12px 28px;
    font-size: 15px;
  }

  .stats-bar {
    gap: 20px;
    margin-bottom: 32px;
  }

  .stat-card {
    padding: 24px 16px;
  }

  .stat-card-value {
    font-size: 36px;
  }

  .stat-card-label {
    font-size: 12px;
    letter-spacing: 1px;
  }

  .attendees-header {
    padding: 20px 24px;
  }

  .attendees-header h2 {
    font-size: 20px;
  }

  .attendee-row {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .attendee-info {
    margin-bottom: 0;
    gap: 16px;
  }

  .attendee-avatar {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .attendee-name {
    font-size: 16px;
  }

  .attendee-meta {
    font-size: 13px;
  }

  .attendee-actions {
    flex-shrink: 0;
  }

  .attendee-status {
    padding: 8px 16px;
    font-size: 13px;
  }

  .attendee-actions .btn-check-in {
    padding: 10px 20px;
    font-size: 14px;
  }

  .attendee-actions .btn-undo {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Desktop */
@media (min-width: 1024px) {

  .admin-run-card-title {
    font-size: 26px;
    margin-bottom: 20px;
  }

  .admin-run-card-date {
    font-size: 18px;
  }

  .admin-run-card-details {
    font-size: 18px;
  }

  .admin-run-card-rsvps {
    font-size: 20px;
  }

  .admin-run-show {
    padding: 60px 40px 100px;
    max-width: 1200px;
    margin: 0 auto;
  }

  .admin-run-header h1 {
    font-size: 40px;
  }

  .admin-run-header p {
    font-size: 20px;
  }

  .admin-run-location {
    font-size: 17px;
  }

  .override-toggle-btn {
    padding: 12px 24px;
    font-size: 16px;
  }

  .check-in-code-card {
    padding: 48px;
  }

  .check-in-code-value {
    font-size: 72px;
    letter-spacing: 16px;
  }

  .override-card {
    padding: 40px;
  }

  .override-header h2 {
    font-size: 24px;
  }
}