/*
|--------------------------------------------------------------------------
| Event-Filter
|--------------------------------------------------------------------------
*/

.event-filter {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(
        --color-border,
        rgba(255, 255, 255, 0.1)
    );
    border-radius: var(--border-radius-large, 16px);
    background: var(
        --color-surface,
        rgba(255, 255, 255, 0.05)
    );
    box-shadow: var(
        --shadow-card,
        0 12px 30px rgba(0, 0, 0, 0.18)
    );
}


/*
|--------------------------------------------------------------------------
| Kopfbereich
|--------------------------------------------------------------------------
*/

.event-filter__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(
        --color-border,
        rgba(255, 255, 255, 0.1)
    );
}

.event-filter__header-content {
    min-width: 0;
}

.event-filter__title {
    margin: 0;
    color: var(--color-text-primary, #f5f5f5);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.event-filter__description {
    margin: 0.35rem 0 0;
    color: var(--color-text-secondary, #b8b8b8);
    font-size: 0.9rem;
    line-height: 1.5;
}

.event-filter__toggle {
    flex-shrink: 0;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(
        --color-border,
        rgba(255, 255, 255, 0.15)
    );
    border-radius: var(--border-radius-small, 8px);
    color: var(--color-text-secondary, #d0d0d0);
    background: transparent;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease;
}

.event-filter__toggle:hover {
    border-color: var(--color-primary, #8b6dcc);
    color: var(--color-text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.04);
}

.event-filter__toggle:focus-visible {
    outline: 3px solid var(
        --color-focus,
        rgba(139, 109, 204, 0.35)
    );
    outline-offset: 2px;
}


/*
|--------------------------------------------------------------------------
| Formular
|--------------------------------------------------------------------------
*/

.event-filter__content {
    padding: 1.5rem;
}

.event-filter__content[hidden] {
    display: none;
}

.event-filter__fields {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.event-filter__field {
    display: flex;
    grid-column: span 3;
    flex-direction: column;
    min-width: 0;
}

.event-filter__field--search {
    grid-column: span 6;
}

.event-filter__label {
    margin-bottom: 0.45rem;
    color: var(--color-text-secondary, #d0d0d0);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.3;
}

.event-filter__input,
.event-filter__select {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(
        --color-border,
        rgba(255, 255, 255, 0.14)
    );
    border-radius: var(--border-radius-small, 8px);
    color: var(--color-text-primary, #f5f5f5);
    background: var(--color-input-background, #222222);
    font: inherit;
    font-size: 0.92rem;
    line-height: 1.3;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.event-filter__input::placeholder {
    color: var(--color-text-muted, #858585);
}

.event-filter__input:hover,
.event-filter__select:hover {
    border-color: rgba(255, 255, 255, 0.24);
}

.event-filter__input:focus,
.event-filter__select:focus {
    border-color: var(--color-primary, #8b6dcc);
    outline: none;
    box-shadow: 0 0 0 3px var(
        --color-focus,
        rgba(139, 109, 204, 0.22)
    );
}

.event-filter__select {
    appearance: none;
    padding-right: 2.5rem;
    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            currentColor 50%
        ),
        linear-gradient(
            135deg,
            currentColor 50%,
            transparent 50%
        );
    background-position:
        calc(100% - 17px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
}

.event-filter__select option {
    color: var(--color-text-primary, #f5f5f5);
    background: var(--color-input-background, #222222);
}


/*
|--------------------------------------------------------------------------
| Fußbereich
|--------------------------------------------------------------------------
*/

.event-filter__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(
        --color-border,
        rgba(255, 255, 255, 0.1)
    );
}

.event-filter__checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--color-text-secondary, #c8c8c8);
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
}

.event-filter__checkbox-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.event-filter__checkbox-control {
    position: relative;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border: 1px solid var(
        --color-border,
        rgba(255, 255, 255, 0.25)
    );
    border-radius: 5px;
    background: var(--color-input-background, #222222);
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.event-filter__checkbox-control::after {
    position: absolute;
    top: 3px;
    left: 6px;
    width: 5px;
    height: 9px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    content: "";
    opacity: 0;
    transform: rotate(45deg) scale(0.7);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.event-filter__checkbox-input:checked
+ .event-filter__checkbox-control {
    border-color: var(--color-primary, #8b6dcc);
    background: var(--color-primary, #8b6dcc);
}

.event-filter__checkbox-input:checked
+ .event-filter__checkbox-control::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.event-filter__checkbox-input:focus-visible
+ .event-filter__checkbox-control {
    outline: 3px solid var(
        --color-focus,
        rgba(139, 109, 204, 0.35)
    );
    outline-offset: 2px;
}

.event-filter__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}


/*
|--------------------------------------------------------------------------
| Schaltflächen
|--------------------------------------------------------------------------
*/

.event-filter__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius-small, 8px);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.event-filter__button:hover {
    transform: translateY(-1px);
}

.event-filter__button:focus-visible {
    outline: 3px solid var(
        --color-focus,
        rgba(139, 109, 204, 0.35)
    );
    outline-offset: 2px;
}

.event-filter__button--primary {
    color: var(--color-primary-contrast, #ffffff);
    background: var(--color-primary, #7e57c2);
}

.event-filter__button--primary:hover {
    background: var(--color-primary-dark, #6846ad);
}

.event-filter__button--secondary {
    border-color: var(
        --color-border,
        rgba(255, 255, 255, 0.16)
    );
    color: var(--color-text-secondary, #d0d0d0);
    background: transparent;
}

.event-filter__button--secondary:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--color-text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.05);
}


/*
|--------------------------------------------------------------------------
| Kompakte Darstellung
|--------------------------------------------------------------------------
*/

.event-filter--compact .event-filter__header {
    padding: 1rem 1.25rem;
}

.event-filter--compact .event-filter__content {
    padding: 1.25rem;
}

.event-filter--compact .event-filter__description {
    display: none;
}

.event-filter--compact .event-filter__input,
.event-filter--compact .event-filter__select {
    min-height: 40px;
}


/*
|--------------------------------------------------------------------------
| Eingeklappter Zustand
|--------------------------------------------------------------------------
*/

.event-filter.is-collapsed .event-filter__header {
    border-bottom-color: transparent;
}


/*
|--------------------------------------------------------------------------
| Responsive Darstellung
|--------------------------------------------------------------------------
*/

@media (max-width: 1100px) {
    .event-filter__field,
    .event-filter__field--search {
        grid-column: span 6;
    }
}

@media (max-width: 720px) {
    .event-filter__header {
        align-items: flex-start;
        padding: 1rem;
    }

    .event-filter__content {
        padding: 1rem;
    }

    .event-filter__field,
    .event-filter__field--search {
        grid-column: span 12;
    }

    .event-filter__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .event-filter__actions {
        justify-content: stretch;
    }

    .event-filter__button {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .event-filter__header {
        flex-direction: column;
        gap: 0.85rem;
    }

    .event-filter__toggle {
        width: 100%;
    }

    .event-filter__actions {
        flex-direction: column-reverse;
    }

    .event-filter__button {
        width: 100%;
    }
}


/*
|--------------------------------------------------------------------------
| Reduzierte Bewegung
|--------------------------------------------------------------------------
*/

@media (prefers-reduced-motion: reduce) {
    .event-filter__toggle,
    .event-filter__input,
    .event-filter__select,
    .event-filter__checkbox-control,
    .event-filter__checkbox-control::after,
    .event-filter__button {
        transition: none;
    }

    .event-filter__button:hover {
        transform: none;
    }
}