/**
 * Otimizações Mobile - BaixarSwitch
 * Arquivo dedicado para melhorias de responsividade
 * IMPORTANTE: Este arquivo NÃO sobrescreve estilos existentes, apenas adiciona melhorias
 */

/* ====================================
   RESET E BASE MOBILE
   ==================================== */
@media (max-width: 768px) {
    /* Prevenir zoom em inputs iOS */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Container responsivo */
    .container {
        width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ====================================
   HEADER MOBILE - OTIMIZADO
   ==================================== */
@media (max-width: 992px) {
    .bs-header-main .container {
        padding: 12px 15px;
        gap: 15px;
    }
    
    .bs-search {
        display: none;
    }
    
    .bs-logo img {
        max-height: 35px;
    }
    
    .bs-logo-text {
        font-size: 20px;
    }
    
    .bs-user-menu a {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .bs-user-menu a span {
        display: none;
    }
    
    .bs-navbar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .bs-nav-list {
        justify-content: flex-start;
        padding: 0 10px;
        gap: 0;
    }
    
    .bs-nav-link {
        padding: 12px 14px;
        font-size: 11px;
    }
    
    .bs-nav-link span {
        display: none;
    }
    
    .bs-dropdown {
        position: fixed;
        left: 10px;
        right: 10px;
        top: auto;
        width: auto;
        max-height: 60vh;
        overflow-y: auto;
    }
}

@media (max-width: 576px) {
    .bs-header-main .container {
        padding: 10px 12px;
    }
    
    .bs-logo img {
        max-height: 30px;
    }
    
    .bs-logo-text {
        font-size: 18px;
    }
    
    .bs-user-menu {
        gap: 5px;
    }
    
    .bs-user-menu a {
        padding: 6px 10px;
    }
    
    .bs-user-menu a i {
        font-size: 14px;
    }
    
    .bs-nav-link {
        padding: 10px 12px;
    }
}

/* ====================================
   CARROSSEL MOBILE - OTIMIZADO
   ==================================== */
@media (max-width: 992px) {
    .bs-featured-carousel {
        padding: 25px 0 30px;
    }
    
    .bs-carousel-header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .bs-carousel-title {
        flex-direction: column;
        gap: 10px;
    }
    
    .bs-carousel-title .icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .bs-carousel-title .text {
        font-size: 20px;
    }
    
    .bs-carousel-nav button {
        width: 40px;
        height: 40px;
    }
    
    .bs-carousel-item {
        flex: 0 0 130px;
    }
    
    .bs-carousel-item-cover {
        width: 130px;
        height: 210px;
    }
}

@media (max-width: 576px) {
    .bs-featured-carousel {
        padding: 20px 0;
    }
    
    .bs-carousel-title .text {
        font-size: 18px;
    }
    
    .bs-carousel-item {
        flex: 0 0 110px;
    }
    
    .bs-carousel-item-cover {
        width: 110px;
        height: 180px;
    }
    
    .bs-carousel-track {
        gap: 12px;
    }
}

/* ====================================
   QUICK BAR MOBILE
   ==================================== */
@media (max-width: 768px) {
    .quick-bar {
        padding: 10px 0;
    }
    
    .quick-bar .container {
        gap: 12px;
        flex-wrap: wrap;
    }
    
    .quick-stat {
        font-size: 10px;
        gap: 6px;
    }
    
    .quick-stat i {
        font-size: 12px;
    }
    
    .random-btn {
        padding: 8px 14px;
        font-size: 10px;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .quick-stat {
        display: none;
    }
    
    .quick-stat:first-child,
    .quick-stat:nth-child(2) {
        display: flex;
    }
    
    .random-btn {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
}

/* ====================================
   FILTROS MOBILE - SCROLL HORIZONTAL
   ==================================== */
@media (max-width: 992px) {
    .filter-menu {
        justify-content: flex-start;
        padding: 15px 10px;
        gap: 6px;
        margin-bottom: 20px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-menu::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        padding: 10px 14px;
        font-size: 11px;
        gap: 6px;
    }
    
    .filter-btn i {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .filter-menu {
        padding: 12px 8px;
        gap: 5px;
    }
    
    .filter-btn {
        padding: 8px 10px;
        font-size: 10px;
        gap: 4px;
    }
    
    .filter-btn i {
        font-size: 10px;
    }
    
    .view-toggle {
        padding: 3px;
    }
    
    .view-btn {
        width: 32px;
        height: 32px;
    }
}

/* ====================================
   GRID DE JOGOS MOBILE
   ==================================== */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
    }
}

@media (max-width: 992px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
    
    .game-card-title-wrap {
        padding: 10px;
    }
    
    .game-card-title {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .game-card-title-wrap {
        padding: 8px;
    }
    
    .game-card-title {
        font-size: 10px;
        -webkit-line-clamp: 2;
    }
    
    /* Botão de download menor no hover */
    .card-dl-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    /* Badges menores */
    .badge-fw,
    .badge-br,
    .badge-update,
    .badge-dlc {
        padding: 3px 6px;
        font-size: 8px;
    }
}

@media (max-width: 576px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .game-card-title-wrap {
        padding: 6px 8px;
    }
    
    .game-card-title {
        font-size: 10px;
        line-height: 1.3;
    }
    
    .card-dl-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .games-grid {
        gap: 6px;
    }
    
    .game-card-title {
        font-size: 9px;
    }
}

/* ====================================
   LISTA DE JOGOS MOBILE
   ==================================== */
@media (max-width: 992px) {
    .games-grid.list-view .game-card {
        grid-template-columns: 70px 1fr auto;
        padding: 14px;
        gap: 14px;
    }
    
    .games-grid.list-view .game-card-cover {
        width: 70px;
        min-width: 70px;
        height: 105px;
    }
    
    .games-grid.list-view .game-card-cover img {
        width: 70px;
        height: 105px;
    }
    
    .games-grid.list-view .game-card-title {
        font-size: 14px;
    }
    
    .games-grid.list-view .game-card-info {
        gap: 10px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .games-grid.list-view .game-card {
        grid-template-columns: 55px 1fr;
        padding: 10px;
        gap: 10px;
    }
    
    .games-grid.list-view .game-card-cover {
        width: 55px;
        min-width: 55px;
        height: 82px;
    }
    
    .games-grid.list-view .game-card-cover img {
        width: 55px;
        height: 82px;
    }
    
    .games-grid.list-view .game-card-title {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .games-grid.list-view .game-card-info {
        gap: 8px;
        font-size: 10px;
    }
    
    .games-grid.list-view .game-card-actions {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .games-grid.list-view .game-card {
        grid-template-columns: 50px 1fr;
        padding: 8px;
        gap: 8px;
    }
    
    .games-grid.list-view .game-card-cover {
        width: 50px;
        min-width: 50px;
        height: 75px;
    }
    
    .games-grid.list-view .game-card-cover img {
        width: 50px;
        height: 75px;
    }
    
    .games-grid.list-view .game-card-title {
        font-size: 11px;
    }
    
    .games-grid.list-view .game-card-info {
        font-size: 9px;
        gap: 6px;
    }
    
    .games-grid.list-view .game-card-info span {
        gap: 3px;
    }
}

/* ====================================
   SEÇÃO HEADER MOBILE
   ==================================== */
@media (max-width: 768px) {
    .section-header {
        margin-bottom: 18px;
    }
    
    .section-title {
        font-size: 18px;
        gap: 10px;
    }
    
    .section-title .icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .section-title .count {
        font-size: 10px;
        padding: 4px 10px;
        margin-left: 8px;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 16px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .section-title .icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .section-title .count {
        width: 100%;
        text-align: center;
        margin: 8px 0 0 0;
    }
}

/* ====================================
   PAGINAÇÃO MOBILE
   ==================================== */
@media (max-width: 768px) {
    .pagination {
        margin-top: 25px;
        padding: 16px 0;
        gap: 3px;
    }
    
    .pagination a,
    .pagination span {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pagination a,
    .pagination span {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        font-size: 11px;
    }
    
    /* Mostrar apenas: prev, current-1, current, current+1, next */
    .pagination a:not(:first-child):not(:last-child):not(.current):not([href*="paged"]) {
        display: none;
    }
}

/* ====================================
   MINI SECTIONS MOBILE
   ==================================== */
@media (max-width: 992px) {
    .mini-sections {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .mini-grid {
        gap: 10px;
    }
    
    .mini-card {
        padding: 10px;
        gap: 10px;
    }
    
    .mini-card-img {
        width: 45px;
        height: 68px;
    }
    
    .mini-card-title {
        font-size: 11px;
    }
    
    .mini-card-badge {
        font-size: 9px;
        padding: 3px 8px;
    }
}

/* ====================================
   FOOTER MOBILE
   ==================================== */
@media (max-width: 992px) {
    .pro-footer {
        padding: 30px 0 0;
        margin-top: 30px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .footer-block h4 {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .footer-links li {
        margin-bottom: 8px;
    }
    
    .footer-links li a {
        font-size: 12px;
    }
    
    .social-buttons {
        justify-content: center;
    }
    
    .social-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 15px;
    }
    
    .footer-logo {
        font-size: 18px;
    }
    
    .footer-logo img {
        max-height: 40px;
    }
    
    .footer-copy {
        font-size: 10px;
        line-height: 1.5;
    }
}

/* ====================================
   PÁGINA SIMPLES MOBILE
   ==================================== */
@media (max-width: 992px) {
    .simple-page-layout,
    .page-layout {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 20px 12px;
    }
    
    .simple-page-sidebar,
    .page-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .simple-page-layout,
    .page-layout {
        padding: 15px 10px;
        gap: 15px;
    }
    
    .simple-page-sidebar,
    .page-sidebar {
        grid-template-columns: 1fr;
    }
    
    .simple-page-main,
    .page-main {
        padding: 15px;
        border-radius: 8px;
    }
    
    .simple-page-header,
    .page-header {
        padding-bottom: 12px;
        margin-bottom: 15px;
    }
    
    .simple-page-header h1,
    .page-header h1 {
        font-size: 1.2rem;
        gap: 8px;
    }
    
    .simple-page-content,
    .page-content {
        font-size: 13px;
        line-height: 1.7;
    }
    
    .simple-page-content h2,
    .page-content h2 {
        font-size: 1.1rem;
        margin: 18px 0 12px;
    }
}

/* ====================================
   SIDEBAR WIDGETS MOBILE
   ==================================== */
@media (max-width: 768px) {
    .sidebar-widget,
    .sw-widget {
        border-radius: 8px;
    }
    
    .sw-header,
    .sw-widget-header {
        padding: 12px 14px;
    }
    
    .sw-header h3,
    .sw-widget-header h3 {
        font-size: 11px;
    }
    
    .sw-content,
    .sw-widget-content {
        padding: 12px;
    }
    
    /* Mini cards da sidebar */
    .game-mini {
        padding: 8px 0;
        gap: 10px;
    }
    
    .game-mini-img {
        width: 42px;
        height: 63px;
    }
    
    .game-mini-title {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .game-mini-details {
        font-size: 9px;
        gap: 4px 8px;
    }
    
    /* Nav links */
    .nav-links li a,
    .sw-nav-links li a {
        padding: 10px 4px;
        font-size: 12px;
    }
}

/* ====================================
   SINGLE GAME MOBILE
   ==================================== */
@media (max-width: 992px) {
    .game-two-columns {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .game-cover-column {
        flex: none;
        text-align: center;
    }
    
    .game-cover-img {
        width: 200px;
        height: 325px;
        max-width: 100%;
    }
    
    .game-info-column {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .game-cover-img {
        width: 160px;
        height: 260px;
    }
    
    .game-info-row {
        padding: 8px 0;
        font-size: 12px;
    }
    
    .game-info-row .info-icon {
        width: 20px;
        margin-right: 6px;
    }
    
    .game-sinopse {
        padding: 15px;
        margin: 20px 0;
    }
    
    .game-sinopse h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .sinopse-text {
        font-size: 13px;
        line-height: 1.7;
    }
    
    /* Downloads */
    .game-downloads {
        padding: 15px;
        margin: 20px 0;
    }
    
    .game-downloads h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .downloads-area {
        padding: 12px;
    }
    
    .downloads-table th,
    .downloads-table td {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    /* Galeria */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .gallery-item img {
        height: 100px;
    }
}

/* ====================================
   SEARCH PAGE MOBILE
   ==================================== */
@media (max-width: 768px) {
    .search-container {
        padding: 15px 12px;
    }
    
    .search-header {
        padding: 20px;
        border-radius: 10px;
        margin-bottom: 18px;
    }
    
    .search-header h1 {
        font-size: 18px;
        gap: 10px;
    }
    
    .search-meta {
        font-size: 12px;
    }
    
    .search-form-wrap form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form-wrap input[type="text"],
    .search-form-wrap button {
        width: 100%;
    }
    
    .results-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 12px;
    }
    
    .results-count {
        font-size: 12px;
    }
}

/* ====================================
   UTILITÁRIOS TOUCH
   ==================================== */
@media (hover: none) and (pointer: coarse) {
    /* Em dispositivos touch, mostrar overlay sempre */
    .game-card .card-overlay {
        opacity: 0.6;
        background: linear-gradient(180deg, transparent 0%, transparent 60%, rgba(0,0,0,0.7) 100%);
    }
    
    .game-card .card-dl-btn {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.9);
    }
    
    /* Remover hover effects em touch */
    .game-card:hover {
        transform: none;
    }
    
    .game-card:active {
        transform: scale(0.98);
    }
    
    /* Área de toque maior para links */
    .footer-links li a,
    .nav-links li a,
    .sw-nav-links li a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ====================================
   ACESSIBILIDADE
   ==================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para navegação por teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #e60012;
    outline-offset: 2px;
}

/* ====================================
   PRINT STYLES
   ==================================== */
@media print {
    .bs-header,
    .bs-navbar,
    .filter-menu,
    .quick-bar,
    .bs-featured-carousel,
    .pro-footer,
    .card-overlay,
    .game-card-actions,
    .pagination,
    .view-toggle,
    .random-btn {
        display: none !important;
    }
    
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .game-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
