/*
🚨 COMPLETE MOBILE RECONSTRUCTION - EMERGENCY FIX
================================================
User reports mobile view completely corrupted - rebuilding from scratch
Desktop stays UNTOUCHED (1025px+) - only fixing mobile (1024px and below)
*/

/* DESKTOP PROTECTION - DO NOT TOUCH ANYTHING ABOVE 1025px */
@media (min-width: 1025px) {
    /* Desktop remains absolutely untouched - perfect as-is */
}

/* MOBILE COMPLETE REBUILD - 1024px and below */
@media (max-width: 1024px) {
    /* CRITICAL: Enable scrolling */
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
        height: auto !important;
        width: 100% !important;
    }
    
    /* HEADER: Clean mobile header */
    #main-header {
        position: sticky !important; /* Sticky, NOT fixed */
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: rgba(5, 5, 5, 0.95) !important;
        backdrop-filter: blur(12px) !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        z-index: 100 !important;
    }
    
    /* NAVIGATION: Mobile-optimized flex layout */
    .nav {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 0 !important;
        margin: 0 !important;
        height: auto !important;
        min-height: 60px !important;
        width: 100% !important;
        gap: 12px !important;
        flex-wrap: nowrap !important;
    }
    
    /* CONTAINER: Proper mobile container */
    .container {
        max-width: 100% !important;
        padding: 0 16px !important;
        margin: 0 auto !important;
        width: 100% !important;
    }
    
    /* BRAND: Mobile-friendly brand */
    .brand {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
        text-decoration: none !important;
        color: #fff !important;
    }
    
    .brand img {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }
    
    .brand b {
        font-size: 1.1rem !important;
        font-weight: 700 !important;
        color: #fff !important;
        white-space: nowrap !important;
    }
    
    /* HIDE tagline on mobile completely */
    .tagline {
        display: none !important;
    }
    
    /* HIDE desktop navigation */
    .nav-links, 
    .nav ul,
    .nav li,
    nav ul,
    nav li {
        display: none !important;
    }
    
    /* HEADER ACTIONS: Mobile button group */
    .header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
    }
    
    /* WALLET CONNECT: Mobile-sized */
    .wallet-connect, 
    #walletConnectBtn,
    button[class*="connect"] {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 8px 12px !important;
        border-radius: 8px !important;
        background: rgba(98, 59, 234, 0.9) !important;
        color: #fff !important;
        border: 1px solid rgba(98, 59, 234, 1) !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    .wallet-connect img,
    #walletConnectBtn img {
        width: 16px !important;
        height: 16px !important;
    }
    
    /* CTA BUY BUTTON: Mobile-sized */
    .cta,
    a[href*="raydium"] {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 8px 14px !important;
        border-radius: 8px !important;
        background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%) !important;
        color: #000 !important;
        border: none !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
        text-decoration: none !important;
        flex-shrink: 0 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }
    
    /* BURGER MENU: Show on mobile */
    .burger {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 6px 8px !important;
        border: 1px solid rgba(255,255,255,0.3) !important;
        border-radius: 6px !important;
        background: rgba(255,255,255,0.1) !important;
        color: #fff !important;
        font-size: 0.8rem !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
        transition: all 0.2s ease !important;
    }
    
    .burger:hover {
        background: rgba(255,255,255,0.2) !important;
        border-color: rgba(255,255,255,0.5) !important;
    }
    
    /* MAIN CONTENT: Proper spacing after header */
    main {
        margin-top: 0 !important;
        padding-top: 20px !important;
        width: 100% !important;
        overflow: visible !important;
    }
    
    /* SECTIONS: Mobile-friendly spacing */
    section {
        padding: 40px 0 !important;
        width: 100% !important;
        overflow: visible !important;
    }
    
    /* HERO SECTION: Mobile layout */
    .hero h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
    }
    
    .hero p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 30px !important;
    }
    
    /* BUTTONS: Mobile-friendly sizing */
    .btn, .button, button {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        border-radius: 8px !important;
        margin: 5px !important;
    }
    
    /* CARDS/GRID: Stack on mobile */
    .grid, .cards, .features {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
    }
    
    .card, .feature {
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    /* FOOTER: Mobile layout */
    footer {
        padding: 30px 0 !important;
        text-align: center !important;
    }
    
    footer .container {
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    /* TEXT: Readable mobile sizes */
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    p { font-size: 1rem !important; line-height: 1.6 !important; }
    
    /* FORMS: Mobile-friendly */
    input, textarea, select {
        width: 100% !important;
        padding: 12px !important;
        font-size: 1rem !important;
        border-radius: 6px !important;
    }
    
    /* ENSURE NO HORIZONTAL SCROLL */
    * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* TABLES: Responsive */
    table {
        width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
}

/* SMALL MOBILE: 480px and below */
@media (max-width: 480px) {
    .container {
        padding: 0 12px !important;
    }
    
    .nav {
        padding: 10px 0 !important;
        min-height: 50px !important;
    }
    
    .brand b {
        font-size: 1rem !important;
    }
    
    .wallet-connect, .cta, .burger {
        padding: 6px 10px !important;
        font-size: 0.7rem !important;
    }
    
    .hero h1 {
        font-size: 1.75rem !important;
    }
    
    .hero p {
        font-size: 0.9rem !important;
    }
}

/* EMERGENCY SCROLL INSURANCE */
@media (max-width: 1024px) {
    body {
        position: static !important;
        overflow: auto !important;
        overflow-x: hidden !important;
        overflow-y: scroll !important;
    }
    
    html {
        overflow: auto !important;
        overflow-x: hidden !important;
        overflow-y: scroll !important;
        scroll-behavior: smooth !important;
    }
    
    /* Remove any scroll-blocking elements */
    .no-scroll {
        overflow: auto !important;
    }
}
