:root {
  --primary-color: #000000;
  --secondary-color: #ffffff;
  --sidebar-bg-color: rgba(0, 0, 0, 0.2);
  --marker-bg: rgb(255, 255, 255);
  --marker-text: #000000;
  --marker-shadow: rgba(0, 0, 0, 0.5);
  --marker-width: 4em;
  --marker-hover-scale: 1.5;
  --sidebar-bg: var(--sidebar-bg-color);
  --sidebar-border: #eeeeee;
  --sidebar-max-width: 600px;
  --event-bg: #eeeeee;
  --event-hover: #f0f0f0;
  --event-active-bg: var(--primary-color);
  --event-active-text: var(--secondary-color);
  --event-text: var(--primary-color);
  --event-description-opacity: 0.9;
  --font-size-normal: 0.9375rem;
  --font-size-title: 1.125rem;
  --spacing-small: 0.2rem;
  --spacing-medium: 0.5rem;
  --spacing-large: 1.0rem;
}

#map-container {
  position: relative;
  height: 80vh;
  font-family: 'Rubik', sans-serif;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.leaflet-base-pane {
  filter: grayscale(100%) brightness(100%) contrast(100%);
}

#sidebar {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  padding: var(--spacing-large);
  overflow-y: auto;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  max-width: var(--sidebar-max-width);
  border-left: 1px solid var(--sidebar-border);
  z-index: 2;
  width: 400px; /* Default width */
  min-width: 300px; /* Minimum width */
}

#resizer {
  position: absolute;
  top: 0;
  right: 400px; /* Initial position - will be updated by JS */
  width: 8px;
  height: 100%;
  background: rgba(0, 0, 0, 0.10); /* lighter grey */
  cursor: grab;
  z-index: 3;
  user-select: none;
  transition: background-color 0.2s ease;
  border-left: 2px solid rgba(255, 255, 255, 0.5);
  border-right: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

#resizer:hover {
  background-color: rgba(0, 0, 0, 0.18);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
  cursor: grab;
}

#resizer.dragging {
  background-color: var(--primary-color);
  cursor: grabbing;
}

#resizer::before {
  content: '⋮⋮';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(0, 0, 0, 0.8);
  font-size: 24px; /* double the previous 12px */
  line-height: 1;
  pointer-events: none;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.event-item {
  padding: var(--spacing-large);
  margin-bottom: var(--spacing-medium);
  background-color: var(--event-bg);
  border-radius: 15px;
  cursor: pointer;
  color: var(--event-text);
}

.event-item:hover {
  background-color: var(--event-hover);
}

.event-item.active {
  background-color: var(--event-active-bg);
  color: var(--event-active-text);
}

.event-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: #000000;
  color: #ffffff;
  border-radius: 50%;
  margin-right: var(--spacing-medium);
  margin-bottom: var(--spacing-small);
  font-family: var(--font-heading);
  font-size: var(--font-size-heading-mobile);
  line-height: var(--line-height-heading-mobile);
}
.event-item.active .event-number {
  background: #ffffff;
  color: #000000;
}

.event-title {
  font-size: var(--font-size-title);
  margin-bottom: var(--spacing-small);
  margin-top: var(--spacing-small);
}

.event-address {
  font-size: var(--font-size-normal);
  opacity: var(--event-description-opacity);
  margin-bottom: var(--spacing-medium);
}

.event-description {
  font-size: var(--font-size-normal);
  opacity: var(--event-description-opacity);
}

.map-marker {
  width: 2.5rem;
  height: 2.5rem;
  margin-right: var(--spacing-medium);
  margin-bottom: var(--spacing-small);
  font-family: var(--font-heading);
  font-size: 25px;
  line-height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background:#000000;
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.18, 1.25, 0.5, 1);
  cursor: pointer;
}

.map-marker.active {
  transform: scale(var(--marker-hover-scale));
  background: var(--marker-text);
  color: var(--marker-bg);
}

#show-all {
  margin-bottom: var(--spacing-large);
}

#locations-list {
  margin-top: 1rem;
  border-top: 0px solid #eee;
  padding-top: 1rem;
}

.event-details {
  background: #ffffff;
  color: var(--marker-text);
  padding: 1rem;
  margin: 0.5rem 0;
  border-radius: 8px;
}

.event-entry {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.event-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
 
.event-type {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  margin-right: 0.3rem;
  font-weight: bold;
}


.event-title-detail, 
.event-title-detail a {
  font-family: var(--font-heading);
  font-size: var(--font-size-heading-mobile);
  line-height: var(--line-height-heading-mobile);
  font-weight: bold;
  margin: 0.2rem 0;
}

.event-artists, .event-artists a {
  font-family: var(--font-primary);
  font-size: var(--font-size-standard-mobile);
  margin: 0.2rem 0;
  font-weight: normal;
  text-decoration: underline;
}

.show-more-container {
  /* margin-top: 1rem; */
  text-align: center;
}

.show-more-btn {
  background: var(--primary-color);
  color: var(--secondary-color);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Rubik', sans-serif;
  transition: all 0.3s ease;
}

.show-more-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

.show-more-btn:active {
  transform: translateY(0);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .mobile-only {
    display: none; /* Hide toggle buttons for split layout */
  }

  #map-container {
    display: flex;
    flex-direction: column;
    height: 90vh;
  }

  #map {
    height: 50vh; /* Top half for map - will be adjustable */
    position: relative;
    flex-shrink: 0;
    min-height: 200px; /* Minimum map height */
  }

  #resizer {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    height: 8px;
    cursor: ns-resize;
    background: rgba(0, 0, 0, 0.10); /* lighter grey */
    border-top: 2px solid rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    z-index: 3;
    user-select: none;
    transition: background-color 0.2s ease;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  }

  #resizer:hover {
    background-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    cursor: grab;
  }

  #resizer.dragging {
    cursor: grabbing;
  }

  #resizer::before {
    content: '⋯';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(0, 0, 0, 0.8);
    font-size: 32px; /* double the previous 16px */
    line-height: 1;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  }

  #sidebar {
    position: relative;
    height: calc(50vh - 8px); /* Bottom half minus resizer height */
    max-width: none;
    width: 100%;
    right: auto;
    top: auto;
    border-left: none;
    border-top: none;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transform: none;
    transition: none;
    overflow-y: auto;
    min-height: 200px; /* Minimum sidebar height */
  }

  .event-item {
    padding: var(--spacing-medium);
    margin-bottom: var(--spacing-small);
  }

  .event-number {
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
  }

  .event-title {
    font-size: 1rem;
  }

  .event-address {
    font-size: 0.85rem;
  }

  .event-description {
    font-size: 0.85rem;
  }

  :root {
    --marker-width: 3em;
    --marker-hover-scale: 1.3;
    --font-size-normal: 0.85rem;
    --font-size-title: 1rem;
  }

  .map-marker {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  #sidebar {
    padding: var(--spacing-medium);
  }

  .event-item {
    padding: var(--spacing-small);
  }

  .event-details {
    padding: var(--spacing-medium);
  }

  .event-title-detail {
    font-size: 0.9rem;
  }

  .event-address {
    font-size: 0.8rem;
  }

  .event-time {
    font-size: var(--font-size-standard-mobile);
    font-family: var(--font-primary);
    font-weight:normal;
    margin: 0.2rem 0;
  }

  .event-artists {
    font-size: 0.85rem;
  }

  :root {
    --marker-width: 2.5em;
    --spacing-small: 0.15rem;
    --spacing-medium: 0.4rem;
    --spacing-large: 0.8rem;
  }

  .map-marker {
    font-size: 1rem;
  }

  #show-all {
    margin-bottom: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

}

/* Improve touch interactions */
@media (pointer: coarse) {
  .event-item {
    min-height: 44px; /* Minimum touch target size */
  }
  
  .show-more-btn {
    min-height: 44px;
    padding: 0.6rem 1.2rem;
  }
}
