/* === Section Header and Quick Filters === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* Space below header/filters */
    flex-wrap: wrap; /* Allow filters to wrap on small screens */
    gap: 15px; /* Gap between title and filters if they wrap */
}
.section-header h2 {
    margin: 0; /* Remove default heading margin */
}
.quick-filter-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap; /* Allow buttons themselves to wrap */
}
.quick-filter-btn, .quick-filter-btn:visited {
    background: #fff; /* Light mode, inactive BG: white */
    color: #000;       /* Light mode, inactive TEXT: black */
    border: 4px solid #000; /* Light mode, inactive BORDER: black */
    border-radius: 8px;
    font-weight: bold;
    padding: 6px 15px; /* Increased padding */
    margin: 0 2px 6px 0;
    font-size: 1.1em; /* Increased font size */
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
    box-shadow: none;
    outline: none;
    display: inline-block;
    box-sizing: border-box; /* Ensure border is part of the size */
}
.quick-filter-btn:hover {
    background: #eee; /* Light mode, inactive HOVER BG: light grey */
    color: #000;
    border: 4px solid #000;
}
.quick-filter-btn.selected,
.quick-filter-btn.active,
.quick-filter-btn.selected.active {
    background: #000; /* Light mode, active BG: black */
    color: #fff;       /* Light mode, active TEXT: white */
    border: 4px solid #000; /* Light mode, active BORDER: black */
}
.quick-filter-btn.selected:hover,
.quick-filter-btn.active:hover,
.quick-filter-btn.selected.active:hover {
    background: #222; /* Light mode, active HOVER BG: darker grey */
    color: #fff;
    border: 4px solid #000; /* Keep consistent black border, don't invert */
}
.quick-filter-btn.calendar-link:hover {
    /* Keep hover consistent for calendar link */
    background-color: var(--secondary-bg);
    border-color: var(--accent-hover);
    color: var(--text-dark);
}

/* === Responsive Quick Filters for Mobile === */
@media (max-width: 768px) {
    .quick-filter-buttons {
        gap: 6px; /* Consistent 6px gap horizontally and vertically */
        width: 100%;
        justify-content: flex-start; /* Allow incomplete rows to start from left */
    }
    .quick-filter-btn, .quick-filter-btn:visited {
        flex-basis: calc((100% - 12px) / 3); /* For 3 buttons per row with 6px gap (2 gaps) */
        width: calc((100% - 12px) / 3);      /* Fallback width */
        text-align: center;
        margin: 0; /* Rely on parent gap for all spacing */
        padding: 10px 6px; /* Slightly reduced horizontal padding for better centering */
        font-size: 0.9em; /* Reduced font size for mobile to prevent cutoff */
        box-sizing: border-box;
        display: flex; /* Use flexbox for internal content alignment */
        align-items: center; /* Vertical center */
        justify-content: center; /* Horizontal center */
    }
}

/* === Extra small screens (iPhone 13 mini and similar) === */
@media (max-width: 390px) {
    .quick-filter-btn, .quick-filter-btn:visited {
        padding: 8px 4px; /* Even tighter padding for very small screens */
        font-size: 0.85em; /* Slightly smaller font */
    }
}

/* === Event List Grid and Cards === */
.event-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    align-items: stretch; /* Force all grid items to same height */
    padding: 0;
    margin: 24px 0 0 0;
    list-style: none;
}
.event-item {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 10px;
    border: 4px solid #000; /* Light mode: black border like buttons */
    overflow: hidden;
    height: 100%; /* Ensure all cards stretch to same height in grid row */
    margin: 0;
    box-sizing: border-box; /* Include border in total size */
}
.event-item:hover {
    transform: translateY(-3px);
    border: 4px solid #222; /* Slightly darker border on hover */
}

/* === Event Image === */
.event-image-container {
    width: 100%;
    height: 180px; /* Fixed height for consistency */
    overflow: hidden;
    background-color: var(--secondary-bg);
    flex-shrink: 0; /* Prevent image container from shrinking */
    border-bottom: 4px solid #000; /* Black border line below image */
}
.event-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
    transition: transform 0.3s ease;
}
.event-item:hover .event-image-container img {
     transform: scale(1.03); /* Slight zoom on hover */
}

/* === Event Card Content === */
.event-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto; /* Take all remaining space after image */
    padding: 15px 20px;
    min-height: 0;
}

/* === Event Details Section === */
.event-item .event-details {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto; /* Take up all remaining space in .event-content */
    margin-bottom: 0;
}

/* === Event Details Content (time, location) === */
.event-item .event-details > p {
    margin-bottom: 8px;
    flex-shrink: 0; /* Don't shrink the details */
}

/* === Event Name as Link === */
.event-item h3 a {
     color: inherit; /* Inherit color from h3 */
     text-decoration: none; /* Remove underline */
     transition: color 0.2s ease;
}
.event-item h3 a:hover {
     color: var(--accent-hover); /* Change color on hover */
}
.event-item h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    flex-shrink: 0; /* Don't shrink the title */
}
.event-item p {
    /* Inherits styles from base.css */
}

/* === Event Card Button Row === */
.event-button-wrapper {
    margin-top: auto; /* Push to very bottom of .event-details */
    margin-bottom: 8px; /* Add space below buttons */
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center; /* Center the buttons */
    flex-shrink: 0; /* Never shrink the buttons */
    padding-top: 10px; /* Small space above buttons */
}

/* === Base Event Card Button Style === */
.event-card-btn {
    padding: 7px 12px;
    background-color: black;
    color: white;
    border: 1px solid black;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-align: center;
    min-width: 0;
    white-space: nowrap;
    min-height: 36px;
    box-sizing: border-box;
}
.event-card-btn:hover {
    background-color: #333; /* Darker gray on hover */
    color: white;
}

/* === Save Event Button === */
.save-event-btn {
    /* Inherits from .event-card-btn */
}
.save-event-btn.saved {
    background-color: white;
    color: black;
    border-color: black;
}
.save-event-btn.saved:hover {
    background-color: #eee;
    color: black;
    border-color: black;
}
.save-event-btn svg {
    fill: currentColor; 
    transition: fill 0.2s ease, transform 0.2s ease;
}
.save-event-btn.saved svg {
    fill: red; /* Heart icon turns red when saved */
    animation: heartBeat 0.8s ease-in-out;
}

/* === Heartbeat Animation for Saved Icon === */
@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.15); }
    50% { transform: scale(1); }
    75% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* === Share, ICS, and Map Buttons === */
.share-event-btn {
    /* Inherits from .event-card-btn */
}
.share-event-btn svg {
    fill: currentColor; /* Use fill for filled SVGs */
    width: 1.2em; 
    height: 1.2em;
}
.ics-download-btn {
    /* Inherits from .event-card-btn */
}
/* ICS button uses Font Awesome, no SVG rule needed */
.map-link-btn {
    /* Inherits from .event-card-btn */
}
.map-link-btn svg {
    fill: currentColor;
    width: 1.2em; 
    height: 1.2em;
}

/* === Sticky Day Heading === */
.day-heading {
    position: sticky !important;
    top: calc(var(--navbar-height, 70px) + var(--sticky-search-height, 0px) + var(--sticky-filter-height, 0px)) !important;
    margin: 24px -20px !important; /* Negative horizontal margins to break out of container */
    padding: 16px 20px !important;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: 'Montserrat', sans-serif;
    z-index: 90 !important;
    background-color: var(--primary-bg, #FFFFFF) !important;
    border-bottom: none !important; /* Keep this or change if the new shadow replaces it */
    box-shadow: 0 2px 3px -3px rgba(0,0,0,0.15) !important; /* Refined shadow for bottom-only visibility */
}

.day-heading::after {
    content: '';
    display: block !important;
    width: 100% !important;
    margin: 0 0 8px 0 !important;
    border-bottom-style: solid;
    border-bottom-width: 6px;
    border-bottom-color: var(--primary-dark);
}

/* === Feedback Page Styles === */
.feedback-form-container {
    max-width: 600px;
    margin: 0 auto 20px auto;
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: 8px;
}
.feedback-form-container p {
    margin-bottom: 15px;
    color: var(--text-medium);
}
.feedback-form-container .form-group {
    margin-bottom: 15px;
}
.feedback-form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-dark);
}
.feedback-form-container textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    resize: vertical;
}
.feedback-form-container .feedback-submit-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: var(--button-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}
.feedback-form-container .feedback-submit-btn:hover {
    background-color: var(--accent-hover-color);
}

/* === Back to Calendar Button (Day View) === */
.back-to-calendar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: black;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.2s ease;
    line-height: 1;
}
.back-to-calendar-btn svg {
    stroke: white;
    width: 1.2em;
    height: 1.2em;
    margin-right: 8px;
    stroke-width: 2.5;
}
.back-to-calendar-btn:hover {
    background-color: #333;
    color: white;
    text-decoration: none;
}

/* === No Events Found Message === */
.no-events-message {
    text-align: center;
    font-weight: bold;
    color: black;
    padding: 40px 20px;
    font-size: 2em;
} 

/* === Event Card Category Label === */
.event-card-category-label {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bolder;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    margin-right: 8px;
    color: #fff;
    background-clip: padding-box;
    border: 2px solid transparent;
    box-sizing: border-box;
}

.event-card-category-label.category-label-konzerte {
    background-image: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-party {
    background-image: linear-gradient(to right, #0f2027 0%, #203a43 50%, #2c5364 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-theater {
    background-image: linear-gradient(to right, #c31432 0%, #240b36 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-festival {
    background-image: linear-gradient(to right, #ff4e50 0%, #f9d423 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-vortrag {
    background-image: linear-gradient(to right, #1d6761 0%, #27ab9f 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-markt {
    background-image: linear-gradient(to right, #874d00 0%, #c78c40 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-familie {
    background-image: linear-gradient(to right, #00c6ff 0%, #0072ff 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-essen {
    background-image: linear-gradient(to right, #FFA500, #FFDAB9);
    border-color: transparent;
}
.event-card-category-label.category-label-sport,
.event-card-category-label.category-label-sports { /* Handle both singular and plural if used */
    background-image: linear-gradient(to right, #13803b 0%, #6DD5FA 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-kunst {
    background-image: linear-gradient(to right, #4a00e0 0%, #8e2de2 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-fuehrung {
    background-image: linear-gradient(to right, #525252 0%, #363636 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-workshop {
    background-image: linear-gradient(to right, #ff512f 0%, #dd2476 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-social,
.event-card-category-label.category-label-community { /* Handle both if used */
    background-image: linear-gradient(to right, #ef473a 0%, #cb2d3e 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-flohmarkt {
    background-image: linear-gradient(to right, #B58DB6 0%, #D8BFD8 100%);
    border-color: transparent;
}
.event-card-category-label.category-label-comedy {
    background-image: linear-gradient(to right, #FF8C00, #FFD700);
    border-color: transparent;
}
.event-card-category-label.category-label-kino {
    background-image: linear-gradient(to right, #4B0082, #4169E1);
    border-color: transparent;
}
.event-card-category-label.category-label-sonstiges {
    background-image: linear-gradient(to right, #888888 0%, #BBBBBB 100%);
    border-color: transparent;
}

/* === Von - Bis Date Range Filter Styles === */
.von-bis-btn.active {
    background-color: #000;
    border-color: #000;
    color: #fff;
}

#von-bis-picker-container {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 4px solid #000;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.von-bis-header {
    text-align: center;
    margin-bottom: 20px;
}

.von-bis-header h3 {
    margin: 0;
    color: #000;
    font-size: 1.2em;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
}

.von-bis-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.date-label {
    color: #000;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 4px;
    font-family: 'Montserrat', sans-serif;
}

.weekday-display {
    color: #666;
    font-size: 0.85em;
    margin-bottom: 8px;
    min-height: 1.2em;
    font-weight: 500;
}

.von-bis-date {
    border: 4px solid #ddd;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
    background: #fff;
    color: #000;
    outline: none;
    font-weight: 500;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.von-bis-date:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.date-arrow {
    font-size: 1.5em;
    color: #000;
    font-weight: bold;
}

.von-bis-actions {
    display: flex;
    justify-content: center;
}

.apply-btn {
    padding: 12px 32px;
    font-size: 1.1em;
    border-radius: 8px;
    background: #000;
    color: #fff;
    border: 4px solid #000;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    min-width: 120px;
}

.apply-btn:hover {
    background: #fff;
    color: #000;
}
@media (max-width: 700px) {
    .event-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .event-content {
        padding: 12px 8px;
    }

    /* Von Bis Picker Mobile Responsiveness */
    #von-bis-picker-container {
        padding: 16px;
        margin: 12px 0;
    }

    .von-bis-inputs {
        flex-direction: column;
        gap: 20px;
    }

    .date-input-group {
        width: 100%;
    }

    .von-bis-date {
        width: 100%;
        text-align: center;
    }

    .date-separator {
        margin: 10px 0;
    }

    .date-arrow {
        font-size: 1.2em;
        transform: rotate(90deg);
    }

    .apply-btn {
        width: 100%;
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    #von-bis-picker-container {
        padding: 12px;
        margin: 8px 0;
    }
    
    .von-bis-header h3 {
        font-size: 1.1em;
    }
}

/* Backwards compatibility - remove if no longer needed */

/* === Load More Button === */
.load-more-btn {
    background: #000;
    color: #fff;
    font-weight: bold;
    font-size: 1.2em;
    padding: 16px 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 auto;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.load-more-btn:hover {
    background: #fff;
    color: #000;
    border: 4px solid #000;
}
#load-more-container {
    text-align: center;
    margin-top: 30px;
} 

[data-theme="dark"] .event-card-btn {
    background-color: #000;
    color: #fff;
    border: 1.5px solid #fff;
}
[data-theme="dark"] .event-card-btn:hover {
    background-color: #222;
    color: #fff;
    border: 1.5px solid #fff;
}
[data-theme="dark"] .save-event-btn.saved {
    background-color: #fff;
    color: #000;
    border-color: #fff;
}
[data-theme="dark"] .save-event-btn.saved:hover {
    background-color: #eee;
    color: #000;
    border-color: #fff;
} 

/* Styles for event cards */
.event-item {
    /* ... existing styles ... */
}

.event-labels-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5em; /* Adjust as needed */
}

.event-countdown-label {
    font-size: 0.8em;
    font-weight: bold;
    padding: 5px 8px; /* Adjusted vertical padding to match category label, horizontal padding adjusted */
    border-radius: 4px;
    color: white;
    background-image: linear-gradient(to bottom, #C00000, #A00000);
    border: 1px solid #A00000;
    margin-left: 5px;
    display: inline-flex; /* To help with vertical alignment of text if line-height issues occur */
    align-items: center; /* Vertically center text within the label */
    justify-content: center; /* Horizontally center text (optional, if text varies a lot) */
}

.event-image-container {
    /* ... existing styles ... */
} 

[data-theme="dark"] .quick-filter-btn, [data-theme="dark"] .quick-filter-btn:visited {
    background: #000;       /* Dark mode, inactive BG: black */
    color: #fff;           /* Dark mode, inactive TEXT: white */
    border: 4px solid #fff; /* Dark mode, inactive BORDER: white */
}

[data-theme="dark"] .quick-filter-btn:hover {
    background: #222;      /* Dark mode, inactive HOVER BG: darker grey */
    color: #fff;
    border: 4px solid #fff;
}

[data-theme="dark"] .quick-filter-btn.selected,
[data-theme="dark"] .quick-filter-btn.active,
[data-theme="dark"] .quick-filter-btn.selected.active {
    background: #fff;       /* Dark mode, active BG: white */
    color: #000;           /* Dark mode, active TEXT: black */
    border: 4px solid #fff; /* Dark mode, active BORDER: white */
}

[data-theme="dark"] .quick-filter-btn.selected:hover,
[data-theme="dark"] .quick-filter-btn.active:hover,
[data-theme="dark"] .quick-filter-btn.selected.active:hover {
    background: #eee;      /* Dark mode, active HOVER BG: light grey */
    color: #000;
    border: 4px solid #fff; /* Keep consistent white border, don't invert */
}

/* === Dark Mode Event Card Styling === */
[data-theme="dark"] .event-item {
    border: 4px solid #fff; /* Dark mode: white border like buttons */
}

[data-theme="dark"] .event-item:hover {
    border: 4px solid #eee; /* Dark mode: slightly dimmer border on hover */
}

[data-theme="dark"] .event-image-container {
    border-bottom: 4px solid #fff; /* Dark mode: white border line below image */
}

[data-theme="dark"] .von-bis-date {
    border: 4px solid #333; /* Dark mode: darker border for date inputs */
}

/* Remove this obsolete rule that breaks grid alignment:
.event-list > .event-item:first-child {
    margin-top: 24px;
} */
