/* Filters Section & Header */
.filters-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.filters-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.filters-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Game Chips Container */
.game-chips-container {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 8px 0;
    margin: -8px 0;
    scrollbar-width: none;
    /* Firefox */
}

.game-chips-container::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.game-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    outline: none;
}

.game-chip:focus {
    outline: none;
}

.game-chip .game-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0.7);
    transition: filter 0.3s ease;
}

.game-chip:hover .game-logo,
.game-chip.active .game-logo {
    filter: brightness(1);
}

.game-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    transform: translateY(-2px);
}

/* Removed 15px margin to prevent layout gap */

/* Game Chip Active & Brand Hover States */
.game-chip.active[data-game="all"] {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.game-chip.active[data-game="valorant"],
.game-chip:hover[data-game="valorant"] {
    background: rgba(255, 70, 85, 0.15);
    border-color: rgba(255, 70, 85, 0.4);
    color: #ff4655;
    box-shadow: 0 0 15px rgba(255, 70, 85, 0.25);
}

.game-chip.active[data-game="cs2"],
.game-chip:hover[data-game="cs2"] {
    background: rgba(255, 189, 46, 0.15);
    border-color: rgba(255, 189, 46, 0.4);
    color: #ffbd2e;
    box-shadow: 0 0 15px rgba(255, 189, 46, 0.25);
}

.game-chip.active[data-game="league of legends"],
.game-chip:hover[data-game="league of legends"] {
    background: rgba(0, 186, 255, 0.15);
    border-color: rgba(0, 186, 255, 0.4);
    color: #00baff;
    box-shadow: 0 0 15px rgba(0, 186, 255, 0.25);
}

.game-chip.active[data-game="apex legends"],
.game-chip:hover[data-game="apex legends"] {
    background: rgba(255, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.4);
    color: #ff3333;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.25);
}

.game-chip.active[data-game="gta v"],
.game-chip:hover[data-game="gta v"] {
    background: rgba(39, 174, 96, 0.15);
    border-color: rgba(39, 174, 96, 0.4);
    color: #2ecc71;
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.25);
}

/* Glass Filters Panel */
.filters-glass {
    position: relative;
    z-index: 20;
    padding: 1.5rem;
    background: rgba(20, 20, 25, 0.5);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Search Row */
.filter-search-row {
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.3s;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.search-input-wrapper input::selection {
    background: transparent;
    color: inherit;
}

.search-input-wrapper input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.search-input-wrapper input:focus+.search-icon {
    color: var(--text-main);
}

/* Filters Grid */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(46, 204, 113, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-group label i {
    opacity: 0.8;
}

/* Custom Select Component */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.custom-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.custom-select-trigger i {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    margin-left: auto;
}

.custom-select-trigger:hover,
.custom-select-trigger.open {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.custom-select-trigger.open i {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: #1a1a24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-select-options.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Custom Scrollbar for Options */
.custom-select-options::-webkit-scrollbar {
    width: 6px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.custom-select-option {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.custom-select-option:hover,
.custom-select-option.selected {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

/* Game Logos in Dropdown */
.option-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.6;
    flex-shrink: 0;
}

.custom-select-option:hover .option-logo,
.custom-select-option.selected .option-logo {
    opacity: 1;
}

.custom-select-trigger .option-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.8;
    flex-shrink: 0;
}

/* Actions Row */
.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1rem;
    width: 100%;
}

.live-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.live-counter .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 8px #2ecc71;
    animation: pulse 2s infinite;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
}

.filter-actions .btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }

    /* Hide game chips on mobile for cleaner look as requested */
    .game-chips-container {
        display: none !important;
    }

    .filters-top-row .btn-create-lobby-glass {
        width: 100%;
        justify-content: center;
    }

    .filter-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 1.25rem;
    }

    .live-counter {
        justify-content: center;
        text-align: center;
    }

    .filter-buttons {
        width: 100%;
        display: flex;
        gap: 1rem;
    }

    .filter-actions .btn {
        flex: 1;
        padding: 0.75rem 0.5rem;
        justify-content: center;
    }
}

/* Premium Create Lobby Button */
.btn-create-lobby-glass {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid rgba(255, 70, 85, 0.4);
    border-radius: 13px;
    padding: 0.7rem 1.8rem;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 70, 85, 0.1);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.btn-create-lobby-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 70, 85, 0.25);
    background: rgba(255, 70, 85, 0.1);
    border-color: rgba(255, 70, 85, 0.8);
    color: #fff;
}

.btn-create-lobby-glass i {
    font-size: 1.1rem;
    color: #ff4655;
    transition: transform 0.3s ease;
}

.btn-create-lobby-glass:hover i {
    transform: scale(1.1);
}

/* Modal Grid Custom Scrollbar */
.games-modal-grid::-webkit-scrollbar,
.options-modal-list::-webkit-scrollbar {
    width: 6px;
}

.games-modal-grid::-webkit-scrollbar-track,
.options-modal-list::-webkit-scrollbar-track {
    background: transparent;
}

.games-modal-grid::-webkit-scrollbar-thumb,
.options-modal-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.games-modal-grid::-webkit-scrollbar-thumb:hover,
.options-modal-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Filter Modals UI Simplified --- */
#options-modal {
    transition: opacity 0.15s ease, visibility 0.15s ease !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(18, 18, 20, 0.95) !important;
}

#options-modal .modal-content {
    transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

#options-modal .modal-content::before {
    display: none !important;
}

/* Collapsible Filters Setup */
.mobile-only-flex {
    display: none !important;
}

.collapsible-filters {
    overflow: hidden;
    /* On desktop, it is fully open by default. GSAP will override this on mobile. */
}

@media (max-width: 992px) {
    .mobile-only-flex {
        display: flex !important;
    }
}

/* Mobile Filters Header Customization */
@media (max-width: 768px) {
    .filters-section {
        margin-top: -1rem; /* Close gap with header */
    }

    .filters-header {
        text-align: center;
        margin-bottom: 1.5rem; /* Preserve gap with İlan Oluştur button */
    }

    .filters-glass {
        margin-top: -0.75rem; /* Minimize gap with İlan Oluştur button */
    }
    
    .filters-header h1 {
        font-family: 'Outfit', 'Inter', sans-serif; /* Premium modern font */
        font-size: 2.4rem;
        margin-bottom: 0;
        letter-spacing: -0.5px;
    }
    
    .filters-header p {
        display: none;
    }
}

/* PC Specific Overrides */
@media (min-width: 993px) {
    /* Pull filter dropdowns UP from the bottom line and center them vertically */
    .filter-grid {
        padding-top: 0 !important; /* Remove excessive gap above dropdowns */
        margin-bottom: 1.5rem; /* Add gap below dropdowns to push them away from the line */
    }
}