

/* ── Overlay / Community Gate ── */
.overlay-full {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
}

.gate-sheet {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 92%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  text-align: center;
  animation: fadeScale .3s ease;
}

.gate-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.gate-subtitle {
  font-size: .8125rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
  line-height: 1.5;

}

.dev-footer {
  font-size: .8125rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
  line-height: 1.5;
  margin-top: 15px;
}

.gate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.gate-chip {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--t);
}

.gate-chip.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.gate-continue {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9375rem;
  transition: background var(--t), opacity var(--t);
}

.gate-continue:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.gate-continue:not(:disabled):hover {
  background: var(--accent-hover);
}

/* ── District Bottom Sheet (Mobile only) ── */
.sheet-content {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  width: 500px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .25s ease;
  overflow: hidden;
  align-self: flex-end;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  font-weight: 600;
  font-size: .9375rem;
}

.sheet-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .875rem;
  color: var(--text-secondary);
}

.sheet-close:hover {
  background: var(--border);
}

.sheet-search-wrap {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.sheet-search-wrap input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  outline: none;
}

.sheet-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}

.sheet-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: .875rem;
  cursor: pointer;
}

.sheet-list label:hover {
  background: var(--bg-hover);
}

.sheet-list input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sheet-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 449px) {
  .sheet-header {
    position: relative;
    padding-right: 50px;
    align-items: center;
  }

  .sheet-close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
  }

  .sheet-title {
    max-width: 35%;
    /* Ensure title truncates gracefully if needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sheet-footer {
    position: absolute;
    top: 0;
    right: 48px;
    height: 51px;
    /* Matches approx sheet-header height */
    border-top: none;
    padding: 0;
    align-items: center;
    background: transparent;
  }

  .sheet-footer .btn-ghost,
  .sheet-footer .btn-primary {
    font-size: clamp(0.65rem, 2.5vw, 0.8rem);
    padding: 6px 10px;
    height: 28px;
    /* Matches close button size to look aligned */
  }
}

/* Search */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t), box-shadow var(--t);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 5px 32px;
  background: transparent;
  border: none;
  outline: none;
  font-size: .875rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 8px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .6875rem;
  color: var(--text-muted);
  background: var(--border);
}

.search-clear:hover {
  background: var(--border-strong);
}

.district-wrap {
  position: relative;
  flex-shrink: 0;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  white-space: nowrap;
  transition: all var(--t);
}

.pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pill-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.chevron {
  transition: transform var(--t);
}

.pill-btn[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* Desktop district dropdown — positioned absolutely, z-index above main content */
.district-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 600;
  /* above sticky filter bar */
  overflow: hidden;
  animation: fadeDown .15s ease;
}

.dd-search {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.dd-search input {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: .8125rem;
  outline: none;
}

.dd-list {
  height: 220px;
  overflow-y: auto;
  padding: 4px 0;
}

.dd-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: .8125rem;
  cursor: pointer;
}

.dd-list label:hover {
  background: var(--bg-hover);
}

.dd-list input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.dd-footer {
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Custom Sort Dropdown */
.sort-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 600;
  overflow: hidden;
  animation: fadeDown .15s ease;
}

.sort-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--t), color var(--t);
}

.sort-option:last-child {
  border-bottom: none;
}

.sort-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sort-option.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sort-option i {
  font-size: .875rem;
  opacity: 0.8;
}

.custom-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 26px 4px 9px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239CA3AF' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-size: .8125rem;
  outline: none;
  cursor: pointer;
  color: var(--text-primary);
  transition: border-color var(--t), box-shadow var(--t);
  min-width: 60px;
}

.custom-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}

body.dark .custom-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23555D6A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.sort-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.result-count {
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

/* ── Skeleton Loading ── */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton-box {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.skeleton-card {
  pointer-events: none;
}

.seat-badge {
  display: inline-block;
  font-size: .625rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 6px;
  animation: gentlePulse 4s ease-in-out infinite;
}

.seat-badge.badge-full {
  color: var(--green);
  background: var(--green-bg);
}

.seat-badge.badge-partial {
  color: var(--amber);
  background: var(--amber-bg);
}

.seat-badge.badge-empty {
  color: var(--red);
  background: var(--red-bg);
}

/* Sentinel */
.sentinel {
  height: 40px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 20px;
  gap: 8px;
  text-align: center;
}

.empty-title {
  font-size: 1rem;
  font-weight: 600;
}

.empty-sub {
  font-size: .875rem;
  color: var(--text-secondary);
}

/* ── Buttons ── */
.btn-primary {
  padding: 8px 18px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .875rem;
  transition: background var(--t);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--text-secondary);
  transition: all var(--t);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost-sm {
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  font-size: .8125rem;
  color: var(--text-secondary);
  transition: all var(--t);
}

.btn-ghost-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}