/* Educational games directory */
.educational-games-page {
    background-color: var(--bg-light);
}

.jogos_lista {
    padding: var(--spacing-xl) 0;
    text-align: center;
}

.jogos_lista .frontpage-page-title {
    margin-bottom: var(--spacing-xl);
}

.jogos_lista .container,
.atividades_lista .container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.jogos_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

@keyframes educational-games-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jogo {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    opacity: 0;
    animation: educational-games-fade-in-up 0.5s ease-out forwards;
    transition: var(--transition-base);
}

.jogo:nth-child(1) {
    animation-delay: 0.05s;
}

.jogo:nth-child(2) {
    animation-delay: 0.1s;
}

.jogo:nth-child(3) {
    animation-delay: 0.15s;
}

.jogo:nth-child(4) {
    animation-delay: 0.2s;
}

.jogo:nth-child(5) {
    animation-delay: 0.25s;
}

.jogo:nth-child(6) {
    animation-delay: 0.3s;
}

.jogo:nth-child(7) {
    animation-delay: 0.35s;
}

.jogo:nth-child(8) {
    animation-delay: 0.4s;
}

.jogo:nth-child(9) {
    animation-delay: 0.45s;
}

.jogo:nth-child(10) {
    animation-delay: 0.5s;
}

.jogo:nth-child(n+11) {
    animation-delay: 0.55s;
}

.jogo:hover,
.jogo:focus-within {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.jogo:active {
    transform: translateY(-2px);
    transition: transform 0.1s ease;
}

.jogo:focus-within {
    outline: 3px solid var(--color-primary);
}

.jogo-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    outline: none;
}

.jogo .thumb {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.jogo .thumb::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: '';
    background: linear-gradient(to bottom, rgb(0 0 0 / 2%), rgb(0 0 0 / 20%));
    opacity: 0;
    transition: var(--transition-base);
}

.jogo:hover .thumb::before,
.jogo:focus-within .thumb::before {
    opacity: 1;
}

.jogo .thumb img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: var(--transition-base);
}

.jogo:hover .thumb img,
.jogo:focus-within .thumb img {
    transform: scale(1.05);
}

.jogo .thumb::after {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 50px;
    height: 50px;
    content: '';
    background: rgb(55 0 254 / 85%) url('../../../imagens/jogar-icon.svg') center center no-repeat;
    background-size: 24px;
    border-radius: var(--radius-round);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

.jogo:hover .thumb::after,
.jogo:focus-within .thumb::after {
    opacity: 1;
}

.jogo::before {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-white);
    content: 'Jogar';
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition-base);
}

.jogo:hover::before,
.jogo:focus-within::before {
    opacity: 1;
    transform: translateY(0);
}

.jogo .titulo {
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    transition: var(--transition-base);
}

.jogo:hover .titulo,
.jogo:focus-within .titulo {
    color: var(--color-primary);
}

.sem-jogos {
    grid-column: 1 / -1;
    max-width: 500px;
    padding: var(--spacing-2xl) var(--spacing-xl);
    margin: var(--spacing-xl) auto;
    text-align: center;
    background-color: var(--bg-white);
    border: 1px dashed rgb(0 0 0 / 10%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    animation: educational-games-fade-in-up 0.5s ease-out forwards;
}

.sem-jogos::before {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-lg);
    content: '';
    background: url('../../../imagens/no-results.svg') center center no-repeat;
    background-size: contain;
    opacity: 0.7;
}

.sem-jogos p {
    margin: 0;
    font-size: var(--font-size-md);
    color: var(--text-secondary);
}

.atividades_lista {
    padding: 2.5rem 0;
    margin: var(--spacing-xl) auto 0;
    background-color: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.atividades_lista h2 {
    position: relative;
    margin: 0 0 var(--spacing-lg);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
}

.atividades_lista h2::after {
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    width: 60px;
    height: 4px;
    content: '';
    background-color: var(--color-primary);
    border-radius: 4px;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.atividades_lista h2:hover::after {
    width: 100px;
}

.tags {
    text-align: center;
}

.tags_container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    padding: var(--spacing-md) 0;
}

.tags a {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    background-color: var(--bg-light);
    border: 1px solid rgb(0 0 0 / 10%);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.tags a:hover,
.tags a:focus {
    color: var(--text-white);
    background-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    outline: none;
    transform: translateY(-3px);
}

@media (max-width: 992px) {
    .jogos_grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .atividades_lista h2 {
        font-size: var(--font-size-lg);
    }

    .tags_container {
        gap: 0.6rem;
    }

    .tags a {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.8rem;
    }

    .sem-jogos {
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    .sem-jogos p {
        font-size: var(--font-size-base);
    }
}

@media (max-width: 576px) {
    .jogos_grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--spacing-md);
    }

    .jogo .thumb img {
        height: 120px;
    }

    .jogo .titulo {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .atividades_lista {
        padding: var(--spacing-lg) 0;
    }

    .sem-jogos::before {
        width: 48px;
        height: 48px;
        margin-bottom: var(--spacing-md);
    }
}

@media (prefers-reduced-motion: reduce) {
    .jogo {
        opacity: 1;
        animation: none;
    }

    .jogo:hover,
    .jogo:focus-within,
    .tags a:hover,
    .tags a:focus {
        transform: none;
    }
}
