@import url('https://fonts.googleapis.com/css2?family=Knewave&display=swap');


body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #eee;
    margin: 0;
    padding: 0;
    display: flex;
    overflow-x: hidden;
    /* ← AÑADIR ESTA LÍNEA */
}
/* Barra lateral */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    text-align: center;
    padding: 0 20px 20px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.sidebar-header img {
    width: 90px;
    height: 90px;
    margin-bottom: 10px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.sidebar-nav a {
    display: block;
    padding: 15px 30px;
    color: #eee;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-nav a:hover {
    background: #252525;
    border-left: 4px solid #6c5ce7;
}

.sidebar-nav a.active {
    background: #252525;
    border-left: 4px solid #6c5ce7;
    font-weight: bold;
}

.sidebar-nav i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Contenido principal */
.main-content {
    margin-left: 250px;
    padding: 20px;
    width: calc(100% - 250px);
}

.header-content h1 {
    text-align: center;
    margin-bottom: 30px;
    font-family: "Knewave", system-ui;
}

.title-icon {
    width: 240px;
    height: 240px;
    vertical-align: middle;
    margin-right: 15px;
}

.filters {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.month-filter {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    padding: 10px 0;
    margin-bottom: 15px;
    scrollbar-width: thin;
    justify-content: center;
}

.month-filter::-webkit-scrollbar {
    height: 6px;
}

.month-filter::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.month-item {
    padding: 8px 15px;
    background: #333;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

.month-item:hover {
    background: #444;
}

.month-item.active {
    background: #6c5ce7;
    font-weight: bold;
}

.year-display {
    text-align: center;
    font-size: 1.2rem;
    margin: 10px 0 20px;
    color: #00b894;
    font-weight: bold;
}

.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    position: relative;
}

.game-card-container {
    position: relative;
    height: auto;
}

.game-card {
    background: #222;
    border-radius: 10px;
    box-shadow: 0 0 10px #000;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.game-card:hover:not(.expanded) {
    transform: translateY(-5px);
}

.game-card.expanded {
    position: fixed;
    z-index: 100;
    width: 90%;
    max-width: 800px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: default;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.game-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    display: block;
}

.play-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.play-icon:hover {
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

.play-icon::before {
    content: "▶";
    color: white;
    font-size: 18px;
}

.game-info {
    padding: 15px;
}

/*
.card-expandable-content {
    max-height: 100px;        
  
    padding: 10px;
    background: #222;
    border-radius: 8px;
    color: #fff;
}*/

.card-expandable-content {
    display: none; /* Oculto por defecto */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.game-card.expanded .card-expandable-content {
    display: block; /* Mostrar solo cuando está expandida */
    max-height: 500px; /* O el valor que quieras */
    opacity: 1;
    overflow: visible;
}


.expanded .card-expandable-content {
    max-height: none;
}

.expanded-content {
    padding: 15px;
    background: #2a2a2a;
}

.close-expand {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 10;
}

.expanded .close-expand {
    display: block;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    width: 80%;
    max-width: 800px;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 30px;
    cursor: pointer;
    color: white;
    z-index: 1001;
}

.close-btn:hover {
    color: #ff4444;
}

.platforms {
    font-size: 0.9em;
    color: #aaa;
}

.loading,
.error {
    text-align: center;
    padding: 40px;
}

.loading {
    color: #aaa;
}

.error {
    color: #ff4444;
}

/* Overlay para cuando una card está expandida */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99;
}

/* ========== MEDIA QUERIES ========== */

/* Para dispositivos móviles (menos de 768px) */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 10px 0;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0 10px;
    }

    .sidebar-nav a {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        border-left: none;
        border-bottom: 3px solid #6c5ce7;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .header-content h1 {
      
      font-size: 2rem;
      color: #fff;
    }



    .title-icon {
        width: 64px;
        height: 64px;
        margin-right: 12px;
    }

    .month-filter {
        gap: 3px;
        padding-bottom: 15px;
    }

    .month-item {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .game-list {
        gap: 15px;
        padding: 10px;
    }

    .game-card.expanded {
        width: 95%;
        max-height: 85vh;
    }

    .modal-content {
        width: 95%;
    }

    .close-btn {
        top: -35px;
        right: 10px;
        font-size: 25px;
        background: rgba(0, 0, 0, 0.7);
        border-radius: 50%;
        width: 35px;
        height: 35px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Para móviles pequeños (menos de 480px) */
@media (max-width: 480px) {
    .sidebar-nav a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .title-icon {
        width: 56px;
        height: 56px;
        margin-right: 10px;
    }

    .month-filter {
        justify-content: flex-start;
    }

    .game-list {

        gap: 12px;
        padding: 10px;
    }

    .game-card img {
        height: 150px;
    }

    .play-icon {
        width: 35px;
        height: 35px;
    }

    .play-icon::before {
        font-size: 16px;
    }

    .platforms {
        font-size: 0.8em;
    }

    .game-card h3 {
        font-size: 1rem;
        margin: 8px 0;
    }

    .game-card p {
        font-size: 0.9rem;
        margin: 5px 0;
    }
}



/* Filtro de plataformas */
.platforms-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    padding: 0 20px;
}

.platform-item {
    padding: 6px 12px;
    background: #333;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    border: 1px solid #444;
}

.platform-item:hover {
    background: #444;
    border-color: #6c5ce7;
}

.platform-item.active {
    background: #00b894;
    border-color: #00b894;
    font-weight: bold;
}

/* Ajustar diseño responsive */
@media (max-width: 768px) {
    .platforms-filter {
        padding: 0 10px;
        justify-content: center;
    }

    .platform-item {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* Filtro de plataformas desplegable */
.platforms-filter {
    margin: 15px 0;
    padding: 0 20px;
    position: relative;
    max-width: 300px;
}

.platform-select {
    width: 100%;
    padding: 10px 15px;
    background: #333;
    color: white;
    border: 1px solid #444;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    font-size: 0.9rem;
}

.platform-select:hover {
    background: #444;
    border-color: #6c5ce7;
}

/* Flecha personalizada para el select */
.platforms-filter::after {
    content: "▼";
    font-size: 0.8rem;
    color: #aaa;
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Ajustar diseño responsive */
@media (max-width: 768px) {
    .platforms-filter {
        padding: 0 10px;
        max-width: 100%;
    }
}

/* Estilos para logos de plataformas - MUY COMPACTOS */
.platforms-logos {
    display: flex;
    flex-wrap: nowrap;
    /* Evitar saltos de línea */
    gap: 2px;
    /* Espacio mínimo entre logos */
    margin-top: 3px;
    align-items: center;
}

.platform-logo {
    width: 36px !important;
    /* Forzar tamaño pequeño */
    height: 36px !important;
    /* Forzar tamaño pequeño */
    object-fit: contain;
    filter: brightness(0.9);
    transition: filter 0.2s ease;
    margin-left: 5px;
}

.platform-logo:hover {
    filter: brightness(1.2);
}

/* Contenedor de plataformas en línea */
.platforms-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
}

/* Para dispositivos móviles */
@media (max-width: 768px) {
    .platforms-logos {
        gap: 1px;
    }

    .platform-logo {
        width: 26px !important;
        height: 26px !important;
    }

    .platforms-container {
        gap: 4px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        /* Un poco más ancho para móviles */
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 60px 15px 15px;
        /* Más padding top para el botón */
    }

}

/* Botón hamburguesa para móviles */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 101;
    background: #6c5ce7;
    border: none;
    border-radius: 5px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
}

/* Ocultar sidebar en móviles por defecto */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 250px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Overlay para cuando el sidebar está abierto */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }
}



/* Filtro de meses - CORREGIDO para móviles */
.month-filter {
    display: flex;
    overflow-x: auto;
    gap: 5px;
    padding: 10px 0;
    scrollbar-width: thin;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}



/* Contenedor principal de filtros - MEJORADO */
.filters {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
    padding: 0 20px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    /* ← AÑADIR */
}

/* Ajustes específicos para móviles */
@media (max-width: 768px) {
    .filters {
        padding: 0 15px;
        width: 100vw;
        /* ← AÑADIR */
        margin-left: -15px;
        /* ← COMPENSAR PADDING */
        margin-right: -15px;
        /* ← COMPENSAR PADDING */
    }

    .month-filter {
        justify-content: flex-start;
        padding: 10px 15px;
        margin: 0 -15px;
        /* ← COMPENSAR MARGEN NEGATIVO */
        width: calc(100% + 30px);
        /* ← COMPENSAR ANCHO */
    }

    .month-item {
        flex-shrink: 0;
        /* ← EVitar que se encojan los items */
        padding: 8px 12px;
    }

    /* Ocultar scrollbar en algunos navegadores */
    .month-filter::-webkit-scrollbar {
        height: 4px;
    }

    .month-filter {
        scrollbar-width: thin;
        scrollbar-color: #444 transparent;
    }
}

/* Para móviles pequeños (menos de 480px) */
@media (max-width: 480px) {
    .month-filter {
        gap: 3px;
    }

    .month-item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .filters {
        padding: 0 10px;
        margin-left: -10px;
        margin-right: -10px;
    }

    .month-filter {
        margin: 0 -10px;
        width: calc(100% + 20px);
        padding: 10px;
    }

    /* .platform-logo{
        width: ;
    } */
}

/* Añadir esto al CSS */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

* {
    box-sizing: border-box;
}

/* Sidebar para móviles - CORREGIDO */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        height: 100vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        /* ← AÑADIR */
    }

    .sidebar-nav {
        display: flex;
        /* ← CAMBIAR a flex */
        flex-direction: column;
        /* ← AÑADIR columna */
        padding: 0;
        margin: 0;
        width: 100%;
    }

    .sidebar-nav li {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .sidebar-nav a {
        padding: 15px 30px;
        border-left: 4px solid transparent;
        border-bottom: none;
        /* ← REMOVER borde inferior */
        white-space: normal;
        /* ← PERMITIR saltos de línea */
        text-align: left;
        display: flex;
        align-items: center;
    }

    .sidebar-nav a:hover,
    .sidebar-nav a.active {
        border-left: 4px solid #6c5ce7;
        border-bottom: none;
        /* ← REMOVER borde inferior */
    }

    .sidebar-header {
        padding: 20px;
        text-align: center;
        border-bottom: 1px solid #333;
    }

    /* Ocultar el scroll horizontal en móviles */
    .sidebar-nav {
        overflow-x: hidden;
        overflow-y: auto;
    }
}

/* Para asegurar que no haya scroll horizontal */
.sidebar {
    overflow-x: hidden;
}

.sidebar-nav {
    flex-direction: column;
    /* ← Asegurar columna siempre */
}

/* SOLUCIÓN: Mantener tamaño consistente de tarjetas */
.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
    justify-items: center; /* Centra las tarjetas horizontalmente */
}

.game-card-container {
    width: 100%;
    max-width: 300px; /* Establece un ancho máximo consistente */
}

.game-card {
    width: 100%;
    height: 100%;
    min-height: 380px; /* Altura mínima consistente */
    display: flex;
    flex-direction: column;
}

.game-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    flex-shrink: 0; /* Evita que la imagen se reduzca */
}

.game-info {
   
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Asegurar que las tarjetas se vean igual incluso con pocos elementos */
@media (max-width: 768px) {
    .game-list {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        justify-items: center;
    }
    
    .game-card-container {
        max-width: 100%;
    }

     .game-card {
        min-height: 100%;
    }
}

/* Para cuando hay muy pocos juegos (1-3)*/
.game-list:has(.game-card-container:nth-child(1):nth-last-child(3)),
.game-list:has(.game-card-container:nth-child(2):nth-last-child(2)),
.game-list:has(.game-card-container:nth-child(3):nth-last-child(1)) {
    justify-content: center;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
}


.game-list:has(.game-card-container:nth-child(1):nth-last-child(1)) {
    grid-template-columns: minmax(280px, 400px);
    justify-content: center;
}

.game-list:has(.game-card-container:nth-child(1):nth-last-child(2)),
.game-list:has(.game-card-container:nth-child(2):nth-last-child(1)) {
    grid-template-columns: repeat(1, minmax(250px, 300px));
    justify-content: center;
}

.game-list:has(.game-card-container:nth-child(1):nth-last-child(3)),
.game-list:has(.game-card-container:nth-child(1):nth-last-child(2)),
.game-list:has(.game-card-container:nth-child(2):nth-last-child(1)) {
    grid-template-columns: repeat(1, minmax(250px, 300px));
    justify-content: center;
}

.game-card.expanded {
    min-height: auto;
    max-height: 80vh;
    overflow-y: auto;
}


@media (max-width: 480px) {
    .game-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-card-container {
        max-width: 100%;
    }
    
    .game-card {
        min-height: 100%;
    }
} 