/* Responsive Design */

/* Large Desktop */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-content h2 {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Desktop */
@media (max-width: 1199px) {
    .container {
        padding: 0 15px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Tablet */
@media (max-width: 768px) {
    /* Header */
    .header {
        padding: 0.5rem 0;
    }
    
    .header-content {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
        font-size: 1.3rem;
    }
    
    /* Mobile Menu */
    .nav.mobile-active {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        z-index: 1001;
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav.mobile-active .nav-list {
        flex-direction: column;
        padding: 1rem 0;
        gap: 0;
    }
    
    .nav.mobile-active .nav-list li {
        width: 100%;
    }
    
    .nav.mobile-active .nav-list a {
        display: block;
        padding: 1rem 2rem;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav.mobile-active .nav-list a:last-child {
        border-bottom: none;
    }
    
    /* Ensure header is always visible and compact */
    .header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    
    /* Optimize header content spacing */
    .header-content {
        min-height: 50px;
        align-items: center;
    }
    
    /* Hero Section */
    .hero {
        padding: 3rem 0;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 200px;
        text-align: center;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Games Grid */
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    .category-card i {
        font-size: 2.5rem;
    }
    
    /* Game Detail */
    .game-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .game-info-header h1 {
        font-size: 2rem;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .game-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Game Tabs */
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        border-radius: 0;
        border-bottom: 1px solid #eee;
    }
    
    .game-details-grid {
        grid-template-columns: 1fr;
    }
    
    .screenshots-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    /* Search */
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .search-input-group {
        max-width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .page-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    /* Filter Tabs */
    .filter-tabs {
        gap: 0.5rem;
    }
    
    .filter-tab {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    /* Header */
    .header {
        padding: 0.4rem 0;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .mobile-menu-toggle {
        font-size: 1.2rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    /* Section Titles */
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    /* Games Grid */
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .game-card {
        margin: 0 10px;
    }
    
    .game-image {
        height: 180px;
    }
    
    .game-info {
        padding: 1rem;
    }
    
    .game-info h3 {
        font-size: 1.2rem;
    }
    
    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .category-card i {
        font-size: 2rem;
    }
    
    .category-card h3 {
        font-size: 1.1rem;
    }
    
    .category-card p {
        font-size: 0.8rem;
    }
    
    /* Page Header */
    .page-header {
        padding: 2rem 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    /* Game Detail */
    .game-detail {
        padding: 2rem 0;
    }
    
    .game-header {
        padding: 1rem;
        gap: 1rem;
    }
    
    .game-info-header h1 {
        font-size: 1.8rem;
    }
    
    .game-meta-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .game-meta-header span {
        text-align: center;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .screenshots-grid {
        grid-template-columns: 1fr;
    }
    
    .screenshot-item img {
        height: 180px;
    }
    
    /* Search */
    .search-section {
        padding: 2rem 0;
    }
    
    .search-content h1 {
        font-size: 2rem;
    }
    
    .search-content p {
        font-size: 1rem;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: 10px;
    }
    
    .search-input {
        border-radius: 10px 10px 0 0;
    }
    
    .search-btn {
        border-radius: 0 0 10px 10px;
    }
    
    .search-filters {
        gap: 1rem;
    }
    
    .filter-select {
        padding: 0.6rem;
    }
    
    /* Search Results */
    .search-results {
        padding: 2rem 0;
    }
    
    .results-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .results-header h2 {
        font-size: 1.8rem;
    }
    
    /* Popular Searches */
    .search-tags {
        gap: 0.5rem;
    }
    
    .search-tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Pagination */
    .pagination {
        justify-content: center;
    }
    
    .page-link {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }
    
    /* Filter Tabs */
    .filter-tabs {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .filter-tab {
        text-align: center;
        padding: 0.8rem;
    }
    
    /* Reviews */
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .rating-display {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .rating-number {
        font-size: 2rem;
    }
    
    /* Game Meta */
    .game-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    /* Container adjustments */
    .container {
        padding: 0 10px;
    }
}

/* Extra Small Mobile */
@media (max-width: 320px) {
    .container {
        padding: 0 5px;
    }
    
    /* Header */
    .header {
        padding: 0.3rem 0;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .mobile-menu-toggle {
        font-size: 1.1rem;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .game-card {
        margin: 0 5px;
    }
    
    .search-tags {
        flex-direction: column;
        align-items: center;
    }
    
    .search-tag {
        width: 100%;
        text-align: center;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero-content h2 {
        font-size: 2.2rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .game-image img,
    .game-image-large img,
    .screenshot-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .mobile-menu-toggle,
    .game-overlay,
    .search-filters,
    .pagination,
    .popular-searches {
        display: none !important;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .game-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .hero {
        background: none !important;
        color: #000 !important;
    }
    
    .btn {
        border: 1px solid #000;
        background: none !important;
        color: #000 !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .game-card,
    .category-card,
    .game-tabs,
    .game-header,
    .review-item,
    .review-stats,
    .search-tag,
    .filter-tab,
    .page-link {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .game-info h3,
    .category-card h3,
    .section-title {
        color: #ffffff;
    }
    
    .game-info p,
    .category-card p {
        color: #cccccc;
    }
    
    .footer {
        background-color: #1a1a1a;
    }
    
    .search-input {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .filter-select {
        background-color: rgba(45, 45, 45, 0.8);
        color: #ffffff;
    }
} 