/* ===========================================
   Category Filter Bar - Video Page Style
   Matches video-filter-bar-wrapper exactly
   =========================================== */

/* ── Container ── */
.cat-filter-bar {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    padding: 0;
    position: relative;
    z-index: 500;
}

.cat-filter-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

.cat-filter-bar,
.cat-filter-bar a,
.cat-filter-bar button,
.cat-filter-bar input,
.cat-filter-bar .cat-sort-menu,
.cat-filter-bar .cat-sort-menu * {
    font-family: "S\00F6hne", sans-serif;
    font-style: normal;
}

/* ── Sort Dropdown ── */
.cat-sort-dropdown {
    position: relative;
    flex-shrink: 0;
}

.cat-sort-trigger-area {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    height: 44px;
    padding: 0 16px;
    background: rgba(12, 12, 16, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.cat-sort-trigger-area,
.cat-sort-trigger-area * {
    cursor: pointer;
}

.cat-sort-trigger-area:hover {
    background: rgba(18, 18, 24, 0.56);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.cat-sort-trigger-area:hover .cat-sort-trigger {
    background: transparent;
}

.cat-sort-dropdown.open .cat-sort-trigger-area {
    background: rgba(20, 20, 28, 0.58);
    border-color: rgba(255, 255, 255, 0.2);
}

.cat-sort-trigger-area:hover .cat-sort-label {
    color: #fff;
}

.cat-sort-icon-svg {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.15s ease;
}

.cat-sort-trigger-area:hover .cat-sort-icon-svg {
    color: #fff;
}

.cat-sort-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    transition: color 0.15s ease;
}

.cat-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    height: auto;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: color 0.2s cubic-bezier(0.23, 1, 0.32, 1);
    font-family: inherit;
    box-sizing: border-box;
}

.cat-sort-trigger-value {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #ffffff;
    white-space: nowrap;
}

.cat-sort-trigger-chevron {
    color: rgba(255, 255, 255, 0.85);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.cat-sort-dropdown.open .cat-sort-trigger-chevron {
    transform: rotate(180deg);
}

/* Sort Menu Dropdown */
.cat-sort-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    width: 320px;
    min-width: 280px;
    max-width: 360px;
    padding: 14px 14px 12px;
    background-color: rgba(8, 8, 12, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.052) 0%, rgba(255, 255, 255, 0.032) 100%),
        linear-gradient(90deg, rgba(4, 4, 6, 0.88) 0%, rgba(12, 9, 13, 0.72) 18%, rgba(22, 14, 20, 0.52) 50%, rgba(12, 9, 13, 0.72) 82%, rgba(4, 4, 6, 0.88) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transform-origin: top left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    font-family: "S\00F6hne", sans-serif;
    isolation: isolate;
}

.cat-sort-menu::before {
    content: "";
    position: absolute;
    inset: 0;
    background: none;
    pointer-events: none;
    z-index: 0;
}

.cat-sort-dropdown.open .cat-sort-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: fadeInDown 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.cat-sort-menu-header {
    position: relative;
    z-index: 1;
    padding: 0 4px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.3);
}

.cat-sort-menu-inner {
    position: relative;
    z-index: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-sort-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(12, 12, 16, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cat-sort-option:hover {
    background: rgba(18, 18, 24, 0.56);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    text-decoration: none;
}

.cat-sort-option.selected {
    background: rgba(232, 99, 122, 0.2);
    border-color: rgba(232, 99, 122, 0.4);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

/* Sort icon circles */
.cat-sort-option-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.68);
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.cat-sort-option-icon svg {
    width: 16px;
    height: 16px;
}

.cat-sort-option.selected .cat-sort-option-icon {
    background: rgba(232, 99, 122, 0.12);
    border-color: rgba(232, 99, 122, 0.22);
    color: #E8637A;
}

/* Sort text */
.cat-sort-option-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.cat-sort-option-label {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
    transition: color 0.15s ease;
}

.cat-sort-option.selected .cat-sort-option-label {
    color: #ffffff;
    font-weight: 600;
}

.cat-sort-option-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

.cat-sort-option.selected .cat-sort-option-desc {
    color: rgba(255, 255, 255, 0.68);
}

/* Checkmark */
.cat-sort-option-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(232, 99, 122, 0.12);
    color: #E8637A;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}

.cat-sort-option-check svg {
    width: 10px;
    height: 10px;
}

.cat-sort-option.selected .cat-sort-option-check {
    opacity: 1;
    transform: scale(1);
}

/* ── Search Box ── */
.cat-search-box {
    flex: 1;
    min-width: 0;
    max-width: 500px;
}

.cat-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px;
    position: relative;
    overflow: hidden;
    background: rgba(8, 8, 12, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cat-search-form:hover {
    background: rgba(12, 12, 18, 0.58);
    border-color: rgba(255, 255, 255, 0.18);
    transform: none;
}

.cat-search-form:focus-within {
    background: rgba(14, 14, 20, 0.62);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 20px rgba(232, 99, 122, 0.08);
    transform: none;
}

.cat-search-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    transition: color 0.15s ease;
}

.cat-search-icon:hover {
    color: #fff;
}

.cat-search-form:focus-within .cat-search-icon {
    color: #fff;
}

.cat-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    padding: 0;
    font-family: inherit;
    min-width: 0;
}

.cat-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.cat-search-clear {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 18px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.cat-search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Quick Filter Pills ── */
.cat-filter-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    position: relative;
    overflow: hidden;
    background: rgba(12, 12, 16, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
    height: 44px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cat-pill:hover {
    background: rgba(18, 18, 24, 0.56);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.cat-pill.active {
    background: rgba(232, 99, 122, 0.2);
    border-color: rgba(232, 99, 122, 0.4);
    color: #e8637a;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.cat-pill.active:hover {
    background: rgba(232, 99, 122, 0.22);
    border-color: rgba(232, 99, 122, 0.45);
    color: #e8637a;
}

.cat-pill svg {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    stroke: currentColor;
    opacity: 0.6;
}

.cat-pill span {
    line-height: 1;
}

.cat-pill.active svg {
    stroke: currentColor;
    opacity: 1;
}

/* ── All Filters Button (Airbnb style pill) ── */
.cat-all-filters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    height: 44px;
    position: relative;
    overflow: hidden;
    background: rgba(12, 12, 16, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cat-all-filters:hover {
    background: rgba(18, 18, 24, 0.56);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.cat-all-filters svg {
    flex-shrink: 0;
    color: currentColor;
    opacity: 0.6;
}

/* Active state - Airbnb style: dark border, bold text, counter badge */
.cat-all-filters.has-filters {
    background: rgba(232, 99, 122, 0.2);
    border-color: rgba(232, 99, 122, 0.4);
    font-weight: 500;
    color: #e8637a;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.cat-all-filters.has-filters svg {
    opacity: 1;
}

.cat-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #ff3366;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    line-height: 1;
    position: absolute;
    top: -6px;
    right: -6px;
}

/* ── Dark Mode Toggle (matches video page) ── */
.cat-dark-toggle {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #e0e0e0;
    background: transparent;
    cursor: pointer;
    position: relative;
    color: #606060;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.cat-dark-toggle:hover {
    background: rgba(0,0,0,0.06);
    color: #333;
}

.cat-dark-toggle svg {
    width: 22px;
    height: 22px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* =========================================== */
/* Sticky: sits below header (60px), over nav  */
/* Matches video-filter-bar-wrapper behavior   */
/* =========================================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cat-filter-bar.sticky {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 500;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0px 1px 1px rgba(6,8,8,0.06), 0px 3px 10px rgba(6,8,9,0.06);
}

.cat-filter-bar.sticky .cat-filter-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
}

/* Mobile: smart hide on scroll down */
@media (max-width: 768px) {
    .cat-filter-bar.sticky {
        top: 50px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .cat-filter-bar.sticky.hidden {
        transform: translateY(-100%);
        z-index: 1;
        opacity: 0;
    }
}

/* =========================================== */
/* Responsive - Tablet                         */
/* =========================================== */
@media (max-width: 1100px) {
    .cat-filter-inner {
        gap: 10px;
    }

    .cat-sort-label {
        display: none;
    }

    .cat-search-box {
        max-width: 280px;
    }

    .cat-pill {
        gap: 8px;
        padding: 0 12px;
        width: auto;
        height: 40px;
        justify-content: center;
    }

    .cat-pill svg {
        width: 16px;
        height: 16px;
    }
}

/* =========================================== */
/* Responsive - Mobile                         */
/* =========================================== */
@media (max-width: 768px) {
    .cat-filter-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px 15px 0px;
    }

    /* Row 1: Search full width */
    .cat-search-box {
        order: 1;
        width: 100%;
        max-width: none;
        flex: none;
    }

    .cat-search-form {
        height: 48px;
        border-radius: 18px;
        padding: 0 18px;
    }

    .cat-search-input {
        font-size: 16px;
    }

    /* Row 2: Sort + Filters */
    .cat-sort-dropdown {
        order: 2;
        flex: 1;
    }

    .cat-sort-trigger-area {
        padding: 0 14px;
        height: 44px;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .cat-sort-trigger {
        padding: 0;
        height: auto;
        background: transparent;
    }

    .cat-sort-label {
        display: none;
    }

    .cat-all-filters {
        order: 3;
        height: 44px;
        font-size: 14px;
        padding: 0 18px;
        flex-shrink: 0;
    }

    /* Hide dark mode on mobile */
    .cat-dark-toggle {
        display: none;
    }

    /* Row 3: Pills scrollable */
    .cat-filter-pills {
        order: 4;
        width: 100%;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .cat-filter-pills::-webkit-scrollbar {
        display: none;
    }

    .cat-pill {
        flex: 0 0 auto;
        justify-content: center;
        gap: 8px;
        padding: 0 14px;
        height: 44px;
        font-size: 13px;
        border-radius: 18px;
        width: auto;
    }

    .cat-pill.active {
        color: #fff;
    }

    .cat-pill span {
        display: inline;
    }

    .cat-pill svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .cat-sort-menu {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
        top: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 14px 16px 8px;
        border: none !important;
        border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4) !important;
        transform: translateY(20px) !important;
        transform-origin: bottom center !important;
        z-index: 10000 !important;
    }

    .cat-sort-dropdown.open .cat-sort-menu {
        transform: translateY(0) !important;
        animation: sortSheetUp 0.25s cubic-bezier(0.23, 1, 0.32, 1) !important;
    }

    @keyframes sortSheetUp {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .cat-sort-menu .cat-sort-option {
        padding: 10px 12px;
        gap: 9px;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.10);
        box-shadow: none;
    }

    .cat-sort-menu .cat-sort-option .cat-sort-option-icon {
        width: 36px;
        height: 36px;
    }

    .cat-sort-menu .cat-sort-option .cat-sort-option-icon svg {
        width: 16px;
        height: 16px;
    }

    .cat-sort-menu .cat-sort-option-label {
        font-size: 14px;
    }

    .cat-sort-menu .cat-sort-option-desc {
        font-size: 12px;
    }

    .cat-sort-menu .cat-sort-menu-inner {
        gap: 6px;
    }

    .cat-sort-menu .cat-sort-menu-header {
        padding: 0 4px 8px;
        font-size: 9px;
    }

    /* Sticky mobile adjustments */
    .cat-filter-bar.sticky .cat-filter-inner {
        padding: 15px 15px;
    }
}
