/* Mobile Responsiveness Improvements */

/* =================================================================
   TABLE RESPONSIVENESS
   ================================================================= */

/* Make all tables horizontally scrollable on mobile */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    /* Wrap all tables in responsive containers */
    table {
        min-width: 600px; /* Prevent squishing */
    }
    
    /* Reduce table font size on mobile */
    table {
        font-size: 0.875rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
}

/* =================================================================
   GRID LAYOUTS - STACK ON MOBILE
   ================================================================= */

@media (max-width: 768px) {
    /* Economics waterfall grid */
    .economics-waterfall-row {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Assumptions grid (Mining Calculator) */
    .assumptions-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    /* Fleet analysis cards */
    .fleet-card-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Comparison cards */
    .asic-compare-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =================================================================
   CHART CONTAINERS - RESPONSIVE HEIGHT
   ================================================================= */

@media (max-width: 768px) {
    .chart-container {
        min-height: 250px !important;
        max-height: 350px !important;
    }
    
    /* Smaller charts on mobile */
    canvas {
        max-height: 300px !important;
    }
}

/* =================================================================
   FORM CONTROLS - TOUCH-FRIENDLY
   ================================================================= */

@media (max-width: 768px) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }
    
    /* Larger form inputs */
    input[type="text"],
    input[type="number"],
    input[type="password"],
    input[type="email"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Range sliders */
    input[type="range"] {
        height: 44px;
        padding: 12px 0;
    }
}

/* =================================================================
   NAVIGATION - MOBILE ADJUSTMENTS
   ================================================================= */

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 24px;
    }
    
    .beta-pill {
        font-size: 0.35rem;
        padding: 1px 6px;
    }
}

/* =================================================================
   CARDS - STACK ON MOBILE
   ================================================================= */

@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
}

/* =================================================================
   MODALS - FULL SCREEN ON MOBILE
   ================================================================= */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
}

/* =================================================================
   TYPOGRAPHY - REDUCE SIZES
   ================================================================= */

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    /* Page headers */
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header .subtitle {
        font-size: 0.875rem;
    }
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

/* Hide on mobile */
.d-mobile-none {
    display: block;
}

@media (max-width: 768px) {
    .d-mobile-none {
        display: none !important;
    }
}

/* Show only on mobile */
.d-mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .d-mobile-only {
        display: block !important;
    }
}

/* Stack columns on mobile */
.mobile-stack {
    display: flex;
}

@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column !important;
    }
    
    .mobile-stack > * {
        width: 100% !important;
        margin-bottom: 1rem;
    }
}
