* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    background: #f5f5f5;
}

/* Layout */
.container {
    display: flex;
    height: 100vh;
}

#map {
    flex: 1;
    height: 100vh;
}

.sidebar {
    width: 600px;
    background: white;
    overflow-y: auto;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

/* Header */
.header {
    padding: 20px;
    background: white;
    color: black;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.header-subtitle-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.header-subtitle-section h5 {
    margin: 0;
    flex: 1;
}

/* Newsletter link */
.newsletter-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.newsletter-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 15px;
    position: sticky;
    top: 60px;
    z-index: 21;
    background: white;
    padding-bottom: 10px;
    margin-bottom: 0;
    overflow-x: auto;
}

.filter-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 0px;
    background: #f0f0f0;
    color: #333333;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    transform: translateY(0);
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.filter-btn:active::before {
    width: 300px;
    height: 300px;
}

.filter-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.filter-btn:active {
    background: rgba(255,255,255,0.4);
    transform: translateY(0);
    transition: all 0.1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.filter-btn.active {
    background: #94F235;
    color: black;
    transform: translateY(-1px);
    /*font-weight: 600;*/
    /*box-shadow: 0 2px 8px rgba(0,0,0,0.15);*/
}


.filter-btn.active:active {
    background: rgba(255,255,255,0.95);
    transform: translateY(0);
}

/* Focus state for accessibility */
.filter-btn:focus {
    outline: none;
    box-shadow: none;
}

.filter-btn.active:focus {
    box-shadow: none;
}

/* Events list */
.events-list {
    padding: 20px;
    padding-top: 0px; /* Reduced top padding to bring events closer to Map View button */
}

/* Event card layout */
.event-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.event-card:hover::before {
    opacity: 0.25;
}

.event-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.event-name {
    font-weight: 600;
    font-size: 25px;
    color: #333;
    flex: 1;
    margin-right: 12px;
    position: relative;
    z-index: 1;
    font-family: 'Roboto' sans-serif;
    font-weight: bold;
}

.event-price {
    font-weight: 600;
    font-size: 20px;
    color: #333;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.event-venue {
    color: #666;
    font-size: 20px;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.event-datetime {
    color: #ff6b6b;
    font-size: 20px;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

/* Remove old event-details class */

/* Tags */
.event-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: #f0f0f0;
    color: #666;
    margin-right: 6px; /* Add horizontal spacing between tags */
    margin-bottom: 4px; /* Add vertical spacing for wrapping tags */
    display: inline-block;
}

/* Removed individual tag colors - all tags now use the default grey */

/* Map markers */
.marker {
    background-color: #ddf23e;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.marker-cluster {
    background-color: #94f235;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-count {
    color: black;
    font-weight: bold;
    font-size: 12px;
}

/* Popup styling */
.popup-single {
    min-width: 200px;
}

.popup-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 8px;
    font-size: 12px;
}

.popup-btn:hover {
    background: #ff5252;
}

.popup-cluster {
    min-width: 250px;
    max-width: 300px;
}

.popup-events {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 8px;
}

.popup-event {
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.popup-event:hover {
    background-color: #f5f5f5;
}

.popup-event:last-child {
    border-bottom: none;
}

.popup-event-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.popup-event-time {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
}

.popup-event-price {
    font-size: 12px;
    color: #333;
    font-weight: 500;
}

/* Event detail view */
.event-detail {
    height: 100vh;
    overflow-y: auto;
    background: white;
}

.event-detail-header {
    display: none;
}

.back-btn {
    display: none;
}

.event-detail-title-section {
    padding: 16px 20px 0 20px;
    text-align: left;
}

.event-detail-title {
    font-size: 28px;
    font-weight: bold;
    color: #222;
    margin: 0 0 8px 0;
    line-height: 1.2;
    font-family: 'Roboto' sans-serif;
    font-weight: bold;
}

.event-detail-image-container {
    position: relative;
    margin: 0;
    max-width: 100%;
    width: 100%;
}

.event-detail-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.event-detail-type-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ddf23e;
    color: black;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.event-detail-content {
    padding: 20px;
}

.event-detail-info {
    margin-bottom: 20px;
}

.event-detail-type {
    background: #f0f0f0;
    color: #666;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: capitalize;
    display: inline-block;
    margin-bottom: 8px;
}

.event-detail-datetime {
    font-size: 18px;
    color: #333;
    font-weight: 300;
    margin: 12px 0 14px 0;
}

.event-detail-venue {
    font-size: 18px;
    color: #666;
    margin-bottom: 8px;
}

.event-detail-price {
    font-size: 18px;
    color: #333;
    font-weight: 300;
    margin-top: 6px;
    margin-bottom: 8px;
}

.event-detail-venue-section {
    margin-bottom: 14px;
}

.event-detail-venue {
    font-size: 18px;
    
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.event-detail-address {
    font-size: 14px;
    color: #666;
}

.venue-link {
    color: #f23a29;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    font-weight: 300;
}

.venue-link:hover {
    color: #ff5252;
    text-decoration: underline;
}

.event-detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 0px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    flex: 1;
    min-width: 100px;
}

.ticket-btn {
    background: black;
    color: white;
}

.ticket-btn:hover {
    background: #333;
}

.website-btn {
    background: #94f235;
    color: black;
}

.website-btn:hover {
    background: #26a69a;
}

.directions-btn {
    background: #f0f0f0;
    color: #333;
}

.directions-btn:hover {
    background: #e0e0e0;
}

.event-detail-tags {
    margin-bottom: 20px;
}

.event-detail-tags .tag {
    margin-right: 6px;
    margin-bottom: 6px;
    display: inline-block;
}

.event-detail-genres {
    margin-top: 12px;
    margin-bottom: 8px;
}

.event-detail-genres h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tag.genre {
    background: #e3f2fd;
    color: #1976d2;
}

.tag.age {
    background: #fff3e0;
    color: #f57c00;
}

.event-detail-description {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.event-detail-description h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.event-detail-description p {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
}

/* Mapbox Popup Customization */
.mapboxgl-popup-content {
    min-width: 320px !important;  /* wider popup */
    max-width: 400px !important;
    padding: 18px 18px 12px 18px !important;
    border-radius: 12px !important;
    font-family: inherit;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.popup-cluster h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.popup-cluster p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.popup-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-event {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid #ececec;
}

.popup-event:hover {
    background: #e0f7fa;
}

.popup-event-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    color: #222;
}

.popup-event-time,
.popup-event-price {
    font-size: 13px;
    color: #888;
    margin-bottom: 0;
}

/* Mobile view toggle */
.mobile-view-toggle {
    margin: 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 40px;
    border: none;
    border-radius: 0px;
    background: #f0f0f0;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
}

.view-toggle-btn:hover {
    background: #e0e0e0;
}

.view-toggle-btn:active {
    background: #d0d0d0;
}

.toggle-icon {
    font-size: 14px;
}

.toggle-text {
    font-weight: 500;
    font-size: 13px;
}

/* Mobile map back button */
.mobile-map-back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    min-height: 44px; /* Better touch target */
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-map-back-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.mobile-map-back-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    #map {
        display: none; /* Hide map on mobile by default */
    }
    
    .sidebar {
        width: 100%;
        height: 100vh;
        order: 1;
        box-shadow: none;
    }
    
    /* Event detail takes full screen on mobile */
    .event-detail {
        position: static;
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }
    
    /* Smooth scrolling for events list */
    .events-list {
        overflow-y: auto;
        scroll-behavior: smooth;
    }
    
    /* Mobile-specific filter adjustments */
    .filters {
        gap: 8px;
        padding-bottom: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        padding: 7px 16px;
        font-size: 13px;
        border-radius: 0px;
        min-height: 32px;
        flex: 0 0 auto;
    }
    
    /* Mobile-specific event card adjustments */
    .event-name {
        font-size: 20px;
    }
    
    .event-venue,
    .event-datetime {
        font-size: 16px;
    }
    
    .event-price-top {
        font-weight: 100;
        font-size: 14px;
        color: #333;
        margin-left: 160px;
        white-space: nowrap;
    }
    
    .header h1 {
        display: none;
    }
    
    .header-subtitle-section {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    

    
    .card-media-body-supporting-bottom-reveal {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 8px;
        max-width: 100%;
    }
    .tag {
        font-size: 11px;
        padding: 3px 6px;
        margin-right: 0px;
        margin-bottom: 0px;
        display: inline-block;
        /* Let tags wrap fully so none are cut off */
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        flex-shrink: 1;
    }
    
    .event-card.card-media {
        height: auto; /* Allow height to grow */
        min-height: 140px; /* Minimum height */
        max-height: none; /* Remove cap so tags/title don't get cut */
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .sidebar {
        display: block !important;
    }
    
    #map {
        display: block !important;
    }
}

.event-detail-title,
.event-name {
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
}

.header h1,
.header h5 {
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
}

.event-card.card-media {
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    min-height: 125px;
    margin-bottom: 25px;
    transition: box-shadow 300ms;
    width: 100%;
    display: flex;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
}

.card-media-object-container {
    width: 35%;
    position: relative;
    height: auto; /* allow container to stretch with content */
    align-self: stretch; /* ensure image column matches card height */
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    display: block;
}

.card-media-object {
    background-position: center center;
    background-size: cover;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    display: block;
}

.card-media-object-tag {
    background: #fff;
    border-radius: 2px;
    padding: 2px 7px;
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 12px;
    color: #888;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
}

.card-media-body {
    background: #fff;
    width: 65%;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Roboto', sans-serif;
    margin:0;
}

.card-media-body-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 8px 0 4px 0;
    color: #222;
    display: block;
    font-family: 'Roboto', sans-serif;
}

.card-media-body-supporting-bottom {
    font-size: 0.95em;
    color: #888;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    font-family: 'Roboto', sans-serif;
}

.subtle {
    color: #888;
    font-size: 12px;
    font-family: 'Roboto', sans-serif;
}

.u-float-right {
    margin-left: auto;
}

.card-media-body-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.event-price-top {
    margin-left: 12px;
    white-space: nowrap;
}

.card-media-body-supporting-bottom-reveal {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap; /* Allow tags to wrap */
    gap: 4px;

}

.back-btn-sharp {
    background: none;
    border: none;
    color: #222;
    font-size: 22px;
    font-family: 'Roboto', sans-serif;
    padding: 12px 20px 0 20px;
    cursor: pointer;
    margin-bottom: 0;
    display: block;
    text-align: left;
    font-weight: 500;
    transition: color 0.2s;
}

.back-btn-sharp:hover {
    color: #154df2;
    text-decoration: underline;
}

.event-detail-map-preview {
    width: 100%;
    margin-top: 24px;
    display: flex;
    justify-content: center;
}
.event-detail-map-preview iframe {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    min-height: 200px;
    border: none;
}

/* Tag filter dropdown */
.tag-filter-dropdown-container {
    position: relative;
}

.tag-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 8px;
}

.tag-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f8f8;
    border-radius: 12px 12px 0 0;
}

.tag-filter-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.close-tag-filter {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-tag-filter:hover {
    background: #e0e0e0;
}

.tag-filter-content {
    padding: 16px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.tag-filter-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
    margin: 2px 0;
}

.tag-filter-option:hover {
    background: #f5f5f5;
}

.tag-filter-option input[type="checkbox"] {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

.tag-filter-option label {
    cursor: pointer;
    font-size: 14px;
    color: #333;
    flex: 1;
    user-select: none;
}

.tag-filter-actions {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f8f8;
    border-radius: 0 0 12px 12px;
}

.clear-tags-btn,
.apply-tags-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.clear-tags-btn {
    background: #f0f0f0;
    color: #666;
}

.clear-tags-btn:hover {
    background: #e0e0e0;
}

.apply-tags-btn {
    background: #667eea;
    color: white;
}

.apply-tags-btn:hover {
    background: #5a6fd8;
}

/* Tags filter button styling */
.tags-filter-btn {
    position: relative;
}

.tags-filter-btn.active {
    background: #667eea;
    color: white;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .tag-filter-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        max-height: 80vh;
        margin-top: 0;
    }
    
    .tag-filter-content {
        max-height: 50vh;
    }
    
    .tag-filter-actions {
        flex-direction: column;
    }
    
    .clear-tags-btn,
    .apply-tags-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .card-media-body-supporting-bottom-reveal .card-media-body-supporting-bottom-text {
      display: flex;
      flex-wrap: wrap;
      gap: 8px; /* increase as needed */
    }
  }
