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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #0B1F33;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------
   Header
   -------------------------------------------------------- */
header {
  background: linear-gradient(135deg, #0B1F33 0%, #1F3A56 100%);
  color: #fff;
  padding: 1rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 700px;
  margin: 0 auto;
}

.header-left {
  text-align: left;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-on {
  color: #F4F7FA;
}

.brand-deck {
  color: #2ED1B2;
}

.subtitle {
  font-size: 0.78rem;
  color: #a0aec0;
  margin-top: 0.15rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Auth button in header */
.auth-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* User info when logged in */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-email {
  font-size: 0.75rem;
  color: #a0aec0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  background: transparent;
  color: #a0aec0;
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.logout-btn:hover {
  color: #fff;
}

/* --------------------------------------------------------
   Filters
   -------------------------------------------------------- */
.filters {
  background: #fff;
  padding: 1rem;
  gap: 0.75rem;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #e2e8f0;
  max-height: none;
  overflow: visible;
  transition: max-height 0.2s ease-out, opacity 0.2s, padding 0.2s;
}

.filters.collapsed {
  display: none;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #718096;
}

.filter-group input,
.filter-group select {
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #f7fafc;
  color: #0B1F33;
  outline: none;
  transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: #2ED1B2;
  background: #fff;
}

/* Autocomplete dropdown */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #cbd5e0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  list-style: none;
  z-index: 20;
  display: none;
}

.autocomplete-list.open {
  display: block;
}

.autocomplete-list li {
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-size: 0.92rem;
  border-bottom: 1px solid #f0f0f0;
}

.autocomplete-list li:last-child {
  border-bottom: none;
}

.autocomplete-list li:hover,
.autocomplete-list li.highlighted {
  background: #edfaf6;
}

/* Team checkboxes */
.team-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  max-height: 120px;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.team-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #1F3A56;
  cursor: pointer;
  user-select: none;
}

.team-checkboxes input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2ED1B2;
  cursor: pointer;
}

/* Clear button */
.clear-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: #2ED1B2;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.2rem 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.clear-btn:hover {
  color: #24B899;
}

/* Share button */
.share-btn {
  align-self: flex-start;
  background: #2ED1B2;
  color: #fff;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.share-btn:hover {
  background: #24B899;
}

.share-btn.copied {
  background: #48bb78;
}

/* --------------------------------------------------------
   Results bar
   -------------------------------------------------------- */
.results-bar {
  padding: 0.5rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 11;
}

.results-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#result-count {
  font-size: 0.82rem;
  color: #718096;
  font-weight: 600;
}

.filter-toggle {
  display: none;
  background: none;
  border: none;
  color: #2ED1B2;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.filter-toggle:hover {
  color: #24B899;
}

/* --------------------------------------------------------
   Schedule / Day groups
   -------------------------------------------------------- */
main {
  padding: 1rem;
  max-width: 700px;
  margin: 0 auto;
}

.day-group {
  margin-bottom: 1.25rem;
}

.day-header {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1F3A56;
  border-bottom: 2px solid #2ED1B2;
  padding-bottom: 0.35rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.day-header .entry-count {
  font-size: 0.78rem;
  font-weight: 500;
  color: #a0aec0;
}

/* --------------------------------------------------------
   Entry cards
   -------------------------------------------------------- */
.entry-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 0 0.7rem;
  align-items: start;
}

.entry-time {
  font-size: 1rem;
  font-weight: 700;
  color: #2ED1B2;
  padding-top: 0.05rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.entry-main {
  min-width: 0;
}

.entry-team-line {
  font-size: 1rem;
  font-weight: 600;
  color: #0B1F33;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-details {
  font-size: 0.82rem;
  color: #718096;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-hall {
  display: inline-block;
  background: #edfaf6;
  color: #1F3A56;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.35rem;
  white-space: nowrap;
}

/* --------------------------------------------------------
   "Up next" highlight
   -------------------------------------------------------- */
.entry-card.entry-next {
  border-left: 3px solid #2ED1B2;
  background: #f0faf5;
}

/* --------------------------------------------------------
   Selected team highlight
   -------------------------------------------------------- */
.entry-card.entry-selected {
  background: #e0f5ec;
}

.next-badge {
  display: inline-block;
  background: #2ED1B2;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  margin-bottom: 0.2rem;
}

/* --------------------------------------------------------
   Empty state
   -------------------------------------------------------- */
.empty-state {
  text-align: center;
  color: #a0aec0;
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

/* --------------------------------------------------------
   Footer
   -------------------------------------------------------- */
footer {
  max-width: 700px;
  margin: 2rem auto 1.5rem;
  padding: 0 1rem;
  text-align: center;
}

.disclaimer {
  font-size: 0.75rem;
  color: #a0aec0;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.donation-message {
  font-size: 0.82rem;
  color: #1F3A56;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.donation-btn {
  display: inline-block;
  background: #2ED1B2;
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.donation-btn:hover {
  background: #24B899;
}

/* --------------------------------------------------------
   Responsive: wider screens get horizontal filter row
   -------------------------------------------------------- */
@media (min-width: 600px) {
  .filter-toggle {
    display: none !important;
  }

  .filters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    top: 0;
  }

  .filter-group {
    flex: 1 1 160px;
    max-width: 260px;
  }

  #team-group {
    flex-basis: 100%;
    max-width: 100%;
  }

  .team-checkboxes {
    max-height: 80px;
  }

  .clear-btn {
    align-self: center;
  }
}

/* Mobile: show filter toggle in results bar */
@media (max-width: 599px) {
  .filter-toggle {
    display: block;
  }

  .filters.collapsed {
    display: none;
  }

  .results-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (min-width: 900px) {
  .filters {
    max-width: 700px;
    margin: 0 auto;
  }

  .results-bar {
    max-width: 700px;
    margin: 0 auto;
  }
}

/* --------------------------------------------------------
   Utility classes
   -------------------------------------------------------- */
.hidden {
  display: none !important;
}

/* --------------------------------------------------------
   Modal
   -------------------------------------------------------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #718096;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover {
  color: #0B1F33;
}

/* --------------------------------------------------------
   Auth Modal
   -------------------------------------------------------- */
.auth-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1F3A56;
  margin: 0 0 1.25rem;
}

.waitlist-cta {
  text-align: center;
  font-size: 0.85rem;
  color: #718096;
  margin: 1rem 0 0;
}

.waitlist-cta a {
  color: #2ED1B2;
  text-decoration: none;
  font-weight: 500;
}

.waitlist-cta a:hover {
  text-decoration: underline;
}

.auth-error {
  background: #fed7d7;
  color: #c53030;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #1F3A56;
}

.form-group input {
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #f7fafc;
  transition: border-color 0.2s, background 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #2ED1B2;
  background: #fff;
}

.auth-submit-btn {
  background: #2ED1B2;
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-submit-btn:hover {
  background: #24B899;
}

.auth-submit-btn:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-divider span {
  padding: 0 0.75rem;
  color: #a0aec0;
  font-size: 0.82rem;
}

.google-signin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fff;
  color: #1F3A56;
  border: 1px solid #e2e8f0;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.google-signin-btn:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

/* --------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #0B1F33;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.toast-error {
  background: #c53030;
}

.toast.toast-success {
  background: #276749;
}

/* --------------------------------------------------------
   Gated features (for Scope 3)
   -------------------------------------------------------- */
.locked-feature {
  opacity: 0.6;
  position: relative;
}

.locked-feature input {
  pointer-events: none;
}

.locked-badge {
  display: inline-block;
  background: #F2B705;
  color: #0B1F33;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  text-transform: uppercase;
}

.upgrade-prompt {
  font-size: 0.75rem;
  color: #2ED1B2;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upgrade-prompt:hover {
  color: #24B899;
}

/* Team at limit state */
.team-at-limit {
  opacity: 0.5;
  cursor: not-allowed;
}

.team-at-limit input {
  cursor: not-allowed;
}

/* --------------------------------------------------------
   Waitlist Modal
   -------------------------------------------------------- */
.waitlist-modal-content {
  text-align: center;
}

.waitlist-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0B1F33;
  margin-bottom: 0.5rem;
}

.waitlist-description {
  font-size: 0.9rem;
  color: #718096;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.waitlist-form input[type="email"] {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #f7fafc;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}

.waitlist-form input[type="email"]:focus {
  outline: none;
  border-color: #2ED1B2;
  background: #fff;
}

.waitlist-submit-btn {
  background: #2ED1B2;
  color: #fff;
  border: none;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.waitlist-submit-btn:hover {
  background: #24B899;
}

.waitlist-submit-btn:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

.waitlist-success {
  background: #c6f6d5;
  color: #276749;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.waitlist-error {
  background: #fed7d7;
  color: #c53030;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}
