/* Mobile-First Responsive Design */

/* Small devices (landscape phones, 576px and up) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 1rem;
    }

    /* Header Mobile */
    .nav {
        padding: 0 1rem;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 1.5rem;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
        padding: 1rem 0;
        border-top: 1px solid rgba(0, 212, 255, 0.3);
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .auth-buttons {
        gap: 0.5rem;
    }

    .btn-secondary, .btn-primary {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        color: #E5E5E5;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }

    /* Hero Section Mobile */
    .hero {
        padding: 6rem 1rem 2rem;
        min-height: 90vh;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .btn-demo, .btn-live {
        padding: 0.8rem 2rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
    }

    .balance-card {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }

    /* Features Section Mobile */
    .features {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    /* Gallery Section Mobile */
    .gallery {
        padding: 4rem 0;
    }

    .gallery-carousel {
        margin-bottom: 2rem;
    }

    .gallery-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* About Section Mobile */
    .about {
        padding: 4rem 0;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-text h2 {
        font-size: 2rem;
    }

    .about-text p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }

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

    /* Footer Mobile */
    .footer {
        padding: 3rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    /* Form Mobile */
    .form-container {
        margin: 6rem auto 2rem;
        padding: 2rem 1.5rem;
    }

    .form-title {
        font-size: 2rem;
    }

    .modal-content {
        margin: 20% auto;
        padding: 2rem;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .modal-buttons {
        flex-direction: column;
    }

    /* Dashboard Mobile */
    .dashboard {
        padding: 6rem 0 2rem;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .balance-amount {
        font-size: 2rem;
    }

    .transaction-table {
        font-size: 0.9rem;
    }

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

    /* Payment Mobile */
    .payment-container {
        margin: 6rem auto 2rem;
    }

    .payment-form {
        padding: 2rem 1.5rem;
    }

    .amount-selection {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .amount-option {
        padding: 1rem;
        font-size: 1rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .cta-buttons {
        flex-direction: row;
        justify-content: center;
    }

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

    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

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

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

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

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

    .mobile-menu-toggle {
        display: none;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 4rem;
    }

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

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

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

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 992px) {
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .amount-selection {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* High DPI Display Adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-title {
        text-rendering: optimizeLegibility;
    }

    .logo {
        text-rendering: optimizeLegibility;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .btn-primary:hover,
    .btn-secondary:hover,
    .btn-demo:hover,
    .btn-live:hover {
        transform: none;
        animation: none;
    }

    .feature-card:hover {
        transform: none;
    }

    .nav-links a:hover::after {
        width: 0;
    }

    /* Increase touch targets */
    .btn-primary,
    .btn-secondary,
    .btn-demo,
    .btn-live {
        min-height: 48px;
        padding: 0.8rem 2rem;
    }

    .gallery-btn {
        width: 48px;
        height: 48px;
    }

    .social-links a {
        width: 48px;
        height: 48px;
    }

    /* Touch-friendly forms */
    .form-group input,
    .form-group select {
        min-height: 48px;
        padding: 1rem 1.2rem;
    }
}

/* Landscape Mobile Devices */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero {
        min-height: 70vh;
        padding: 5rem 1rem 2rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .cta-buttons {
        flex-direction: row;
        gap: 1rem;
    }

    .btn-demo, .btn-live {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
        width: auto;
    }

    .features,
    .gallery,
    .about {
        padding: 3rem 0;
    }
}

/* Print Styles */
@media print {
    .header,
    .background-animation,
    .cta-buttons,
    .footer,
    .modal,
    .loading-overlay {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .hero-title,
    .section-title {
        color: black !important;
        text-shadow: none !important;
    }

    .feature-card,
    .about-content {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .particle {
        animation: none;
    }

    .hero-title {
        animation: none;
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
}

/* Dark Mode Support (if user prefers dark) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* Light Mode Override (if needed) */
@media (prefers-color-scheme: light) {
    /* Keep dark theme as it's part of the gaming aesthetic */
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-secondary,
    .btn-demo,
    .btn-live {
        border-width: 3px;
    }

    .feature-card,
    .form-container,
    .modal-content {
        border-width: 2px;
    }

    .hero-title,
    .section-title {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

/* Custom Mobile Navigation */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 15, 35, 0.95);
    z-index: 1001;
    padding: 2rem;
}

.mobile-nav-overlay.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
}

.mobile-nav-links li {
    margin: 2rem 0;
}

.mobile-nav-links a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.mobile-nav-links a:hover {
    color: #00D4FF;
}

.mobile-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 2rem;
    cursor: pointer;
}

/* Tablet Specific Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero {
        padding: 7rem 2rem 3rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr 1.5fr;
        gap: 2rem;
    }

    .transaction-table th,
    .transaction-table td {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
}

/* Ultra-wide Screen Support */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }

    .hero-content {
        max-width: 1000px;
    }

    .hero-title {
        font-size: 5rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;
    }
}

/* iPhone X and similar devices with notch */
@media only screen 
  and (device-width: 375px) 
  and (device-height: 812px) 
  and (-webkit-device-pixel-ratio: 3) {
  .header {
    padding-top: env(safe-area-inset-top, 1rem);
  }

  .hero {
    padding-top: calc(6rem + env(safe-area-inset-top, 0px));
  }
}