/* 
 * Mobile-First Responsive Utilities
 * Focus: Mobile devices (max-width: 768px)
 * Uses Bootstrap flex utilities
 */

/* ===== CRITICAL: Override fixed width from style.bundle.css ===== */
.bg-body {
    width: auto !important;
    max-width: 100% !important;
}

/* ===== Mobile Breakpoint (< 768px) ===== */
@media (max-width: 767.98px) {
    
    /* Touch-friendly inputs */
    .form-control,
    .form-select,
    .btn {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents iOS zoom on focus */
    }
    
    /* Cards - reduce padding on mobile */
    .card-body {
        padding: 1rem !important;
    }
    
    .card-header,
    .card-footer {
        padding: 0.75rem 1rem !important;
    }
    
    /* Stat cards - smaller text */
    .stat-card .fs-2,
    .fs-2x {
        font-size: 1.25rem !important;
    }
    
    .stat-card .symbol-50px,
    .symbol-50px {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Profile header - stack vertically */
    .profile-header-mobile {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .profile-header-mobile .symbol,
    .profile-header-mobile > div:first-child {
        margin: 0 auto 1rem auto !important;
    }
    
    /* Tabs - horizontal scroll */
    .nav-tabs-responsive,
    .nav-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs-responsive::-webkit-scrollbar,
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem !important;
    }
    
    /* Tables - allow horizontal scroll */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
    
    /* Modals - full width on mobile */
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0 !important;
    }
    
    /* Quick action cards - stack content */
    .quick-action-card .card-body {
        flex-direction: column !important;
        text-align: center;
    }
    
    .quick-action-card .symbol {
        margin: 0 0 0.75rem 0 !important;
    }
    
    /* Image cropper - smaller size */
    .crop-container,
    #cropper_box_mr2 {
        width: 280px !important;
        height: 280px !important;
    }
    
    /* Action buttons - stack on mobile */
    .btn-group-mobile-stack,
    .action-buttons-mobile {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .btn-group-mobile-stack .btn,
    .action-buttons-mobile .btn {
        width: 100% !important;
    }
    
    /* ID Card scaling */
    .id-card-container {
        transform: scale(0.85);
        transform-origin: top center;
    }
    
    /* Reduce font sizes */
    .fs-1 { font-size: 1.5rem !important; }
    .fs-2 { font-size: 1.25rem !important; }
    .fs-3 { font-size: 1.1rem !important; }
    
    /* Notification items - stack */
    .notification-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    /* Hide less important text on mobile */
    .d-mobile-none {
        display: none !important;
    }
    
    /* Footer - stack on mobile */
    .footer .container-fluid {
        flex-direction: column !important;
        text-align: center;
        gap: 0.5rem;
    }
    
    /* Aside toggle visible */
    .aside-mobile-toggle {
        display: flex !important;
    }
}

/* ===== Small mobile (< 576px) - Extra adjustments ===== */
@media (max-width: 575.98px) {
    
    /* Even more compact cards */
    .card-body {
        padding: 0.75rem !important;
    }
    
    /* Full width buttons */
    .btn-lg {
        width: 100%;
    }
    
    /* Smaller profile images */
    .symbol-100px,
    .symbol-lg-160px {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* Collapse long text */
    .text-truncate-mobile {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
