:root {
    --bg-color: #fff;
    --text-color: #333;
    --header-bg: #f4f4f4;
    --link-color: #007bff;
    --overlay-bg: rgba(255, 255, 255, 0.95);
}

body.dark-mode {
    --bg-color: #212121;
    --text-color: #fff;
    --header-bg: #212121;
    --link-color: #66ccff;
    --overlay-bg: rgba(30, 30, 30, 0.98);
}

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

html,
body {
    height: 100%;
    font-family: 'Arial', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--header-bg);
    height: 60px;
}

h1 {
    font-size: 24px;
}

/* Container for button + link */
header>div {
    display: flex;
    align-items: center;
    gap: 20px;
}

.link {
    font-size: 14px;
    text-decoration: none;
    color: var(--link-color);
    margin-left: 10px;
}

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

#map {
    height: calc(100vh - 60px);
    width: 100%;
}

#event-list {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    padding: 20px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    backdrop-filter: blur(4px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease-in-out;
}

#event-list-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 20px;
    margin: 12px 0;
    color: var(--text-color);
}

summary:hover {
    color: var(--link-color);
}

ul {
    list-style: none;
    padding: 0;
}

li {
    background-color: var(--bg-color);
    border-radius: 6px;
    margin-bottom: 12px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

li:hover {
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

strong {
    color: var(--link-color);
    font-size: 16px;
}

em {
    font-style: italic;
    font-size: 14px;
    color: var(--text-color);
}

#toggleList,
#sortToggle {
    padding: 6px 12px;
    font-size: 14px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
}

#toggleList:hover,
#sortToggle:hover {
    background-color: #0056b3;
}

/* Repeat section styles */
.repeat-section {
    background-color: #fff3f3;
    border: 2px solid #ff9999;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

body.dark-mode .repeat-section {
    background-color: #3a1f1f;
    border-color: #ff6666;
}

.repeat-section summary {
    color: #cc0000;
    font-weight: bold;
}

body.dark-mode .repeat-section summary {
    color: #ff9999;
}

/* Leaflet popup font size */
.leaflet-popup-content {
    font-size: 14px;
}

/* Mobile-specific improvements */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        gap: 10px;
        height: auto;
    }

    h1 {
        font-size: 18px;
    }

    header>div {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    #toggleList,
    #sortToggle {
        font-size: 16px;
        padding: 12px;
        width: 100%;
        text-align: center;
        margin-left: 0;
    }

    .link {
        font-size: 16px;
        width: 100%;
        text-align: center;
        margin-left: 0;
    }

    #event-list {
        padding: 10px;
        top: 120px;
    }

    #event-list-wrapper {
        padding: 0 8px;
        margin: 0;
    }

    summary {
        font-size: 16px;
    }

    li {
        font-size: 14px;
        padding: 10px;
        margin-bottom: 8px;
    }

    strong {
        font-size: 14px;
    }

    em {
        font-size: 12px;
    }

    .leaflet-popup-content {
        font-size: 13px;
    }

    .repeat-section {
        margin-top: 20px;
    }
}