/* ====================================================
   1. GENERAL STYLES
      - Variables
      - Body / HTML
      - Basic Element Styling (buttons, links)
      - Touch Targets
====================================================== */
:root {
    --primary-color: #0da7a4; /* Default Teal */
    --secondary-color: #6c757d; /* Default Grey */
    --primary-hover-color: #0a8f8c; /* Darker Teal */
    --secondary-hover-color: #5a6268; /* Darker Grey */
    --light-bg-color: #f8f9fa;
    --text-color: #333;
    --light-text-color: #666;
    --border-color: #ccc;
    --touch-target-size: 44px;
    /* Liked state colors */
    --liked-bg-color: #ffeeee;
    --liked-text-color: red;
    --liked-border-color: #ffcccc;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
    /* If you prefer full-screen height, keep this:
       height: 100vh;
       Otherwise remove it to allow page scrolling if content exceeds screen height.
    */
}

/* Touch-friendly buttons and controls */
button, .icon, input[type="radio"], select {
    min-height: var(--touch-target-size);
    min-width: var(--touch-target-size);
    padding: 8px 16px;
    margin: 4px;
    touch-action: manipulation;
}

/* Prevent text selection on buttons */
button {
    user-select: none;
    -webkit-user-select: none;
}

/* Smooth transitions for interactive elements */
button, .icon, input, select {
    transition: all 0.2s ease;
}

button:active, .icon:active {
    transform: scale(0.95);
}

/* Hover/Focus Styles */
/* Apply primary hover generally, specific buttons override */
button:hover, button:focus {
    background-color: var(--primary-hover-color);
    outline: none;
}

/* Override general button styles for show-liked-button */
.show-liked-button:hover, .show-liked-button:focus {
    background-color: transparent !important;
    outline: none;
}
a:hover {
    text-decoration: underline;
    color: var(--primary-hover-color); /* Use hover color for links too */
}

/* ====================================================
   2. LAYOUT
      - Header (Positioning)
      - Main Content Area
      - Footer
====================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--primary-color); /* Use variable */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
}

/* Adjust main content to account for fixed header */
main {
    margin-top: 48px; /* Should match header height or slightly less */
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 48px); /* Adjust based on header height */
}

footer {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background-color: var(--primary-color); /* Use primary color */
    color: white;
}

/* Mobile Layout Adjustments */
@media (max-width: 768px) {
    main {
        height: calc(100vh - 48px);
        overflow: hidden;
    }
}

@media (max-width: 600px) {
    footer {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    header {
        padding: 0;
        height: 56px; /* Slightly taller for better touch targets */
    }
}

/* ====================================================
   3. HEADER / TOP BAR STYLES
      - Title
      - Icon Groups & Buttons
====================================================== */

/* App Title */
.app-title {
    display: flex;
    align-items: center;
}

.app-title h1 {
    color: white;
    font-size: 20px;
    margin: 0;
    font-weight: 500;
}

/* Icon Groups */
.icon-group {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    height: 100%;
}

.icon-group.left {
    padding-left: 16px;
}

.icon-group.right {
    padding-right: 16px;
}

/* Icon Buttons (General) */
.icon-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon-button:active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Navigation Icons (SVG) */
.nav-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.menu-icon {
    stroke: currentColor; /* Menu icon uses strokes */
}

.settings-icon {
    fill: currentColor; /* Settings icon uses fill */
}

/* Remove old header styles */
.header-left,
.header-center,
.header-right,
.top-menu-icons,
.action-icons {
    display: none;
}

/* Mobile Header Adjustments */
@media (max-width: 768px) {
    .icon-button {
        min-width: 40px;
        min-height: 40px;
    }
    .nav-icon {
        width: 28px;
        height: 28px;
    }
}
@media (max-width: 600px) {
    .icon-group {
        gap: 8px;
    }
}

/* ====================================================
   4. FILTER CONTROLS
      - Container
      - Rows
      - Search
      - Category Filter
      - Radius Slider
      - Sort Options
      - Show Liked Button
====================================================== */

/* Filter Controls Section Container */
.filter-controls {
    background-color: var(--light-bg-color); /* Use variable */
    padding: 15px;
    border-radius: 8px;
    margin: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Filter Layout Rows */
.filter-top-row { /* Keep top row wrapping */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-bottom-row { /* Make bottom row less likely to wrap */
    display: flex;
    justify-content: space-between; /* Distribute space */
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: nowrap; /* Try to keep items on one line */
    gap: 20px; /* Increase gap slightly */
}

.filter-top-row > * { /* Allow top row items to grow */
    flex: 1;
}

/* Search Input & Button */
.search-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    border: 1px solid var(--border-color); /* Use variable */
    border-radius: 4px;
    padding: 5px;
    margin: 0;
    flex: 2; /* Allow search to take more space in top row */
}

#search {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 5px;
    margin: 0; /* Override general input margin */
    min-height: auto; /* Override general input min-height */
    min-width: auto; /* Override general input min-width */
}

#searchButton {
    background-color: var(--primary-color); /* Use variable */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
    margin: 0; /* Override general button margin */
    min-height: auto; /* Override general button min-height */
    min-width: auto; /* Override general button min-width */
}

#searchButton:hover {
    background-color: var(--secondary-color); /* Use secondary color for hover */
}

#searchButton:active {
    background-color: var(--primary-color); /* Use primary color when pressed instead of default green */
}

/* Category Filter */
.category-filter {
    position: relative;
    margin: 0;
    flex: 1; /* Allow category filter to take space in top row */
}

.category-toggle {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color); /* Use variable */
    color: white;
    border: 1px solid var(--primary-color); /* Use variable */
    border-radius: 4px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease; /* Add transition */
    margin: 0; /* Override general button margin */
    min-height: auto; /* Override general button min-height */
}

.category-toggle:hover,
.category-toggle:focus {
    background-color: var(--secondary-color); /* Use secondary color for hover */
    border-color: var(--secondary-color); /* Use secondary color for hover */
    outline: none;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.category-dropdown {
    position: absolute;
    width: 100%;
    z-index: 1001;
    background: white;
    border: 1px solid var(--primary-color); /* Use variable */
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(13, 167, 164, 0.2); /* Keep specific shadow or use variable */
}

#categoryMultiSelect {
    width: 100%;
    padding: 10px;
    border: none; /* Explicitly remove default browser border */
    border-radius: 4px; /* Keep radius if desired, or remove */
    background-color: white;
    font-size: 14px;
    color: var(--text-color); /* Use variable */
    display: block; /* Ensure it behaves as a block element */
    box-sizing: border-box; /* Include padding in width calculation */
    margin: 0; /* Override general select margin */
    min-height: auto; /* Override general select min-height */
}

#categoryMultiSelect option {
    padding: 8px;
    margin: 2px 0;
    background-color: white;
    color: var(--text-color); /* Use variable */
}

#categoryMultiSelect option:checked {
    background-color: var(--primary-color); /* Use variable */
    color: white;
}

#categoryMultiSelect option:hover {
    background-color: rgba(13, 167, 164, 0.1); /* Keep specific hover or use variable */
}

#categoryMultiSelect option[value="all"] {
    font-weight: bold;
    border-bottom: 1px solid var(--primary-color); /* Use variable */
    margin-bottom: 5px;
}

.multi-select-info {
    font-size: 12px;
    color: var(--light-text-color); /* Use variable */
    margin: 5px 0 0 5px;
    padding: 0;
}

/* Radius Slider */
.radius-control {
    font-size: 14px; /* Slightly smaller font for compactness */
    display: flex; /* Align label and slider */
    align-items: center;
    gap: 5px;
    flex: 2; /* Give slider more space */
    min-width: 150px; /* Prevent it getting too small */
    margin: 0; /* Remove default margin */
}
.radius-control label {
    white-space: nowrap; /* Prevent label text wrapping */
}

#radiusSlider {
    flex-grow: 1; /* Allow slider to take remaining space in its container */
    padding: 10px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid var(--border-color); /* Use variable */
    margin: 0; /* Override general input margin */
    min-height: auto; /* Override general input min-height */
}

/* Sort Options */
.sort-options {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    flex: 1; /* Allow sort options to take space */
    justify-content: center; /* Center sort options */
    min-width: 180px; /* Ensure space for options */
}

.sort-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.sort-option input { /* Hide default radio inputs */
    display: none;
}

.sort-option svg {
    width: 28px; /* Ensure width is set */
    height: 28px; /* Ensure height is set */
    fill: var(--secondary-color); /* Use variable */
    transition: fill 0.3s ease;
    flex-shrink: 0; /* Prevent shrinking */
}

.sort-option input:checked + svg { /* Change color when selected */
    fill: var(--primary-color); /* Use variable */
}

.sort-option:active svg {
    fill: var(--primary-color); /* Use primary color when clicked */
}

/* Show Liked Button - Now as part of sort options */
.show-liked-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent !important; /* Force background to be transparent */
    border: none;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 5px;
    min-height: auto; /* Override general button min-height */
    min-width: auto; /* Override general button min-width */
}

.show-liked-button:hover {
    background-color: transparent !important; /* Force background to be transparent */
}

.show-liked-button:active {
    background-color: transparent !important; /* Force background to be transparent */
}

.heart-icon {
    transition: fill 0.3s ease, stroke 0.3s ease;
    width: 28px; /* Match size with other sort icons */
    height: 28px;
    background-color: transparent !important; /* Force background to be transparent */
}

.heart-icon.unliked {
    fill: var(--secondary-color); /* Match other sort icons */
    stroke: none;
    background-color: transparent !important; /* Force background to be transparent */
}

.heart-icon.liked {
    fill: var(--primary-color); /* Use primary color to match theme */
    stroke: none;
    background-color: transparent !important; /* Force background to be transparent */
}

/* Settings Panel Styles */
#settingsPanel {
    position: fixed;
    top: 60px;
    left: 10%;
    width: 80%;
    max-height: 80vh;
    overflow-y: auto;
    background-color: white;
    z-index: 1001;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
}
.settings-panel.hidden {
    display: none;
}

/* Mobile Filter Layout Adjustments */
@media (max-width: 768px) { /* Apply stacking earlier */
     .filter-top-row, .filter-bottom-row {
        flex-direction: column; /* Stack items vertically */
        align-items: stretch; /* Make items full width */
        gap: 10px; /* Reduce gap when stacked */
    }

    .filter-bottom-row .radius-control {
        order: 1; /* Put radius first */
    }
     .filter-bottom-row .sort-options {
         order: 2; /* Sort second */
         justify-content: flex-start; /* Align left when stacked */
     }
 
     .search-container {
         width: 100%;
         margin-bottom: 10px;
     }
 
     .category-filter {
         width: 100%;
     }
}

/* ====================================================
   5. EVENT LIST STYLES
      - Container
      - Header
      - Items
      - Toggle Button
      - Action Buttons
====================================================== */

/* Event List Container */
#eventList {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: white;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

#eventList.open {
    transform: translateY(0);
}

/* By default, hide the event list on mobile */
@media (max-width: 768px) {
    #eventList {
        display: none;
    }
    #eventList.open {
        display: block;
    }
}

/* Event List Header (inside the panel) */
.event-header {
    position: sticky; /* stays visible while scrolling */
    top: 0;
    background: white;
    z-index: 10;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color); /* Use variable */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.event-header-controls {
    display: flex;
    align-items: center;
}

.event-header h2 {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color); /* Use variable */
    margin: 0;
}
.category-icon-img {
    vertical-align: middle;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    max-width: 100%;
    object-fit: contain;
}
.action-icon {
    width: 24px;
    height: 24px;
}
.event-header #recordCount {
    font-size: 1rem;
    color: var(--primary-color); /* Use variable */
    margin: 0;
    font-weight: bold;
}

/* Event List Items Container */
#events {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Individual Event Item */
#events li {
    width: 90%;
    margin: 15px auto;
    padding: 20px;
    background: white; /* Use white or light-bg-color? */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Softer shadow */
    border: 1px solid var(--border-color); /* Use variable */
    text-align: left;
    position: relative;
    overflow: hidden;
}

#events li h3 {
    font-size: 1.5rem;
    color: var(--text-color); /* Use variable */
    margin-bottom: 10px;
}

#events li p {
    margin: 5px 0;
    color: var(--light-text-color); /* Use variable */
}

#events li a { /* Links within event items */
    color: var(--primary-color); /* Use variable */
    text-decoration: none;
    font-weight: bold;
}
#events li a:hover {
    text-decoration: underline;
}

/* Event Actions Container */
.event-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    justify-content: flex-start;
}

/* Action Button Styles (General - within list/info window) */
.action-button {
    padding: 6px;
    margin: 0;
    border: none;
    background-color: transparent !important; /* Force transparency */
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/* Remove hover and active background effects */
.action-button:hover,
.action-button:active,
.action-button:focus {
    background-color: transparent !important;
    color: var(--primary-color);
    border-color: transparent;
    outline: none;
}

/* Event List Toggle Button - Restored */
.event-list-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    background-color: var(--primary-color) !important;
    border: none;
    color: white;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    margin: 0;
}

.event-list-toggle:hover {
    background-color: var(--secondary-color) !important; /* Use secondary color for hover */
    transform: scale(1.1);
}

.event-list-toggle:active {
    background-color: var(--primary-color) !important;
    transform: scale(0.95);
}

.event-list-toggle .toggle-icon {
    display: inline-block;
    line-height: 1;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

/* Standardized Icon Styles */
.action-icon,
.website-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    /* Default state - use primary color */
    color: var(--primary-color);
    fill: var(--primary-color);
    transition: color 0.2s ease, fill 0.2s ease;
}

/* Icon hover and active states */
.action-button:hover .action-icon,
.action-button:hover .website-icon {
    /* Keep primary color on hover */
    color: var(--primary-color);
    fill: var(--primary-color);
}

/* Like Button Specific Styles */
.like-button {
    transition: all 0.2s ease;
}

.like-button.liked .action-icon {
    /* Red color for liked state */
    color: red;
    fill: red;
}

.like-button.unliked .action-icon {
    /* Use primary color for unliked state */
    color: var(--primary-color);
    fill: var(--primary-color);
}

.like-button.liked:hover .action-icon {
    /* Darker red on hover when liked */
    color: darkred;
    fill: darkred;
}

/* Category icon can remain slightly larger */
.category-icon-img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
    object-fit: contain;
}

/* Info window specific overrides */
.info-window-content .action-button {
    width: 32px;
    height: 32px;
    padding: 6px;
    margin: 0;
    background-color: transparent;
    border: none;
}

.info-window-content .action-icon {
    width: 20px;
    height: 20px;
}

/* Event actions container spacing */
.event-actions {
    display: flex;
    gap: 12px;
    margin-top: 15px;
    justify-content: flex-start;
}

.info-window-content .event-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    margin: 0;
    padding: 8px;
    justify-content: center;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments - keep sizes consistent */
@media (max-width: 768px) {
    .action-button,
    .info-window-content .action-button {
        width: 32px;
        height: 32px;
        padding: 6px;
    }

    .action-icon,
    .website-icon,
    .info-window-content .action-icon {
        width: 20px;
        height: 20px;
    }
    
    .event-actions {
        gap: 16px; /* Slightly larger gap for touch targets */
    }
}

/* ====================================================
   6. MAP & INFOWINDOW STYLES
====================================================== */

#map {
    flex: 1;
    width: 100%;
    min-height: 60vh;
    max-height: 70vh;
    position: relative;
    z-index: 1;
    background-color: var(--light-bg-color); /* Use variable */
}

/* Info window styles */
.gm-style-iw.gm-style-iw-c {
    padding: 0 !important;
    max-width: 300px !important;
}

.gm-style-iw-d {
    overflow-y: auto !important;
    scrollbar-width: none !important;
    max-height: none !important;
    margin-top: 0 !important;
}

.gm-style-iw-d::-webkit-scrollbar {
    display: none !important;
}

/* Info window header styling */
.info-window-header {
    position: sticky !important;
    top: 0 !important;
    background: white !important;
    z-index: 2 !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 32px !important; /* Reduced from 40px */
    display: flex !important;
    align-items: center !important;
    border-bottom: 1px solid #eee !important;
}

.info-window-header h3 {
    margin: 0 !important;
    padding: 4px 32px 4px 12px !important; /* Reduced padding */
    font-size: 16px !important;
    line-height: 24px !important;
    color: #333 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
}

/* Close button positioning */
.gm-ui-hover-effect {
    top: 0 !important;
    right: 0 !important;
    width: 32px !important; /* Reduced from 40px */
    height: 32px !important; /* Reduced from 40px */
    padding: 6px !important; /* Reduced from 8px */
    margin: 0 !important;
    opacity: 0.7 !important;
}

.gm-ui-hover-effect:hover {
    opacity: 1 !important;
}

.info-window-body {
    padding: 12px !important; /* Reduced from 15px */
    padding-top: 8px !important; /* Reduced from 10px */
}

.info-window-content {
    padding: 0 !important;
    margin-bottom: 60px !important; /* Space for fixed buttons */
}

/* Container for action buttons */
.info-window-content .event-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    margin: 0;
    padding: 8px;
    justify-content: center;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .info-window-body {
        padding: 12px !important;
    }
    
    .info-window-content .event-actions {
        padding: 12px 8px;
    }
}

/* Ensure the content below the header starts properly */
.info-window-content > p:first-of-type {
    margin-top: 0;
}

@media (max-width: 600px) {
    #map {
        min-height: 50vh;
    }
}

/* ====================================================
   7. SETTINGS PANEL STYLES
====================================================== */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--light-bg-color); /* Use variable */
    z-index: 2000;
    padding: 0; /* Remove padding, apply to inner container */
    box-sizing: border-box;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    color: var(--text-color); /* Use variable */
}

.settings-panel.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color); /* Match main header */
    color: white; /* White text */
    padding: 10px 20px; /* Add padding */
    margin-bottom: 25px; /* Keep bottom margin */
}

.settings-header h2 {
    margin: 0;
    font-size: 20px; /* Match main header */
    color: white; /* White text */
    font-weight: 500;
}

.close-button {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: white; /* White close button */
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    opacity: 0.7;
    min-width: auto; /* Override general button min-width */
    min-height: auto; /* Override general button min-height */
}

.close-button:hover {
    color: white; /* Keep white on hover */
    opacity: 1;
    background-color: transparent;
}

.settings-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px 20px 20px; /* Add padding that was removed from panel */
}

.setting-item {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color); /* Use variable */
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    display: block; /* Revert for non-color labels */
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 16px;
}

/* Specific label style for color inputs to allow revert button */
.setting-item label[for="primaryColor"],
.setting-item label[for="secondaryColor"] {
    display: flex; /* Align label text and button */
    align-items: center;
    justify-content: space-between; /* Push button to the right */
}

.setting-item input[type="text"],
.setting-item input[type="number"],
.setting-item input[type="color"], /* Add color input */
.setting-item select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color); /* Use variable */
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
    min-height: 40px; /* Ensure decent height for color input */
    margin: 0; /* Override general input margin */
}

.setting-item input[type="radio"] {
    margin-right: 5px;
}

.setting-item .radio-group label {
    display: inline-block;
    margin-right: 15px;
    font-weight: normal;
}

.setting-item p.description {
    font-size: 13px;
    color: var(--light-text-color);
    margin-top: 5px;
    margin-bottom: 0;
}

/* Style for revert buttons next to labels */
.revert-button {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 18px; /* Adjust size */
    padding: 0 5px;
    margin-left: 10px; /* Space from label text */
    opacity: 0.6;
    transition: opacity 0.2s;
    min-width: auto; /* Override default button min-width */
    min-height: auto; /* Override default button min-height */
}

.revert-button:hover {
    opacity: 1;
    background-color: transparent; /* Override general button hover */
}

.settings-content button { /* General buttons within settings */
    background-color: var(--primary-color); /* Use variable */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s;
    margin: 0; /* Override general button margin */
}

.settings-content button:hover {
    background-color: var(--primary-hover-color); /* Use hover variable */
}

/* Specific button styles if needed */
#clearLikedButton {
    background-color: var(--secondary-color); /* Use variable */
    border-color: var(--secondary-color); /* Use variable */
}

#clearLikedButton:hover {
    background-color: var(--secondary-hover-color); /* Use hover variable */
    border-color: var(--secondary-hover-color); /* Use hover variable */
}

/* ====================================================
   8. MOBILE MENU STYLES
====================================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--primary-color);
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    padding: 56px 0 20px; /* Add top padding to account for header */
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s, color 0.2s;
}

.mobile-menu a:not(.inactive):hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu a.inactive {
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    opacity: 0.7;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Mobile Nav Toggle (if different from event list toggle) */
.mobile-nav-toggle { /* Example if using a separate button */
    display: block;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* Action Icon Styles */
.action-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    /* Use primary color */
    color: var(--primary-color);
    fill: var(--primary-color);
    transition: color 0.2s ease, fill 0.2s ease;
}

.website-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    /* Use primary color */
    color: var(--primary-color);
    fill: var(--primary-color);
    transition: color 0.2s ease, fill 0.2s ease;
}

/* ====================================================
   9. UTILITY CLASSES
====================================================== */
/* (Currently none defined, add .hidden, .visible if needed elsewhere) */

/* ====================================================
   10. LOADING SPINNER
====================================================== */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    pointer-events: none; /* Allow clicks to pass through to the map */
}

.loading-spinner.visible {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color); /* Use variable */
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: auto;
}

.loading-spinner::after {
    content: "Loading...";
    margin-top: 8px;
    color: var(--primary-color); /* Use variable */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====================================================
   11. ERROR MESSAGE
====================================================== */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff4444;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 2000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ====================================================
   12. MISC / OTHER
====================================================== */
/* Reset Settings Button Styling */
#resetSettingsButton {
    display: block;
    margin: 10px auto;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
}
#resetSettingsButton:hover {
    background-color: var(--primary-hover-color);
}

/* Reset Settings Button Styling */
#resetSettingsButton {
    display: block;
    margin: 10px auto;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: 2px solid red;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
}
#resetSettingsButton:hover {
    background-color: var(--primary-hover-color);
}

/* Install button */
.install-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* Standardized Icon Styles */
.category-icon-img,
.action-icon,
.website-icon,
.info-window-content .action-icon {
    width: 24px;
    height: 24px;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

/* Apply primary color to action and website icons */
.action-icon,
.website-icon,
.info-window-content .action-icon {
    color: var(--primary-color);
    fill: var(--primary-color);
    transition: color 0.2s ease, fill 0.2s ease;
}

.category-icon-img {
    margin-right: 8px; /* Keep the spacing for category icons */
}

/* Mobile adjustments for icons */
@media (max-width: 768px) {
    .category-icon-img,
    .action-icon,
    .website-icon,
    .info-window-content .action-icon {
        width: 24px; /* Keep consistent size even on mobile */
        height: 24px;
    }
}