/* Store360 - Responsive Design */
/* Media Queries para todos os tamanhos de tela */

/* ===== TABLETS (768px - 1024px) ===== */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 1rem;
        gap: 1rem;
    }

    .navbar-menu ul {
        gap: 1rem;
    }

    .navbar-search {
        flex: 1;
    }

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

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-content {
        padding: 0 2rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== MOBILE (480px - 767px) ===== */
@media (max-width: 767px) {
    /* Navbar móvel */
    .navbar-fixed {
        padding: 0.65rem 0;
    }

    .navbar-container {
        padding: 0 1rem;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
    }

    .navbar-logo {
        min-width: 0;
    }

    .navbar-logo a {
        min-width: 0;
    }

    .navbar-logo .logo {
        max-width: 118px;
        height: 38px;
    }

    .navbar-logo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navbar-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
    }

    .navbar-menu,
    .navbar-search,
    .navbar-actions {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
    }

    .navbar-container.mobile-open .navbar-menu {
        display: block;
        padding-top: 0.35rem;
        border-top: 1px solid var(--border);
    }

    .navbar-container.mobile-open .navbar-search,
    .navbar-container.mobile-open .navbar-actions {
        display: flex;
    }

    .navbar-menu ul {
        width: 100%;
        flex-direction: column;
        gap: 0;
    }

    .navbar-menu li {
        width: 100%;
    }

    .navbar-menu a {
        display: block;
        width: 100%;
        padding: 0.8rem 0.25rem;
        border-bottom: 1px solid var(--border);
        color: var(--text);
    }

    .navbar-menu a::after {
        display: none;
    }

    .navbar-menu a:hover {
        padding-left: 0.65rem;
        background: rgba(0, 255, 0, 0.06);
    }

    .navbar-search {
        order: initial;
        min-width: 0;
        padding-top: 0.1rem;
    }

    .navbar-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 0.5rem;
        padding-bottom: 0.25rem;
    }

    .navbar-actions .user-greeting {
        padding: 0.35rem 0;
    }

    .navbar-actions .user-menu {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        min-width: 0;
        gap: 0.35rem;
    }

    .navbar-actions .user-menu a,
    .btn-login,
    .btn-register {
        width: 100%;
        padding: 0.7rem 0.85rem;
        border-radius: 7px;
        text-align: center;
        text-decoration: none;
    }

    .navbar-actions .user-menu a {
        color: var(--text);
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border);
    }

    .navbar-actions .user-menu a:hover {
        color: var(--primary);
        border-color: rgba(0, 255, 0, 0.4);
    }

    /* Hero Banner */
    .hero-banner {
        height: 250px;
        margin-top: -80px;
        padding-top: 80px;
    }

    .hero-content {
        padding: 0 1.5rem;
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 1.5rem;
        flex-direction: column;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    /* Sections */
    .games-section {
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-header h2 {
        font-size: 1.4rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.75rem;
    }

    .game-card-info {
        padding: 0.75rem;
    }

    .game-card-info h3 {
        font-size: 0.9rem;
    }

    /* Categories */
    .categories-section {
        padding: 0 1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .category-card {
        padding: 1rem;
        gap: 0.5rem;
    }

    .category-icon {
        font-size: 1.5rem;
    }

    /* Footer */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .footer {
        padding: 1.5rem 0 0.5rem;
    }

    /* Game Detail Page */
    .game-container {
        display: flex;
        flex-direction: column;
    }

    .game-main {
        order: 2;
    }

    .game-sidebar {
        order: 1;
        position: static;
        height: auto;
    }

    .game-header {
        flex-direction: column;
        gap: 1rem;
    }

    .game-logo {
        width: 100%;
    }

    .game-actions {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
    }

    /* Auth Pages */
    .auth-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        min-height: auto;
    }

    .auth-info {
        order: -1;
    }

    .auth-box {
        padding: 1.5rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .search-form {
        flex-direction: column;
    }

    /* Catalog */
    .catalog-content {
        grid-template-columns: 1fr;
    }

    .catalog-filters {
        position: static;
        order: 2;
        margin-top: 1.25rem;
        padding: 1.5rem;
    }

    .catalog-grid-container {
        order: 1;
    }

    .filter-group {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }

    /* Pagination */
    .pagination {
        gap: 0.25rem;
    }

    .page-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
    }

    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-table {
        font-size: 0.85rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }
}

/* ===== SMALL MOBILE (320px - 479px) ===== */
@media (max-width: 479px) {
    .main-content {
        margin-top: 60px;
    }

    .navbar-fixed {
        padding: 0.5rem 0;
    }

    .navbar-container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .navbar-logo {
        width: 100%;
    }

    .navbar-logo a {
        font-size: 1rem;
    }

    .navbar-logo .logo {
        width: 32px;
        height: 32px;
    }

    .navbar-search form {
        border-radius: 4px;
    }

    .search-input {
        font-size: 14px;
        padding: 0.4rem 0.75rem;
    }

    .search-btn {
        padding: 0.4rem 0.75rem;
    }

    /* Hero */
    .hero-banner {
        height: 200px;
        margin-top: -60px;
        padding-top: 60px;
    }

    .hero-content h1 {
        font-size: 1.4rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Games */
    .games-section {
        margin: 1.5rem auto;
        padding: 0 0.75rem;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 0.5rem;
    }

    .game-card-info {
        padding: 0.5rem;
    }

    .game-card-info h3 {
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .game-category {
        font-size: 0.75rem;
    }

    .game-stats {
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .category-card {
        padding: 0.75rem;
    }

    .category-name {
        font-size: 0.8rem;
    }

    /* Buttons */
    .btn-primary, .btn-secondary {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .btn-large {
        padding: 0.75rem 1rem;
    }

    /* Footer */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.75rem;
    }

    .footer-section h3,
    .footer-section h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.85rem;
    }

    /* Auth */
    .auth-box {
        padding: 1rem;
    }

    .auth-header h1 {
        font-size: 1.3rem;
    }

    .auth-form {
        gap: 1rem;
    }

    .form-input {
        padding: 0.6rem 0.75rem;
        font-size: 16px;
    }

    .auth-social {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 1rem;
    }

    .info-card h3 {
        font-size: 1rem;
    }

    .info-card p {
        font-size: 0.85rem;
    }

    /* Catalog/Search */
    .catalog-container,
    .search-container {
        padding: 1rem;
    }

    .catalog-header h1,
    .search-header h1 {
        font-size: 1.3rem;
    }

    .filter-group h3 {
        font-size: 0.85rem;
    }

    .filter-options label {
        font-size: 0.85rem;
    }

    /* Tables */
    .admin-table th,
    .admin-table td {
        padding: 0.4rem;
        font-size: 0.75rem;
    }

    .actions-cell {
        flex-direction: column;
    }

    /* Alerts */
    .alert {
        padding: 0.75rem 1rem;
        margin: 0.75rem 0;
        font-size: 0.9rem;
    }

    /* Modals e Dropdowns */
    .user-menu {
        min-width: 150px;
    }

    .user-menu a {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .navbar-fixed {
        padding: 0.5rem 0;
    }

    .hero-banner {
        height: 250px;
        margin-top: -50px;
        padding-top: 50px;
    }

    .hero-content {
        gap: 0.5rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .hero-stats {
        gap: 1rem;
        flex-direction: row;
    }
}

/* ===== HIGH DPI SCREENS ===== */
@media (min-width: 1440px) {
    .navbar-container,
    .games-section,
    .categories-section,
    .footer-container,
    .catalog-container,
    .search-container,
    .auth-container {
        max-width: 1600px;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

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

    .section-header h2 {
        font-size: 2rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar-fixed,
    .footer,
    .btn-login,
    .btn-register,
    .navbar-search,
    .navbar-actions {
        display: none !important;
    }

    body {
        background: white;
    }

    .game-card {
        page-break-inside: avoid;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}

/* ===== DARK MODE PREFERENCE ===== */
@media (prefers-color-scheme: dark) {
    /* Estilos já aplicados pelo CSS principal */
}

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

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: more) {
    :root {
        --primary: #00FF00;
        --secondary: #FFFFFF;
        --text: #000000;
        --text-light: #333333;
        --border: #000000;
    }

    button,
    a {
        border-width: 2px;
    }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    .game-card {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-play {
        padding: 1rem;
    }

    .nav-item:active {
        background: rgba(0, 255, 0, 0.2);
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden-mobile {
    display: none;
}

.visible-mobile {
    display: block;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }

    .visible-mobile {
        display: none;
    }
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.responsive-image {
    max-width: 100%;
    height: auto;
    display: block;
}

.container-fluid {
    width: 100%;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container-fluid {
        padding: 0 2rem;
    }
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== GAME DETAIL PAGE ===== */
@media (max-width: 1100px) {
    .game-detail-page .game-container {
        grid-template-columns: minmax(0, 1fr) 290px;
    }

    .game-detail-page .game-header-card {
        grid-template-columns: 180px minmax(0, 1fr);
    }

    .game-detail-page .related-games .games-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .game-detail-page .game-banner,
    .game-detail-page .game-banner-content {
        min-height: 290px;
    }

    .game-detail-page .game-container {
        margin-top: -90px;
        grid-template-columns: 1fr;
    }

    .game-detail-page .game-main {
        order: 1;
    }

    .game-detail-page .game-sidebar {
        order: 2;
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-detail-page .widget-download {
        grid-column: 1 / -1;
    }

    .game-detail-page .related-games .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .game-detail-page .game-banner,
    .game-detail-page .game-banner-content {
        min-height: 230px;
    }

    .game-detail-page .game-banner-content,
    .game-detail-page .game-container,
    .game-detail-page .related-games {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .game-detail-page .game-container {
        margin-top: -55px;
    }

    .game-detail-page .game-header-card {
        grid-template-columns: 1fr;
        gap: 1.15rem;
    }

    .game-detail-page .game-cover-wrap {
        width: min(240px, 72vw);
        margin: 0 auto;
    }

    .game-detail-page .game-info h1 {
        text-align: center;
        font-size: clamp(1.8rem, 9vw, 2.5rem);
    }

    .game-detail-page .game-category-badge {
        align-self: center;
    }

    .game-detail-page .game-actions {
        flex-direction: column;
    }

    .game-detail-page .game-actions .btn-primary,
    .game-detail-page .game-actions .btn-secondary {
        width: 100%;
    }

    .game-detail-page .game-sidebar {
        grid-template-columns: 1fr;
    }

    .game-detail-page .widget-download {
        grid-column: auto;
    }

    .game-detail-page .gallery-grid {
        grid-template-columns: 1fr;
    }

    .game-detail-page .related-games .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 479px) {
    .game-detail-page .game-banner,
    .game-detail-page .game-banner-content {
        min-height: 190px;
    }

    .game-detail-page .game-banner-content {
        padding-top: 1rem;
    }

    .game-detail-page .game-back-link {
        padding: 0.55rem 0.75rem;
        font-size: 0.82rem;
    }

    .game-detail-page .game-container {
        margin-top: -35px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .game-detail-page .game-header-card,
    .game-detail-page .game-content-card,
    .game-detail-page .game-widget {
        border-radius: 13px;
    }

    .game-detail-page .game-header-card,
    .game-detail-page .game-content-card {
        padding: 1rem;
    }

    .game-detail-page .game-meta-grid {
        grid-template-columns: 1fr;
    }

    .game-detail-page .game-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .game-detail-page .related-games {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .game-detail-page .related-games .games-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== CORREÇÃO DO TÍTULO DA HOME NO MOBILE ===== */
@media (max-width: 767px) {
    .main-content {
        margin-top: 64px;
    }

    .hero-banner {
        height: auto;
        min-height: 340px;
        margin-top: 0;
        padding-top: 0;
        display: flex;
        align-items: stretch;
    }

    .hero-video,
    .banner-overlay {
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .hero-content {
        width: 100%;
        min-height: 340px;
        height: auto;
        padding: 2rem 1.25rem;
        justify-content: center;
        align-items: center;
        gap: 0.65rem;
        text-align: center;
    }

    .hero-content h1 {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 0;
        font-size: clamp(1.75rem, 8vw, 2.35rem);
        line-height: 1.12;
        color: var(--primary);
        text-wrap: balance;
    }

    .hero-content p {
        margin: 0 0 0.6rem;
        font-size: 1rem;
        line-height: 1.4;
    }

    .hero-stats {
        width: 100%;
        max-width: 360px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .hero-stats .stat {
        padding: 0.75rem 0.55rem;
        align-items: center;
        background: rgba(0, 0, 0, 0.45);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
    }
}

@media (max-width: 479px) {
    .hero-banner,
    .hero-content {
        min-height: 315px;
    }

    .hero-content {
        padding: 1.6rem 0.9rem;
    }

    .hero-content h1 {
        font-size: clamp(1.55rem, 8.5vw, 2rem);
    }

    .hero-stats {
        gap: 0.5rem;
    }

    .hero-stats .stat {
        padding: 0.6rem 0.35rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
        line-height: 1.25;
    }
}
