* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  padding-top: 1rem;
  background: #fafafa;
}

/* Hero Header - Full size at top of page, scrolls normally */
.header-hero {
  position: relative;
  text-align: center;
  padding: 3rem 1rem;
  margin: 0 -2rem 0 -2rem;
  background: #fafafa;
}

.header-hero-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin: 0;
}

.header-hero-subtitle {
  font-size: 1.125rem;
  color: #666;
  margin: 0.5rem 0 1rem 0;
}

.header-hero-subtitle a,
.header-hero-subtitle a:link,
.header-hero-subtitle a:visited {
  color: #20b2aa;
  text-decoration: none;
}

.header-hero-subtitle a:hover {
  text-decoration: underline;
}

.header-hero .city-selector {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.header-hero .city-selector input {
  padding: 1rem 1.25rem;
  font-size: 1.125rem;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 8px;
}

.header-hero .city-selector input:focus {
  border-color: #20b2aa;
  box-shadow: 0 0 0 3px #20b2aa24;
}

.header-hero-line {
  display: inline-block;
}

/* Compact Header - Fixed bar that fades in when hero scrolls out of view */
.header-compact {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.75rem 2rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.header-compact.visible {
  opacity: 1;
  pointer-events: auto;
}

.header-compact-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.header-compact-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-compact-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.header-compact .city-selector {
  max-width: 280px;
  flex: 1;
}

.header-compact .city-selector input {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  text-align: left;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.header-compact .city-selector input:focus {
  border-color: #20b2aa;
  box-shadow: 0 0 0 2px #20b2aa24;
}

/* City selector base styles */
.city-selector {
  position: relative;
}

.city-selector input {
  width: 100%;
  background: #fff;
  outline: none;
}

.city-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.city-suggestions.active {
  display: block;
}

.city-suggestion {
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-align: left;
}

.city-suggestion:hover {
  background: #f0f0f0;
}

.city-suggestion.selected {
  background-color: #e4e4e4;
}

.city-suggestion-loading {
  padding: 0.5rem 1rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ddd;
  border-top-color: #888;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tag filters section */
.tag-filters {
  display: flex;
  margin-bottom: 1.5rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.tag-filters-content {
  flex: 1;
  padding: 0.75rem 0;
  overflow: hidden;
}

.tag-filters-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: flex-start;
  padding: 0 0.5rem 0 1rem;
  max-height: 2.15rem;
  overflow: hidden;
}

.tag-filters-main.expanded {
  max-height: 100%;
}

.tag-filter {
  padding: 0.15rem 0.7rem 0.27rem 0.55rem;
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  font-size: 0.875rem;
  border: 1.7px solid;
  border-radius: 2rem;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 600;
  text-transform: capitalize;
  font-family: inherit;
}

.tag-filter .tag-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
}

.tag-filter .tag-icon svg {
  width: 12px;
  height: 12px;
}

/* Tag filter states */
.tag-filter[data-state="allowed"] {
  color: #fff;
}

.tag-filter[data-state="allowed"]:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.tag-filter[data-state="ignored"] {
  background: #fff;
}

.tag-filter[data-state="ignored"]:hover {
  opacity: 0.7 !important;
  transform: scale(1.02);
}

.tag-filter[data-state="disallowed"] {
  background: #fff;
  border-color: #dc3545;
  color: #dc3545;
  position: relative;
  background-color: rgba(220, 53, 69, 0.48);
}

.tag-filter[data-state="disallowed"]:hover {
  filter: brightness(1.2) contrast(0.9);
  transform: scale(1.02);
}

.tag-filter[data-state="disallowed"]:before {
  position: absolute;
  content: "";
  left: 0;
  top: 50%;
  right: 0;
  border-top: 2px solid;
  border-color: inherit;

  -webkit-transform:rotate(-10deg);
  -moz-transform:rotate(-10deg);
  -ms-transform:rotate(-10deg);
  -o-transform:rotate(-10deg);
  transform:rotate(-10deg);
}

/* Expand/collapse toggle */
.tag-filters-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  font-size: 0.875rem;
  border: none;
  border-left: 1px solid #e0e0e0;
  border-radius: 0 8px 8px 0;
  background: #f8f8f8;
  cursor: pointer;
  color: #666;
  transition: all 0.15s ease;
}

.tag-filters-toggle:hover {
  background: #f0f0f0;
  color: #333;
}

.tag-filters-toggle .toggle-icon {
  display: block;
  transition: transform 0.2s ease;
}

.tag-filters-toggle.expanded .toggle-icon {
  transform: rotate(180deg);
}

/* Empty message */
.empty-message {
  text-align: center;
  padding: 3rem 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-message p {
  margin: 0;
  color: #666;
}

.empty-message .empty-hint {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #999;
}

/* Listings */
.listings {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.listing {
  display: flex;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.listing:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.listing-content {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 102%;
}

.listing-line-1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-right: 3.5rem;
}

.listing-name {
  color: #20b2aa;   
  font-weight: 600;
  font-size: 1.0625rem;
}

.listing:hover .listing-name {
  text-decoration: underline;
}

.listing-line-2 {
  display: flex;
}

.listing-description {
  color: #666;
  font-size: 1rem;
}

.listing-line-3 {
  display: inline;
  font-size: 0.8125rem;
  margin: 0.17rem 0 0.27rem 0;
}

.listing-location {
  color: #6a5acd;
  display: inline;
  padding-right: 0.5rem;
  font-weight: 600;
  opacity: 0.55;
}

.listing-tags {
  display: inline;
}

.listing-tag {
  padding: 0.125rem 0.5rem 0.125rem 0rem;
  font-weight: 600;
  text-transform: capitalize;
  color: #fff;
  opacity: 0.5;
}

/* Distance pill */
.listing-distance-pill {
  display: none;
  align-items: center;
  justify-content: center;
  border-color: #333;
  background: #666;
  color: #fff;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  min-width: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0 0 0 8px;
  margin-top: -0.6rem;
  margin-right: -0.55rem;
}

.listing-distance-pill.visible {
  display: inline-flex;
}

.listing-distance-pill svg {
  width: 14px;
  height: 14px;
  margin-left: 1px;
  margin-right: 1px;
}

/* Event Page */
.event-page {
  max-width: 700px;
  margin: 0 auto;
}

.event-nav {
  margin-bottom: 2rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #20b2aa;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.back-link:hover {
  text-decoration: underline;
}

.event-header {
  margin-bottom: 1.55rem;
}

.event-title {
  font-size: 2rem;
  line-height: 2.5rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #333;
}

.event-meta {
  display: block;
  padding-left: 0.1rem;
}

.event-cities {
  display: inline;
  padding-right: 1.25rem;
  opacity: 0.75;
}

.event-city {
  color: #6a5acd;
  font-size: 1rem;
}

.event-city:not(:last-child)::after {
  content: ",";
}

.event-tags {
  display: inline;
}

.event-tag {
  padding: 0.25rem 1.25rem 0.25rem 0;
  font-size: 1rem;
  text-transform: capitalize;
  color: #666;
  opacity: 0.67;
}

.event-description {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.event-description p {
  margin: 0 0 1rem 0;
}

.event-description p:last-child {
  margin-bottom: 0;
}

.event-footer {
  text-align: center;
}

.event-external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 500;
  background: #5fae94;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.event-external-link:hover {
  filter: brightness(1.10) contrast(0.9);
  transform: translateY(-2px);
}

.external-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.event-disclaimer {
  margin: 1.5rem 0 0 0;
  font-size: 0.8rem;
  color: #888;
}

.event-updated {
  margin: 0.3rem 0 0 0;
  font-size: 0.8rem;
  color: #999;
}

.header-add-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #20b2aa;
  background: #20b2aa10;
  border: 1px solid #20b2aa;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.15s ease;
}

.header-add-button svg {
  width: 16px;
  height: 16px;
}

.header-add-button:hover {
  filter: brightness(1.2) contrast(0.9);
  transform: scale(1.1);
}

.header-hero .header-add-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.header-compact .header-add-button {
  flex-shrink: 0;
}

/* Site Footer */
.footer-area {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  color: #888;
  font-size: 0.875rem;
}

.footer-area a {
  color: #666;
  text-decoration: none;
}

.footer-area a:hover {
  color: #20b2aa;
  text-decoration: underline;
}

.footer-separator {
  margin: 0 0.5rem;
  color: #ccc;
}

/* Legal Pages + Info Pages */
.legal-page,
.info-page {
  max-width: 700px;
  margin: 0 auto;
}

.legal-nav {
  margin-bottom: 2rem;
}

.legal-page h1,
.info-page h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 2rem 0;
  color: #333;
}

.legal-page h2,
.info-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 1rem 0;
  color: #333;
}

.legal-page h3,
.info-page h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  color: #444;
}

.legal-page p,
.info-page p {
  margin: 0 0 1rem 0;
  line-height: 1.7;
  color: #555;
}

.legal-page ul,
.info-page ul {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
  color: #555;
}

.legal-page li,
.info-page li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.legal-page a,
.info-page a {
  color: #20b2aa;
}

.legal-page a:hover,
.info-page a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem;
    padding-top: 0.5rem;
  }

  .event-cities {
      padding-right: 1.1rem;
  }

  .event-tag {
      padding: 0.25rem 1.1rem 0.25rem 0;
  }

  .event-title {
      font-size: 1.7rem;
      line-height: 2rem;
      font-weight: 600;
      margin: 0 0 1rem 0;
      color: #333;
  }

  .footer-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem 0.5rem;
    margin-top: 1.25rem;
    font-size: 0.8125rem;
  }

  .footer-area a {
    display: inline-block;
    padding: 0.25rem 0;
  }

  .footer-separator {
    display: none;
  }

  .header-hero {
    padding: 2rem 1rem;
    margin: 0 -1rem 0 -1rem;
  }

  .header-hero-title {
    font-size: 2rem;
  }

  .header-hero-subtitle {
    font-size: 1rem;
  }

  .header-compact {
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
  }

  .header-compact-content {
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .header-compact-title {
    font-size: 1rem;
  }

  .header-compact .city-selector {
    max-width: none;
    flex: 1;
    min-width: 150px;
  }

  .header-compact .city-selector input {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
  }

  .header-add-button {
    width: 1.8rem;
    height: 1.8rem;
  }

  .tag-filter {
    padding: 0.1rem 0.55rem 0.2rem 0.4rem;
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
    font-size: 0.75rem;
  }

  .tag-filters-content {
    padding: 0.5rem 0.1rem 0.5rem 0.5rem;
  }

  .tag-filters-main {
    max-height: 3.7rem;
    padding: 0 0.1rem;
  }

  .tag-filters-toggle {
    padding: 0 0.75rem;
  }

  .listing {
    position: relative;
  }

  .listing-content {
    padding: 1.2rem 1rem;
  }

  .listing-description{
    font-size: 0.875rem;
  }

  .listing-line-1 {
    gap: 0.5rem;
    padding-right: 0;
  }

  .listing-line-3{
    font-size: 0.75rem;
  }

  .listing-name {
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 1rem;
    max-width: 100%;
  }

  .listing-tags {
    width: 100%;
    margin-left: -0.07rem;
    margin-top: -0.14rem;
  }

  .listing-distance-pill {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    min-width: auto;
    padding: 0.25rem 0.5rem;
    padding: 0.25rem 0.5rem 0.1rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0 0 0 8px;
    margin-top: -0.7rem;
    margin-right: -0.6rem;
  }

  .listing-distance-pill.visible {
    display: inline-flex;
  }

  .listing-distance-pill svg {
    width: 14px;
    height: 14px;
    margin-top: 3px;
    margin-bottom: -1px;
    margin-right: 1px;
  }

}
