/**
 * ==============================================
 * GAMES GRID SECTION CSS - EXPERIÊNCIA ÉPICA
 * ==============================================
 * 
 * Responsabilidade: Grid de cards com efeitos cinematográficos
 * Features: Cards 3D, Preview panels, Animações fluidas, Responsividade
 * Objetivo: Showcase épico dos jogos com UX excepcional
 * 
 * @package Nuntius Theme - GRID EDITION
 * @version 1.0.0 - EPIC
 * @author Nuntius Team
 */

/* ===== GAMES GRID SECTION - FULL WIDTH ===== */
.games-grid-section {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 40px 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(67, 181, 129, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(88, 101, 242, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, #0a0a0f 0%, #16213e 30%, #1a1a2e 70%, #0a0a0f 100%);
    overflow: hidden;
    color: #ffffff;
}

/* ===== BACKGROUND EFFECTS ===== */
.grid-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.grid-depth-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.grid-depth-layer.layer-1 {
    background: radial-gradient(circle at 30% 30%, rgba(88, 101, 242, 0.05) 0%, transparent 70%);
    animation: gridLayerFloat1 25s ease-in-out infinite;
}

.grid-depth-layer.layer-2 {
    background: radial-gradient(circle at 70% 70%, rgba(114, 137, 218, 0.04) 0%, transparent 60%);
    animation: gridLayerFloat2 30s ease-in-out infinite reverse;
}

.grid-particle-layer {
    background-image: 
        radial-gradient(circle at 10% 10%, rgba(67, 181, 129, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 90%, rgba(88, 101, 242, 0.08) 0%, transparent 25%);
    animation: gridParticleFloat 35s ease-in-out infinite;
}

/* ===== CONTAINER PRINCIPAL - FULL WIDTH ===== */
.games-grid-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 2rem;
    position: relative;
    z-index: 10;
}

/* ===== LOADING STATE ===== */
.grid-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 2rem;
}

.loading-animation {
    display: flex;
    gap: 0.5rem;
}

.loading-cube {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #5865f2, #7289da);
    animation: loadingCubeRotate 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.loading-cube:nth-child(2) { animation-delay: 0.2s; }
.loading-cube:nth-child(3) { animation-delay: 0.4s; }
.loading-cube:nth-child(4) { animation-delay: 0.6s; }

.loading-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* ===== EMPTY STATE ===== */
.grid-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    gap: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.empty-state-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.empty-state-message {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    max-width: 400px;
    margin: 0;
}

.empty-state-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(88, 101, 242, 0.2);
    border: 2px solid rgba(88, 101, 242, 0.4);
    border-radius: 25px;
    color: #5865f2;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.empty-state-btn:hover {
    background: rgba(88, 101, 242, 0.3);
    border-color: #5865f2;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.3);
}

/* ===== GRID PRINCIPAL ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

/* View modes */
.games-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.games-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ===== CARD ÉPICO ===== */
.game-card-epic {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    opacity: 0;
    animation: cardSlideIn 0.6s ease-out forwards;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Stagger animation */
.game-card-epic:nth-child(1) { animation-delay: 0.1s; }
.game-card-epic:nth-child(2) { animation-delay: 0.15s; }
.game-card-epic:nth-child(3) { animation-delay: 0.2s; }
.game-card-epic:nth-child(4) { animation-delay: 0.25s; }
.game-card-epic:nth-child(5) { animation-delay: 0.3s; }
.game-card-epic:nth-child(6) { animation-delay: 0.35s; }
.game-card-epic:nth-child(7) { animation-delay: 0.4s; }
.game-card-epic:nth-child(8) { animation-delay: 0.45s; }

.game-card-epic:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: rgba(88, 101, 242, 0.4);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(88, 101, 242, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ===== CONTAINER DA IMAGEM ===== */
.game-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.image-overlay-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.overlay-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(88, 101, 242, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease;
}

.game-card-epic:hover .overlay-gradient {
    opacity: 1;
}

.game-card-epic:hover .overlay-glow {
    transform: translate(-50%, -50%) scale(1);
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.game-card-epic:hover .game-image {
    transform: scale(1.1);
    filter: brightness(1.1) saturate(1.2);
}

/* ===== BADGES ===== */
.game-rating-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(67, 181, 129, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    z-index: 3;
    border: 1px solid rgba(67, 181, 129, 0.3);
    transform: translateY(-50px);
    opacity: 0;
    transition: all 0.3s ease;
}

.game-year-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(88, 101, 242, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    z-index: 3;
    border: 1px solid rgba(88, 101, 242, 0.3);
    transform: translateY(-50px);
    opacity: 0;
    transition: all 0.3s ease 0.1s;
}

.game-card-epic:hover .game-rating-badge,
.game-card-epic:hover .game-year-badge {
    transform: translateY(0);
    opacity: 1;
}

/* ===== AÇÕES DO CARD ===== */
.game-card-actions {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 0.5rem;
    z-index: 4;
    transform: translateY(50px);
    opacity: 0;
    transition: all 0.3s ease 0.2s;
}

.game-card-epic:hover .game-card-actions {
    transform: translateY(0);
    opacity: 1;
}

.game-action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.game-action-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.game-action-btn.steam-btn:hover {
    background: rgba(88, 101, 242, 0.8);
    border-color: #5865f2;
    color: #ffffff;
}

.game-action-btn.info-btn:hover {
    background: rgba(67, 181, 129, 0.8);
    border-color: #43b581;
    color: #ffffff;
}

.game-action-btn.preview-btn:hover {
    background: rgba(114, 137, 218, 0.8);
    border-color: #7289da;
    color: #ffffff;
}

/* ===== INFO DO CARD ===== */
.game-card-info {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.game-genre {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PLATAFORMAS ===== */
.game-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.platform-badge {
    background: rgba(114, 137, 218, 0.2);
    border: 1px solid rgba(114, 137, 218, 0.4);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #7289da;
    font-weight: 500;
}

.platform-more {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* ===== FEATURES PREVIEW ===== */
.game-features-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.feature-tag {
    background: rgba(67, 181, 129, 0.2);
    border: 1px solid rgba(67, 181, 129, 0.4);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #43b581;
    font-weight: 500;
}

/* ===== PREVIEW PANEL LATERAL ===== */
.game-preview-panel {
    position: absolute;
    top: 0;
    left: 100%;
    width: 400px;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0;
    transform: translateX(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.game-card-epic:hover .game-preview-panel {
    transform: translateX(30px);
    opacity: 1;
    visibility: visible;
}

.preview-panel-content {
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Preview Header */
.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.preview-close {
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Preview Content */
.preview-description p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
}

.preview-screenshots h5,
.preview-features h5,
.preview-platforms h5 {
    color: #ffffff;
    font-size: 1rem;
    margin: 0 0 0.8rem 0;
    font-weight: 600;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.screenshots-grid img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.screenshots-grid img:hover {
    transform: scale(1.05);
}

.features-list,
.platforms-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-item,
.platform-item {
    background: rgba(88, 101, 242, 0.2);
    border: 1px solid rgba(88, 101, 242, 0.4);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #5865f2;
    font-weight: 500;
}

/* Preview Actions */
.preview-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: auto;
}

.preview-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
}

.preview-action-btn.steam-btn {
    background: rgba(88, 101, 242, 0.3);
    border: 2px solid rgba(88, 101, 242, 0.5);
    color: #5865f2;
}

.preview-action-btn.steam-btn:hover {
    background: rgba(88, 101, 242, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
}

.preview-action-btn.info-btn {
    background: rgba(67, 181, 129, 0.3);
    border: 2px solid rgba(67, 181, 129, 0.5);
    color: #43b581;
}

.preview-action-btn.info-btn:hover {
    background: rgba(67, 181, 129, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ===== OVERLAY PARA MOBILE ===== */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.preview-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== PAGINAÇÃO ===== */
.games-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination-btn {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination-btn:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: rgba(88, 101, 242, 0.4);
    color: #ffffff;
}

.pagination-btn.active {
    background: rgba(88, 101, 242, 0.3);
    border-color: #5865f2;
    color: #ffffff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== LIST VIEW ===== */
.games-grid.list-view .game-card-epic {
    display: flex;
    height: 200px;
}

.games-grid.list-view .game-image-container {
    width: 300px;
    flex-shrink: 0;
}

.games-grid.list-view .game-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.games-grid.list-view .game-preview-panel {
    display: none;
}

/* ===== ANIMAÇÕES ===== */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loadingCubeRotate {
    0% {
        transform: rotateY(0deg);
        background: linear-gradient(45deg, #5865f2, #7289da);
    }
    50% {
        transform: rotateY(180deg);
        background: linear-gradient(45deg, #7289da, #43b581);
    }
    100% {
        transform: rotateY(360deg);
        background: linear-gradient(45deg, #43b581, #5865f2);
    }
}

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

@keyframes gridLayerFloat1 {
    0%, 100% { 
        transform: translateX(0) translateY(0) rotate(0deg); 
    }
    33% { 
        transform: translateX(30px) translateY(-20px) rotate(1deg); 
    }
    66% { 
        transform: translateX(-20px) translateY(25px) rotate(-1deg); 
    }
}

@keyframes gridLayerFloat2 {
    0%, 100% { 
        transform: translateX(0) translateY(0) rotate(0deg); 
    }
    50% { 
        transform: translateX(-35px) translateY(30px) rotate(2deg); 
    }
}

@keyframes gridParticleFloat {
    0%, 100% { 
        background-position: 0% 0%, 100% 100%; 
    }
    50% { 
        background-position: 100% 0%, 0% 100%; 
    }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2rem;
    }
    
    .game-preview-panel {
        width: 350px;
    }
}

@media (max-width: 768px) {
    .games-grid-container {
        padding: 0 20px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .game-preview-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        width: 90vw;
        max-width: 400px;
        height: 80vh;
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        visibility: hidden;
        z-index: 1001;
    }
    
    .game-preview-panel.mobile-active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        visibility: visible;
    }
    
    .game-card-epic:hover .game-preview-panel {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0;
        visibility: hidden;
    }
    
    .games-grid.list-view .game-card-epic {
        flex-direction: column;
        height: auto;
    }
    
    .games-grid.list-view .game-image-container {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .game-card-info {
        padding: 1.2rem;
    }
    
    .game-title {
        font-size: 1.1rem;
    }
    
    .preview-panel-content {
        padding: 1.5rem;
    }
}