/* Game catalogue page (templates/game/index.html.twig) */

.filters-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    margin-bottom: 24px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.filters-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filters-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.filters-panel__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}

.filters-panel__row--year {
    flex-direction: column;
    align-items: stretch;
}

.filters-panel__row--sort {
    align-items: center;
}

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

.toolbar-input,
.toolbar-select {
    height: 40px;
    padding: 0 12px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.9rem;
}

.toolbar-input {
    flex: 1 1 220px;
    min-width: 160px;
}

.toolbar-input:focus,
.toolbar-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.toolbar-input::placeholder {
    color: var(--color-text-muted);
}

.toolbar-select {
    flex: 0 1 auto;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--color-text-muted) 50%),
        linear-gradient(135deg, var(--color-text-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) center, calc(100% - 13px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

.dropdown-filter {
    position: relative;
}

.dropdown-filter__toggle {
    cursor: pointer;
}

.dropdown-filter__panel {
    position: absolute;
    z-index: 10;
    top: calc(100% + 6px);
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    max-height: 260px;
    padding: 10px;
    overflow-y: auto;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgb(0 0 0 / 25%);
}

.dropdown-filter__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    font-size: 0.9rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.dropdown-filter__option:hover {
    background-color: var(--color-surface-hover);
}

.dropdown-filter__empty {
    margin: 0;
    padding: 4px 6px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.year-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 4px 6px 0;
}

.year-filter__labels {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem;
}

.year-filter__value {
    min-width: 3.5em;
    padding: 2px 10px;
    background-color: var(--color-surface-hover);
    border-radius: var(--radius);
    color: var(--color-text);
    font-weight: 600;
    text-align: center;
}

.year-filter__dash {
    color: var(--color-text-muted);
}

.year-filter__slider {
    position: relative;
    height: 28px;
}

.year-filter__track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--color-border);
    border-radius: 2px;
    transform: translateY(-50%);
}

.year-filter__range {
    position: absolute;
    top: 50%;
    height: 4px;
    background-color: var(--color-accent);
    border-radius: 2px;
    transform: translateY(-50%);
}

.year-filter__dot {
    position: absolute;
    top: 50%;
    width: 6px;
    height: 6px;
    background-color: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.year-filter__dot--active {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.year-filter__input {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    margin: 0;
    background: transparent;
    appearance: none;
    pointer-events: none;
    transform: translateY(-50%);
}

.year-filter__input::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.year-filter__input::-moz-range-track {
    height: 4px;
    background: transparent;
}

.year-filter__input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -7px;
    background-color: var(--color-accent);
    border: 3px solid var(--color-surface);
    border-radius: 50%;
    appearance: none;
    box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.year-filter__input::-webkit-slider-thumb:hover,
.year-filter__input::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

.year-filter__input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background-color: var(--color-accent);
    border: 3px solid var(--color-surface);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.year-filter__input::-moz-range-thumb:hover,
.year-filter__input::-moz-range-thumb:active {
    transform: scale(1.15);
}

.year-filter__bounds {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.toolbar-reset {
    height: 40px;
    padding: 0 14px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
}

.toolbar-reset:hover {
    border-color: var(--color-accent);
    color: var(--color-text);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 48px;
}

.game-card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
}

.game-card__cover {
    aspect-ratio: 460 / 215;
    width: 100%;
    object-fit: cover;
    background-color: var(--color-surface-hover);
    display: block;
}

.game-card__cover--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--color-text-muted);
}

.game-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.game-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.game-card__description {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card__meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-card__year {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.game-card__popularity {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
