/* Mobile Optimization - February 17, 2026 */

/* Mobile devices (phones) */
@media (max-width: 768px) {
    /* Stack buttons vertically on mobile */
    .d-flex.gap-2 {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .d-flex.gap-2 button,
    .d-flex.gap-2 .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Responsive tables - horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }
    
    .table-responsive > .table {
        margin-bottom: 0;
    }
    
    /* Larger touch targets for buttons */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 0.5rem 0.75rem;
    }
    
    /* Reduce padding on cards for more space */
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    /* Stack columns on mobile */
    .row > [class*="col-"] {
        margin-bottom: 0.75rem;
    }
    
    /* Full width form controls */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    /* Reduce heading sizes */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Navigation improvements */
    .navbar {
        padding: 0.5rem;
    }
    
    /* Make alerts more compact */
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Compact table on mobile */
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    /* Hide less important table columns on mobile */
    .table .hide-mobile {
        display: none;
    }
    
    /* Better spacing for form groups */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    /* Adjust container padding */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Tablet devices */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
    }
    
    .table {
        font-size: 0.9375rem;
    }
}

/* Small phones (< 375px) */
@media (max-width: 374px) {
    .btn {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.375rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }
}

/* Landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .card {
        margin-bottom: 0.75rem;
    }
    
    h1, h2, h3 {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger clickable areas for touch */
    a, button, .btn, input[type="checkbox"], input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }
    
    /* Improve form element spacing */
    .form-check {
        padding: 0.75rem 0;
    }
    
    .form-check-input {
        width: 1.5rem;
        height: 1.5rem;
        margin-top: 0;
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix iOS input zoom */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Fix iOS button rendering */
    button,
    .btn {
        -webkit-appearance: none;
        border-radius: 0.375rem;
    }
}

/* Print styles for mobile */
@media print {
    /* Ensure tables print properly */
    .table {
        font-size: 10pt;
    }
    
    /* Show hidden mobile columns in print */
    .table .hide-mobile {
        display: table-cell !important;
    }
    
    /* Remove unnecessary elements */
    .btn,
    .navbar,
    .alert {
        display: none !important;
    }
}
