.feed-filter-container {
    position: relative;
    z-index: 70;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.feed-filter-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.feed-filter-dropdown {
    position: relative;
    width: 100%;
    z-index: 70;
    margin: 0;
    box-sizing: border-box;
}

.feed-filter-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #252b3d;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.feed-filter-button:hover,
.feed-filter-button.active {
    background: #2a3142;
    border-color: rgba(255, 255, 255, 0.26);
    transform: translateY(-1px);
}

.feed-filter-icon {
    font-size: 15px;
    flex: 0 0 auto;
}

.feed-filter-text {
    flex: 0 0 auto;
}

.feed-filter-summary {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.feed-filter-arrow {
    width: 16px;
    height: 16px;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.feed-filter-button.active .feed-filter-arrow {
    transform: rotate(180deg);
}

.feed-filter-menu {
    position: relative;
    width: 100%;
    margin-top: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 10px 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #252b3d;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    z-index: 2000;
    overflow: auto;
    box-sizing: border-box;
}

.feed-filter-menu.active {
    display: flex;
    margin-top: 8px;
    max-height: min(76vh, 720px);
}

.feed-filter-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feed-filter-section + .feed-filter-section {
    margin-top: 14px;
}

.feed-filter-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.feed-filter-help {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.55);
}

.feed-filter-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.feed-filter-inline-note {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.66);
    font-size: 12px;
    line-height: 1.45;
}

.feed-filter-clear-link {
    border: 1px solid rgba(248, 113, 113, 0.34);
    background: rgba(248, 113, 113, 0.12);
    color: rgba(255, 226, 226, 0.96);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.feed-filter-clear-link:hover {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.46);
    transform: translateY(-1px);
}

.feed-filter-mode-grid,
.feed-filter-chip-grid,
.feed-filter-toggle-grid,
.feed-filter-input-grid,
.feed-filter-actions {
    display: grid;
    gap: 8px;
}

.feed-filter-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feed-filter-mode-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.feed-filter-mode-option i {
    font-size: 14px;
}

.feed-filter-mode-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.feed-filter-mode-option.selected {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(129, 140, 248, 0.38);
    color: rgba(199, 210, 254, 0.98);
}

.feed-filter-mode-option-featured {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(234, 179, 8, 0.1));
    border-color: rgba(245, 158, 11, 0.42);
    color: rgba(254, 240, 138, 0.98);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.06), 0 10px 24px rgba(245, 158, 11, 0.08);
}

.feed-filter-mode-option-featured:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.26), rgba(234, 179, 8, 0.16));
    border-color: rgba(245, 158, 11, 0.58);
}

.feed-filter-mode-option-featured.selected {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.34), rgba(234, 179, 8, 0.2));
    border-color: rgba(245, 158, 11, 0.7);
    color: #fff4bf;
}

.feed-filter-divider {
    height: 1px;
    margin: 14px 0;
    background: rgba(255, 255, 255, 0.08);
}

.feed-filter-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feed-filter-tag-chip {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    width: auto;
    min-width: 0;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
    overflow: hidden;
}

.feed-filter-tag-chip:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.feed-filter-tag-chip.selected {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.34);
    color: rgba(253, 230, 138, 0.98);
}

.feed-filter-tag-emoji {
    font-size: 13px;
    flex: 0 0 auto;
}

.feed-filter-tag-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-filter-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feed-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.feed-filter-toggle-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.feed-filter-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.feed-filter-toggle-box {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.03);
    flex: 0 0 auto;
    position: relative;
}

.feed-filter-toggle-box::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 3px;
    background: transparent;
    transform: scale(0);
    transition: transform 0.15s ease, background 0.15s ease;
}

.feed-filter-toggle input:checked + .feed-filter-toggle-box {
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.12);
}

.feed-filter-toggle input:checked + .feed-filter-toggle-box::after {
    transform: scale(1);
    background: rgba(251, 191, 36, 0.95);
}

.feed-filter-custom-panel,
.feed-filter-divider-custom {
    display: none;
}

.feed-filter-custom-panel.is-visible,
.feed-filter-divider-custom.is-visible {
    display: flex;
}

.feed-filter-divider-custom.is-visible {
    display: block;
}

.posts-feed.smart-feed-active-state {
    min-height: 220px;
}

.smart-feed-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    padding: 28px 20px 24px;
    text-align: center;
    gap: 14px;
}

.smart-feed-loading-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: rgba(199, 210, 254, 0.98);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.18);
}

.smart-feed-loading-icon i {
    font-size: 22px;
    animation: smartSpin 1.8s linear infinite;
}

.smart-feed-loading-text {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.smart-feed-loading-subtext {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.58);
}

@keyframes smartSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.feed-filter-input-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feed-filter-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
}

.feed-filter-input-wrap input {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 14, 24, 0.36);
    color: #fff;
    font-size: 13px;
    outline: none;
}

.feed-filter-input-wrap input:focus {
    border-color: rgba(129, 140, 248, 0.45);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
}

.feed-filter-actions {
    grid-template-columns: 1fr;
}

.feed-filter-apply-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(129, 140, 248, 0.36);
    background: rgba(99, 102, 241, 0.18);
    color: rgba(224, 231, 255, 0.98);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.feed-filter-apply-btn:hover {
    transform: translateY(-1px);
    background: rgba(99, 102, 241, 0.24);
    border-color: rgba(129, 140, 248, 0.5);
}

@media (max-width: 640px) {
    .feed-filter-button {
        padding: 9px 12px;
        font-size: 12px;
    }

    .feed-filter-summary {
        display: none;
    }

    .feed-filter-menu {
        padding: 8px 10px 10px;
    }

    .feed-filter-mode-grid,
    .feed-filter-toggle-grid,
    .feed-filter-input-grid {
        grid-template-columns: 1fr;
    }

    .feed-filter-chip-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .feed-filter-mode-option-featured {
        grid-column: auto;
    }

    .smart-feed-loading {
        min-height: 180px;
        padding: 22px 16px 18px;
        gap: 10px;
    }

    .smart-feed-loading-text {
        font-size: 16px;
    }

    .smart-feed-loading-subtext {
        font-size: 12px;
    }
}
