/* Responsive Design - Mobile First Approach */

/* Extra Large Devices (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Large Devices (992px to 1199px) */
@media (max-width: 1199px) {
    .hero-container {
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
}

/* Medium Devices (768px to 991px) */
@media (max-width: 991px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--primary-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-buttons {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .features-grid,
    .games-grid,
    .benefits-grid,
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .about-grid {
        max-width: 100%;
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    .about-content-section {
        padding: 60px 0;
    }
    
    .login-steps,
    .register-benefits {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small Devices (576px to 767px) */
@media (max-width: 767px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .features-section,
    .login-section,
    .register-section,
    .about-section,
    .games-section,
    .benefits-section,
    .testimonials-section,
    .stats-section,
    .cta-section {
        padding: 60px 0;
    }
    
    .feature-card,
    .game-card,
    .benefit-item,
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .game-card {
        min-height: 350px;
    }
    
    .game-card img {
        height: 200px;
        object-fit: contain;
        background-color: var(--light-gray);
    }
    
    .game-card h3 {
        padding: 1rem 1rem 0.5rem;
        font-size: 1.3rem;
    }
    
    .game-card p {
        padding: 0 1rem 1rem;
    }
    
    .hero-buttons,
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Extra Small Devices (up to 575px) */
@media (max-width: 575px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .login-content h2,
    .register-content h2,
    .about-content h2,
    .cta-section h2 {
        font-size: 1.8rem;
    }
    
    .feature-card h3,
    .benefit-item h3 {
        font-size: 1.2rem;
    }
    
    .stat-item h3 {
        font-size: 2rem;
    }
    
    .step {
        padding: 1.5rem;
    }
    
    .benefit {
        padding: 1.5rem;
    }
    
    .nav-logo img {
        height: 40px;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .nav-menu {
        top: 60px;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .features-section,
    .login-section,
    .register-section,
    .about-section,
    .games-section,
    .benefits-section,
    .testimonials-section,
    .stats-section,
    .cta-section {
        padding: 40px 0;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-section::before {
        background-image: url('../images/hero-gaming.webp');
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --light-gray: #2a2a2a;
        --text-color: #e0e0e0;
        --primary-color: #ffffff;
    }
    
    body {
        background-color: var(--white);
        color: var(--text-color);
    }
    
    .feature-card,
    .game-card,
    .benefit-item,
    .testimonial-card {
        background: var(--light-gray);
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .back-to-top,
    .nav-buttons,
    .hero-buttons,
    .cta-buttons {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
    
    .hero-section::before {
        display: none !important;
    }
    
    main {
        margin-top: 0 !important;
    }
    
    .section-title,
    .hero-title {
        color: black !important;
    }
    
    .highlight {
        color: #333 !important;
    }
}

/* Focus visible for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus-visible,
    .nav-link:focus-visible {
        outline: 2px solid var(--secondary-color);
        outline-offset: 2px;
    }
}

/* Container queries for future support */
@container (min-width: 400px) {
    .hero-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Hover effects only on devices that support hover */
@media (hover: hover) {
    .btn:hover {
        transform: translateY(-2px);
    }
    
    .feature-card:hover,
    .game-card:hover,
    .benefit-item:hover {
        transform: translateY(-5px);
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: translateY(-1px);
    }
    
    .feature-card:active,
    .game-card:active,
    .benefit-item:active {
        transform: translateY(-2px);
    }
}
