/* === Saved Events Sidebar Styles === */

/* === Sidebar Container === */
#saved-events-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 90%;
    height: 100vh;
    background-color: black;
    color: white;
    padding: 20px;
    padding-top: 60px;
    padding-bottom: 120px;
    box-sizing: border-box;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* === Main Content Pusher (for sidebar slide effect) === */
#main-content-pusher {
    transition: transform 0.3s ease-in-out;
    background-color: var(--bg-color, white);
    min-height: 100vh;
}

/* === Sidebar Active State === */
body.sidebar-active #saved-events-sidebar {
    transform: translateX(0%);
}

/* === Close Button === */
#close-sidebar-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 2.5em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    font-weight: 300;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
#close-sidebar-btn:hover {
    opacity: 1;
}

/* === Sidebar Content === */
#saved-events-sidebar h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4em;
    color: white;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}
#saved-events-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    flex-grow: 1;
    overflow-y: auto;
}
#saved-events-sidebar li {
    padding: 10px 0;
    border-bottom: 1px solid #444;
    font-size: 0.95em;
}
#saved-events-sidebar li:last-child {
    border-bottom: none;
}

/* === Sidebar List Item Elements === */
.sidebar-event-item-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3px;
}
.sidebar-event-item-title {
    font-weight: 500;
    margin-right: 5px;
    color: white;
    word-break: break-word;
}
.sidebar-event-item-meta {
    font-size: 0.9em;
    color: #ccc;
    word-break: break-word;
}
#saved-events-sidebar li .no-saved-events {
    color: #aaa;
    font-style: italic;
}
#saved-events-sidebar li div {
    margin-bottom: 3px;
}
#saved-events-sidebar li div[style*="font-weight: 500"] {
    color: white;
}
#saved-events-sidebar li div[style*="color: var(--text-light)"] {
     color: #ccc;
}

/* === Remove Button in List Items === */
#saved-events-sidebar .remove-saved-event-btn {
    background: none;
    border: 1px solid #777;
    color: #ccc;
    padding: 2px 6px;
    font-size: 0.8em;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
#saved-events-sidebar .remove-saved-event-btn:hover {
    background-color: #555;
    color: white;
}

/* === Sidebar Action Buttons (Bottom) === */
#saved-events-sidebar .sidebar-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #444;
}
#saved-events-sidebar .sidebar-buttons button {
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    text-align: center;
    border: 1px solid white;
    background-color: transparent;
    color: white;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
#saved-events-sidebar .sidebar-buttons button:hover {
    background-color: white;
    color: black;
}
#saved-events-sidebar .sidebar-buttons button:disabled {
     border-color: #555;
     color: #777;
     cursor: not-allowed;
     background-color: transparent;
}
#saved-events-sidebar .sidebar-buttons button:disabled:hover {
    background-color: transparent;
    color: #777;
}

/* === Special Button Styles (Download, Remove All, Share) === */
#saved-events-sidebar #share-saved-btn {
     fill: currentColor;
}
#saved-events-sidebar #remove-all-saved-btn {
     border-color: #ff6b6b;
     color: #ff6b6b;
     background-color: transparent;
}
#saved-events-sidebar #remove-all-saved-btn:hover {
     background-color: #ff6b6b;
     color: black;
     border-color: #ff6b6b;
}
#saved-events-sidebar > div.button-wrapper {
     display: flex; 
     gap: 10px; 
}
#saved-events-sidebar > div.button-wrapper button {
    flex-grow: 1; 
    padding: 8px; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-family: 'Nunito Sans', sans-serif;
}
#saved-events-sidebar #download-saved-btn {
    background-color: black;
    color: white;
    border: 1px solid white;
}
#saved-events-sidebar #download-saved-btn:hover {
    background-color: #333;
}
#saved-events-sidebar #remove-all-saved-btn {
     background-color: var(--secondary-bg); 
     border: 1px solid var(--border-light);
     color: var(--text-dark);
}
#saved-events-sidebar #remove-all-saved-btn:hover {
     background-color: #ffe0c2;
     border-color: #ccc;
}
#saved-events-sidebar #share-saved-btn {
    background-color: black;
    flex-grow: 0;
    padding: 8px 10px;
    fill: currentColor;
}
#saved-events-sidebar #share-saved-btn:hover {
    background-color: #333;
    color: white;
}
#saved-events-sidebar #share-saved-btn svg {
    stroke: white;
    width: 1.1em;
    height: 1.1em;
    display: block;
}

/* === Saved Count Display === */
#saved-count {
    display: inline; 
    margin-left: 2px;
} 

/* === Filter Sidebar Styles (Consolidated and Corrected) === */
#filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px; 
    max-width: 90%;
    height: 100vh;
    background-color: #000; 
    color: #fff; 
    box-sizing: border-box;
    z-index: 200; 
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding-bottom: 120px; /* Match Merkliste's bottom padding */
}

#close-filter-sidebar-btn {
    position: absolute;
    top: 15px;
    right: 15px; 
    background: none;
    border: none;
    color: white;
    font-size: 2.5em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    font-weight: 300;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    z-index: 10; /* Above scrollable content */
}
#close-filter-sidebar-btn:hover {
    opacity: 1;
}

#filter-sidebar .filter-sidebar-scrollable-content {
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 20px; /* Left/Right padding */
    padding-top: 75px; /* Increased top padding to clear theme toggle */
}

#filter-sidebar .filter-sidebar-scrollable-content #event-filter-form {
    display: flex;
    flex-direction: column;
}

#filter-sidebar .filter-sidebar-scrollable-content h5 { /* "Kategorien" title */
    color: #fff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em; 
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    text-align: left;
}

#filter-sidebar .filter-section { 
    /* No specific styles needed currently, margin is on h5 or options container if needed */
}

#filter-sidebar .filter-options-container { /* Grid for category buttons */
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px 18px; /* Increased row-gap to 20px, column-gap remains 18px */
}

/* Category Filter Labels - from header_nav.css, adapted for #filter-sidebar */
#filter-sidebar .category-filter-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    margin: 0;
    height: 38px;
    box-sizing: border-box;
    border-radius: 20px;
    cursor: pointer;
    transition: background-image 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    font-weight: bold;
    font-family: 'Poppins', sans-serif; /* Matching original filter area */
    font-size: 0.9em;
    text-align: center;
    border: 2px solid white;
    background-color: black;
    color: #fff !important; 
    line-height: 1;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#filter-sidebar .category-filter-label input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

#filter-sidebar .category-filter-label:has(input[type="checkbox"]:checked) {
    color: white !important;
    border-color: transparent;
}

/* Gradient Definitions - from header_nav.css, adapted for #filter-sidebar */
#filter-sidebar .category-filter-label.category-konzerte:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #6a11cb 0%, #2575fc 100%); }
#filter-sidebar .category-filter-label.category-party:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #0f2027 0%, #203a43 50%, #2c5364 100%); }
#filter-sidebar .category-filter-label.category-theater:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #c31432 0%, #240b36 100%); }
#filter-sidebar .category-filter-label.category-festival:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #ff4e50 0%, #f9d423 100%); }
#filter-sidebar .category-filter-label.category-vortrag:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #1d6761 0%, #27ab9f 100%); }
#filter-sidebar .category-filter-label.category-markt:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #874d00 0%, #c78c40 100%); }
#filter-sidebar .category-filter-label.category-familie:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #00c6ff 0%, #0072ff 100%); }
#filter-sidebar .category-filter-label.category-essen:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #FFA500, #FFDAB9); border-color: transparent; }
#filter-sidebar .category-filter-label.category-sport:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #13803b 0%, #6DD5FA 100%); }
#filter-sidebar .category-filter-label.category-kunst:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #4a00e0 0%, #8e2de2 100%); }
#filter-sidebar .category-filter-label.category-fuehrung:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #525252 0%, #363636 100%); }
#filter-sidebar .category-filter-label.category-workshop:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #ff512f 0%, #dd2476 100%); }
#filter-sidebar .category-filter-label.category-social:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #ef473a 0%, #cb2d3e 100%); }
#filter-sidebar .category-filter-label.category-flohmarkt:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #B58DB6 0%, #D8BFD8 100%); border-color: transparent; }
#filter-sidebar .category-filter-label.category-comedy:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #FF8C00, #FFD700); border-color: transparent; }
#filter-sidebar .category-filter-label.category-kino:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #4B0082, #4169E1); border-color: transparent; }
#filter-sidebar .category-filter-label.category-tanzen:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #b24592 0%, #f15f79 100%); border-color: transparent; }
#filter-sidebar .category-filter-label.category-sonstiges:has(input[type="checkbox"]:checked) { background-image: linear-gradient(to right, #888888 0%, #BBBBBB 100%); border-color: transparent; }

/* Fixed Apply Filters Button Container */
#filter-sidebar .filter-actions-container {
    flex-shrink: 0; 
    padding: 15px 20px;
    background-color: #000; /* Match sidebar background */
    border-top: 1px solid #333; 
    margin-top: auto; /* Push to bottom of available space before parent's padding-bottom */
}

/* Apply Filters Button Styling - from header_nav.css, adapted for #filter-sidebar */
#filter-sidebar .apply-filters-btn {
    display: block; 
    width: 100%;
    padding: 10px 20px;
    background-color: black;
    color: white;
    border: 1px solid white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, background-image 0.3s ease;
    background-image: none;
}

#filter-sidebar .apply-filters-btn:hover {
     background-color: #333;
     color: white;
     border-color: #ccc;
     background-image: none;
}

#filter-sidebar .apply-filters-btn.filters-active {
    background-color: transparent;
    background-image: linear-gradient(to right, #20c997, #007bff);
    color: white;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

#filter-sidebar .apply-filters-btn.filters-active:hover {
    background-image: linear-gradient(to right, #20c997, #007bff);
    filter: brightness(1.15);
    border-color: white;
    color: white;
}

/* Sidebar Active States & Content Pushing */
body.filter-sidebar-active #filter-sidebar {
    transform: translateX(0%);
}
body.filter-sidebar-active #main-content-pusher {
    transform: translateX(300px); /* Width of filter sidebar */
}
body.sidebar-active #main-content-pusher { /* Merkliste active */
    transform: translateX(-300px); /* Width of merkliste sidebar */
} 