/* Mobile Fixes - Comprehensive Mobile Optimization */

@media (max-width: 768px) {
    /* Fix body overflow and base layout */
    body { 
        overflow-x: hidden !important; 
        width: 100vw;
        position: relative;
    }
    
    /* Container adjustments */
    .container { 
        padding: 0 15px !important; 
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* Navbar fixes - horizontal layout with smaller logo */
    .navbar {
        background: rgba(10, 10, 10, 0.98) !important;
        padding: 0.5rem 0;
        position: fixed;
        width: 100%;
        z-index: 1000;
        top: 0;
        left: 0;
        right: 0;
    }
    
    .nav-container {
        flex-direction: row !important;
        gap: 0.5rem;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        max-width: 100%;
        flex-wrap: wrap;
    }
    
    .nav-logo {
        order: 1;
        flex-shrink: 0;
    }
    
    /* Make logo much smaller on mobile */
    .nav-logo svg {
        max-width: 120px !important;
        height: 30px !important;
        width: 120px;
    }
    
    .nav-menu {
        order: 2;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin: 0;
        flex: 1;
        max-width: calc(100% - 200px);
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
        border-radius: 6px;
    }
    
    .hero-social {
        order: 3;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .social-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    /* Page padding adjustment - much less needed now */
    .page {
        padding-top: 80px !important;
        min-height: calc(100vh - 80px);
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Back navigation mobile adjustment */
    .back-nav {
        margin-top: -10px;
        padding: 0.75rem 0;
        background: rgba(255, 255, 255, 0.02);
    }
    
    .btn-back {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        margin-left: 0.5rem;
    }
    
    /* Hero section mobile optimization */
    .hero {
        padding: 2rem 0;
        overflow-x: hidden;
    }
    
    .hero-content {
        text-align: center;
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2.2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
        word-wrap: break-word;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
        line-height: 1.5;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }
    
    .btn-primary,
    .btn-outline {
        width: 100% !important;
        max-width: 280px;
        padding: 0.8rem 1.5rem !important;
        font-size: 1rem;
        text-align: center;
    }
    
    /* Section optimization */
    .section-header {
        text-align: center;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem !important;
        line-height: 1.3;
        margin-bottom: 0.75rem;
        word-wrap: break-word;
    }
    
    .section-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
        line-height: 1.5;
    }
    
    /* Grid layouts - ensure single column on mobile */
    .features-grid, 
    .portal-features,
    .plans-options,
    .category-plans,
    .dashboard-grid,
    .performance-grid,
    .news-grid,
    .steps-grid,
    .signals-benefits-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 0.5rem;
    }
    
    /* Card optimization */
    .feature-card,
    .plan-option-card,
    .plan-category-card,
    .dashboard-card,
    .performance-card,
    .news-article,
    .step-card,
    .signals-benefit-card {
        margin: 0;
        padding: 1.5rem !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Feature cards specific */
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin: 0 auto 1rem;
    }
    
    .feature-card h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    /* AI/Signals hero mobile */
    .ai-hero,
    .signals-hero {
        padding: 2rem 0;
        overflow-x: hidden;
    }
    
    .ai-hero-content,
    .signals-hero-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        text-align: center;
        padding: 0 1rem;
    }
    
    .ai-hero-text h1,
    .signals-hero-text h1 {
        font-size: 2.2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
        word-wrap: break-word;
    }
    
    .ai-hero-subtitle,
    .signals-hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    .ai-stats,
    .signals-stats {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .ai-brain,
    .signals-chart {
        width: 150px;
        height: 150px;
        font-size: 3rem;
        margin: 0 auto;
    }
    
    /* Performance optimization */
    .performance-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
    
    .stat {
        text-align: center;
        padding: 0.75rem;
    }
    
    /* Trade items */
    .trade-item {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        text-align: center;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .trades-list {
        gap: 1rem;
    }
    
    /* News optimization */
    .news-filters {
        gap: 0.5rem;
        padding: 0 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-width: 80px;
        flex: 0 0 auto;
    }
    
    .sources-list {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    /* Terminal mobile optimization */
    .terminal-container {
        margin: 0 0.5rem;
        overflow-x: hidden;
    }
    
    .terminal-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 1rem;
    }
    
    .terminal-title {
        font-size: 0.9rem;
    }
    
    .ascii-logo {
        font-size: 0.4rem !important;
        line-height: 1.1;
        overflow-x: auto;
        white-space: pre;
    }
    
    .terminal-content {
        font-size: 0.75rem;
        max-height: 250px;
        overflow-y: auto;
    }
    
    /* Modal mobile optimization */
    .modal-overlay {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 0;
        max-width: 100%;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        width: 100%;
    }
    
    .modal-header {
        padding: 1rem;
        text-align: center;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-close {
        top: 1rem;
        right: 1rem;
    }
    
    /* Customer Panel Modal specific */
    #customer-panel-modal .modal-content {
        margin: 0.5rem;
        padding: 0;
    }
    
    #customer-panel-modal .customer-panel-content {
        padding: 1rem;
    }
    
    #customer-panel-modal .panel-description {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    #customer-panel-modal .auth-form {
        margin-bottom: 1.5rem;
    }
    
    #customer-panel-modal .form-group {
        margin-bottom: 1rem;
    }
    
    #customer-panel-modal .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        display: block;
    }
    
    #customer-panel-modal .form-group input {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.05);
        color: white;
    }
    
    #customer-panel-modal .btn-primary {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
        margin-top: 0.5rem;
    }
    
    #customer-panel-modal .panel-info {
        margin-top: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
    }
    
    #customer-panel-modal .info-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 0;
        font-size: 0.9rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    #customer-panel-modal .info-item:last-child {
        border-bottom: none;
    }
    
    #customer-panel-modal .info-item i {
        color: #8b5cf6;
        font-size: 1rem;
        width: 20px;
        text-align: center;
    }
    
    /* CTA sections mobile */
    .ai-cta,
    .terminal-cta,
    .cta-section {
        margin: 0 0.5rem;
        padding: 2rem 1rem;
        text-align: center;
    }
    
    .ai-cta h3,
    .terminal-cta h2 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .ai-cta p,
    .terminal-cta p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    /* Dashboard mobile specific */
    .dashboard-header {
        text-align: center;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }
    
    .dashboard-header p {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Prevent horizontal scroll - CRITICAL */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    html, body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Fix any potential overflow issues */
    .hero-content,
    .section-header,
    .ai-hero-content,
    .signals-hero-content,
    .terminal-container,
    .modal-content {
        overflow-x: hidden;
        word-wrap: break-word;
    }
    
    /* Form elements mobile */
    input, textarea, select, button {
        font-size: 16px !important; /* Prevents zoom on iOS */
        max-width: 100%;
    }
    
    /* Additional spacing fixes */
    .features,
    .portal-section,
    .how-it-works,
    .why-signals,
    .plans-selection,
    .plan-category-section,
    .news-section,
    .dashboard-section {
        padding: 2rem 0;
    }
    
    /* Ensure all sections have proper spacing */
    section {
        overflow-x: hidden;
    }
    
    /* Mobile navbar - handle overflow with scrolling if needed */
    @media (max-width: 480px) {
        .nav-menu {
            max-width: calc(100% - 180px);
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            -ms-overflow-style: none;
        }
        
        .nav-menu::-webkit-scrollbar {
            display: none;
        }
        
        .nav-link {
            font-size: 0.75rem;
            padding: 0.3rem 0.5rem;
        }
        
        .nav-logo svg {
            max-width: 100px !important;
            height: 25px !important;
        }
        
        .social-btn {
            width: 28px;
            height: 28px;
            font-size: 0.7rem;
        }
    }
} 