body {
    font-family: Arial, sans-serif;
    background-color: #000000;
    color: #ffffff;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

nav {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: #FFC700;
    color: #000000;
    z-index: 1000;
}

nav .menu {
    display: flex;
    align-items: center;
}

nav .menu ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0.2rem;
    padding: 0;
}

nav .menu ul li {
    /* Neu: Einheitliches Flex, damit alle Buttons & Forms vertikal mittig! */
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
}

nav .menu ul li form {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar-button,
.navbar-button:link,
.navbar-button:visited,
.navbar-button:hover,
.navbar-button:active {
    text-decoration: none;
    display: flex;
    align-items: center;         /* vertikal Mitte! */
    justify-content: center;
    background: #FFC700;
    color: #181818;
    border: none;
    border-radius: 25px;
    padding: 10px 28px;
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow: 0 3px 12px 1px rgba(0,0,0,0.09);
    cursor: pointer;
    margin-left: 8px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    vertical-align: middle;
}

.navbar-button:hover,
.navbar-button:focus {
    background: #FFD900;
    color: #000;
    outline: none;
    box-shadow: 0 3px 24px 1px rgba(255,199,0,.22);
}

.add-event-button {
    background-color: black;
    color: #FFC700;
    border: none;
    border-radius: 25px;
    padding: 10px 28px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1.5rem;
    align-self: end; /* Align button to start of flex container */
}

.container {
    display: flex;
    padding: 1rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.main-content {
    flex: 1 1 0;
    min-width: 0;
    margin-right: 1rem;
    box-sizing: border-box;
}

.sidebar {
    position: sticky; /* Keeps the sidebar fixed when scrolling */
    top: 14rem; /* Assuming nav height is 60px, adjust as needed */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 60px); /* Adjust to fit within the viewport */
    overflow-y: auto; /* Allows scrolling inside the sidebar */
    padding-top: 10px;
    padding-bottom: 10px; /* Optional, adds some space at the bottom */
    background-color: #000; /* Optional, ensures visibility against nav */
    z-index: 999; /* Should be lower than nav */
    max-width: 370px;  /* oder nach Gusto! */
    min-width: 250px;
    width: 25vw;
    box-sizing: border-box;
    flex-shrink: 0;
    flex-grow: 0;
}

.logo-claim-section {
    text-align: center;
    padding: 0.1rem;
    background-color: #000000;
    height: 110px;
}

.logo-claim-section img {
    max-height: 100%;
    width: auto;
    margin-bottom: 0.1rem;
}

.filter-tiles {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    justify-content: center;
    align-items: center;
    padding: 1rem 1rem;
    background-color: #000;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.filter-row {
    display: flex;
    gap: 0.4rem;
    width: 100%;
    justify-content: center;
    align-items: stretch;
}

.filter-tiles .tile {
    flex: 1 1 0;
    min-width: 80px;
    max-width: 193px;
    min-height: 70px;
    padding: 0.3rem;
    border: 2px solid #fff;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    box-sizing: border-box;
}

.filter-tiles .tile img {
    max-width: 100%;
    max-height: 100%;
    background-color: white;
}

.filter-tiles .tile.selected {
    border: 2px solid #FFC700;
    color: #FFC700;
    transform: scale(1.05); /* Increase size slightly without moving other tiles */
}

.filter-tiles .tile.selected img {
    background-color: #FFC700; /* Der Hintergrund wird gelb, wenn die Kachel ausgewählt ist */
}


.event-section, .filter-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.sidebar .calendar {
    margin-bottom: 20px;
}

.sidebar h3 {
    margin-top: 0;
    text-align: center;
}

.section-heading {
    font-size: 1.5rem;
    color: #FFC700;
    font-weight: bold;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.25rem;
    padding-top: 0.25rem;
}

.section-heading::after {
    content: "";
    display: block;
    width: 80%;
    height: 2px;
    background-color: #FFC700;
    position: absolute;
    bottom: 0;
    left: 50%; /* Move to the center of the parent */
    margin-left: -40%; /* Negative half of the width to center */
}

.selected-events {
    width: 100%;
    margin: 0 auto;
    word-break: break-word;
}

.selected-events ul,
.selected-events li {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

.selected-events .full-info {
    display: none;
    position: absolute;
    background-color: #fff;
    border: 1px solid #000;
    padding: 0.5rem;
    margin-top: 0.5rem;
    right: 100%;
    white-space: nowrap;
}

.selected-events li:hover .full-info {
    display: block;
}

.selected-events .remove-btn {
    cursor: pointer;
    color: #FFC700;
    margin-left: 1rem;
}

.calendar {
    border: 2px solid #FFC700;
    padding: 1rem;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.2rem;
    margin: 0.2rem;
}

.calendar .day {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bebbba;
    cursor: pointer;
}

.calendar .highlight {
    background-color: #FFC700;
    color: black;
}

.calendar .previous-calendar-btn, .calendar .next-calendar-btn {
    background-color: #FFC700;
    color: black;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem; /* Space below each tag */
    font-size: 1rem;
}

/* -- Neue Struktur für 3x6-Filter -- */
.text-tile {
    background: #181818;
    color: #FFC700;
}
#distance-tile form {
    width: 98%;
    min-width: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#distance-tile input,
#distance-tile select {
    background: #222;
    color: #fff;
    border: 1px solid #FFC700;
    font-size: 0.9rem;
    width: 95%;
    margin-bottom: 2px;
    border-radius: 5px;
    text-align: center;
}

#distance-tile button {
    background: #FFC700;
    color: #000;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 4px;
}
/* Standard: Hamburger-Button verstecken  */
.nav-toggle {
    display: none;
    font-size: 2.3rem;
    background: none;
    border: none;
    color: #181818;
    position: absolute;
    left: 1rem;
    top: 1rem;
    z-index: 1200;
    cursor: pointer;
}
/* ===== Meldung bei Event-Bearbeitung/delete ===== */
.msg.success {
    background: #c3e6cb;
    color: #155724;
    border: 1px solid #155724;
    padding: 8px 12px;
    margin: 1em auto;
    max-width: 360px;
    border-radius: 4px;
    text-align: center;
}
.msg.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #721c24;
    padding: 8px 12px;
    margin: 1em auto;
    max-width: 360px;
    border-radius: 4px;
    text-align: center;
}

/* Mobildarstellung: */
@media (max-width: 900px) {
    /* sidebar ausblenden bei Mobilgeräten */
    .sidebar {
        display: none !important;
    }
    /* navigations anpassen für Mobilgeräte*/
    nav {
        flex-direction: column;
        align-items: stretch;
        position: relative;
        min-height: 45px;
        padding: 0.5rem 0.8rem;
        background-color: #FFC700;
    }
    .nav-toggle {
        display: block;
        z-index: 1250;
        position: absolute;
        left: 0.5rem;
        top: 0.2rem;
    }
    /* HIER: Mehr Spezifität und !important */
    nav .menu {
        display: none !important;
        width: 100%;
        flex-direction: column;
        background: #FFC700;
        padding: 0.3rem 0;
        margin: 0;
    }
    nav .menu.active {
        display: flex !important;
    }
    nav .menu ul {
        flex-direction: column;
        gap: 0.1rem;
        align-items: flex-start;
        margin-left: 3.5rem;
    }
    .navbar-button, .add-event-button {
        width: 75vw;
        box-sizing: border-box;
        text-align: left;
        margin: 0.2rem 0 0.2rem 0.7rem;
        font-size: 1em;
        border-radius: 8px;
    }
    .logo-claim-section {
        height: 65px;               /* oder einen kleineren Wert wählen */
        padding: 0.1rem 0;
    }
    .logo-claim-section img {
        max-height: 45px;           /* beide Bilder werden kleiner */
        width: auto;
    }
    .filter-tiles {
        padding-left: 0;
        padding-right: 0;
        align-items: stretch !important;
        width: 100%;
    }
    .filter-row {
        display: flex;
        flex-wrap: nowrap;                 /* Keine Zeilenumbruch */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smoothes Scrollen für iOS */
        gap: 0.2rem;
        padding: 0.3rem 0.1rem 0.7rem 0.1rem; /* Abstand optisch anpassen */
        scrollbar-width: thin;             /* Schmalerer Scrollbalken für Firefox */
        width: 100%;
        justify-content: flex-start !important;
    }
    .filter-row::-webkit-scrollbar {
        height: 7px;       /* Optional: kleiner Scrollbalken mobil */
        background: #222;
    }
    .filter-row::-webkit-scrollbar-thumb {
        background: #FFC700;
        border-radius: 6px;
    }
    .filter-tiles .tile {
        min-width: 110px; /* Je nach Inhalt – Wert testen/variieren */
        max-width: 185px;
        max-height: 140px;
        flex: 0 0 auto;   /* Nie verkleinern, nie wachsen */
        /* Optionale Anpassung für kleinere Screens */
        font-size: 0.99rem;
    }
    .event-logo {
        max-width: 36px;
        margin-right: 0.3rem;
    }
    .event-logo img {
        max-width: 32px;
        max-height: 32px;
    }
    .event-tile-header {
        gap: 0.3rem;
    }
    .add-calendar-btn {
        display: none !important;
    }
}