@import url("https://fonts.googleapis.com/css2?family=Poppins");
@import url("../map/variables.css");

/* Mobile Filter Trigger - Google-style arrow at left edge */
.mobile-filter-trigger {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: #5aeed1;
    display: flex;
    min-height: 44px; /* Touch-friendly minimum size */
    min-width: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 8px rgba(200, 200, 200, 0.5);
    border: 2px solid rgba(200, 200, 200, 0.5);
    border-left: none;
    outline: 1px solid rgba(200, 200, 200, 0.5);
    outline-offset: -1px;



}


.mobile-filter-trigger:hover {
    background: #4dd4b8;
    width: 45px;

}

.mobile-filter-trigger i {
    color: black;
    font-size: 24px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

/* Arrow animation when sidebar is open */
.mobile-filter-trigger.active i {
    transform: rotate(180deg);
}


/* Filter Sidebar Base Styles */
.filter-sidebar {
    display: block;
    position: absolute;
    width: 458px;
    min-width: 330.4px;
    height: calc(100vh - var(--navbar-height) + 3px);
    left: 0;
    background: #ffffff;
    box-shadow: 0 20px 10px -10px rgba(200, 200, 200, 0.2);
    overflow-y: auto;
    padding-bottom: 20px;
    font-family: 'Poppins', sans-serif;
    top: var(--navbar-height);
}

/* Mobile Sidebar Overlay */
@media only screen and (max-width: 768px) {
    .filter-sidebar {
        position: fixed;
        left: -100%; /* Start outside screen */
        width: 85vw;
        max-width: 320px;
        height: 100vh;
        top: var(--navbar-height);
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
        border-radius: 0 8px 8px 0;
    }

    /* Make sidebar visible */
    .filter-sidebar.mobile-open {
        left: 0;
    }
}

/* Mobile Sidebar Overlay Background */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent scrolling when mobile filter is open */
body.mobile-filter-open {
    overflow: hidden;
}

/* Close Button */
#filter-sidebar-close {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    z-index: 15;

    /* Size improvements */
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;

    /* Better visual styling */
    border-radius: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#filter-sidebar-close:hover,
#filter-sidebar-close:focus,
#filter-sidebar-close:active,
#filter-sidebar-close:visited {
    text-decoration: none !important;
    color: inherit !important;
    font-weight: inherit !important;
    outline: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

#filter-sidebar-close i {
    font-size: 20px !important;
}


/* Content Section */
.filter-sidebar .content {
    position: relative;
    text-align: left;
    padding-right: 2rem;
    padding-left: 2rem;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-section h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.filter-section h5 i {
    margin-right: 0.5rem;
    color: #5aeed1;
}

/* Filter Controls */
.filter-controls {
    margin-bottom: 1.5rem;
}

.filter-controls .btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.filter-controls .btn-outline-primary:hover {
    background-color: #5aeed1;
    border-color: #5aeed1;
    color: white;
}

.filter-controls .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

/* Category Filters */
.filter-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-categories .form-check {
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: #fafbfc;
    margin-bottom: 0;
}

.filter-categories .form-check:hover {
    background-color: #f8f9fa;
    border-color: #5aeed1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(90, 238, 209, 0.1);
}

.filter-categories .form-check-input {
    margin-top: 0.125rem;
    margin-right: 0.75rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 0.25rem;
    border: 2px solid #dee2e6;
    transition: all 0.2s ease;
}

.filter-categories .form-check-input:checked {
    background-color: #5aeed1;
    border-color: #5aeed1;
}

.filter-categories .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(90, 238, 209, 0.25);
}

.filter-categories .form-check-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    margin-bottom: 0;
}

/* Emoji icon styling */
.filter-categories .emoji-icon {
    margin-right: 0.75rem;
    font-size: 1.2rem;
    width: 1.2rem;
    text-align: center;
    display: inline-block;
    transition: all 0.2s ease;
}

.filter-categories .form-check-input:checked + .form-check-label {
    font-weight: 600;
    background-color: rgba(90, 238, 209, 0.1);
}

.filter-categories .form-check-input:checked + .form-check-label .emoji-icon {
    filter: brightness(1.2);
    transform: scale(1.05);
}

.filter-categories .form-check:hover .emoji-icon {
    transform: scale(1.05);
}


/* Scrollbar Styling */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Animation Classes */
.filter-fade-in {
    animation: filterFadeIn 0.3s ease-out;
}

@keyframes filterFadeIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Active Filter Indicator */
.filter-active-indicator {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}


/* Loading State */
.filter-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6c757d;
}

.filter-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    margin-right: 1rem;
}

/* Empty State */
.filter-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.filter-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.filter-empty-state h5 {
    margin-bottom: 0.5rem;
    color: #495057;
}

.filter-empty-state p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.has-background-primary-75 {
    background-color: #5aeed1 !important;

}

/* Hierarchical Filter Styles */
.filter-group {
    margin-bottom: 0.5rem;
}

.filter-parent {
    font-weight: 600;
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-parent:hover {
    background-color: #e9ecef;
}

.filter-parent .parent-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

.filter-parent .expand-icon {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.filter-parent .expand-icon .fa-chevron-up {
    transform: rotate(180deg);
}

.subcategories {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    border-left: 2px solid #dee2e6;
    padding-left: 1rem;
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.subcategories.collapsed {
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.filter-subcategory {
    padding: 0.25rem 0;
    font-size: 1rem;
}

.filter-subcategory .icon-text {
    color: #6c757d;
    transition: color 0.2s ease;
}

.filter-subcategory:hover .icon-text {
    color: #495057;
}

.filter-item {
    font-weight: 600;
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-item:hover {
    background-color: #e9ecef;
}

/* Indeterminate checkbox styling */
input[type="checkbox"]:indeterminate {
    background-color: #007bff;
    border-color: #007bff;
}

input[type="checkbox"]:indeterminate:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 2px;
    background: white;
    transform: translate(-50%, -50%);
    border-radius: 1px;
}

/* Responsive adjustments */
@media only screen and (max-width: 458px) {
    .subcategories {
        margin-left: 1rem;
        padding-left: 0.75rem;
    }

    .filter-parent .parent-label {
        font-size: 1rem;
    }

    .filter-subcategory {
        font-size: 0.95rem;
    }
}

/* Animation for smooth transitions */
.filter-categories {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Larger Text Styling for Filter Categories */
.filter-sidebar .checkbox .icon-text span:not(.icon) {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Uniform Large Checkbox Styling for Filter Sidebar */
.filter-sidebar .checkbox input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.75rem;
    cursor: pointer;
}

.filter-sidebar .checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.filter-sidebar .checkbox .icon-text {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Enhanced styling for larger checkboxes */
.filter-sidebar .checkbox input[type="checkbox"]:hover {
    border-color: #5aeed1;
    box-shadow: 0 0 0 2px rgba(90, 238, 209, 0.1);
}

.filter-sidebar .checkbox input[type="checkbox"]:focus {
    outline: none;
    border-color: #5aeed1;
    box-shadow: 0 0 0 3px rgba(90, 238, 209, 0.2);
}

.filter-sidebar .checkbox input[type="checkbox"]:checked {
    background-color: #5aeed1;
    border-color: #5aeed1;
}

/* CSS Custom Properties for Dynamic Sidebar Width Calculation */
:root {
    --sidebar-width-desktop: 458px;
    --sidebar-width-mobile: min(85vw, 320px);
}

/* Mobile Filter Trigger - Dynamic positioning with CSS Custom Properties */
.mobile-filter-trigger.active {
    left: var(--sidebar-width-desktop);
    transition: left 0.3s ease;
}

/* Mobile specific positioning override */
@media only screen and (max-width: 768px) {
    .mobile-filter-trigger.active {
        left: calc(var(--sidebar-width-mobile) + 10px);
    }
}

/* Hide mobile filter trigger on very small screens - only when sidebar is open */
@media only screen and (max-width: 376px) {
    .mobile-filter-trigger.active {
        display: none !important;
    }
}
/* Zusätzliche Sicherheit über Container-Selektor */
body:has(.modal.is-active) .mobile-filter-trigger {
    display: none !important;
}