/* Mobile Responsive Styles for Workshop Management System */

/* ===== General Mobile Optimizations ===== */
@media (max-width: 768px) {
    /* Body and Container */
    body {
        font-size: 14px;
    }
    
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Cards */
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Buttons */
    .btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .btn-sm {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    /* Quick Actions on Dashboard */
    .quick-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .quick-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Statistics Cards */
    .col-md-3 {
        margin-bottom: 15px;
    }
    
    /* Tables - Make them scrollable */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 8px;
        white-space: nowrap;
    }
    
    /* Alternative: Card-style tables for mobile */
    .table-mobile-cards {
        display: block;
    }
    
    .table-mobile-cards thead {
        display: none;
    }
    
    .table-mobile-cards tbody {
        display: block;
    }
    
    .table-mobile-cards tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 10px;
        background: white;
    }
    
    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        white-space: normal;
    }
    
    .table-mobile-cards td:before {
        content: attr(data-label);
        font-weight: bold;
        margin-left: 10px;
    }
    
    /* Forms */
    .form-control {
        font-size: 14px;
    }
    
    .form-label {
        font-size: 13px;
        font-weight: 600;
    }
    
    /* Navbar */
    .navbar-brand {
        font-size: 16px;
    }
    
    .navbar-nav {
        margin-top: 10px;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Dropdown Menu */
    .dropdown-menu {
        font-size: 14px;
    }
    
    /* User Avatar in Navbar */
    .navbar .rounded-circle {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Alerts */
    .alert {
        font-size: 13px;
        padding: 10px;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* Filters and Search */
    .filter-section {
        margin-bottom: 15px;
    }
    
    .filter-section .form-control,
    .filter-section .btn {
        margin-bottom: 10px;
        width: 100%;
    }
    
    /* Action Buttons in Tables */
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Pagination */
    .pagination {
        font-size: 13px;
    }
    
    .page-link {
        padding: 5px 10px;
    }
    
    /* Dashboard Statistics */
    .card-title {
        font-size: 15px;
    }
    
    .card h2 {
        font-size: 24px;
    }
    
    /* Hide unnecessary elements on mobile */
    .d-mobile-none {
        display: none !important;
    }
    
    /* Stack form elements vertically */
    .row.g-3 > * {
        margin-bottom: 15px;
    }
    
    /* Improve spacing */
    .mb-4 {
        margin-bottom: 20px !important;
    }
    
    /* Fix long text overflow */
    .text-truncate {
        max-width: 150px;
    }
    
    /* Improve touch targets */
    a, button, .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Sticky header for tables */
    .table-responsive {
        max-height: 70vh;
    }
    
    .table thead th {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }
}

/* ===== Extra Small Devices (phones, less than 576px) ===== */
@media (max-width: 576px) {
    body {
        font-size: 13px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    h1, .h1 {
        font-size: 22px;
    }
    
    h2, .h2 {
        font-size: 20px;
    }
    
    h3, .h3 {
        font-size: 18px;
    }
    
    h4, .h4 {
        font-size: 16px;
    }
    
    h5, .h5 {
        font-size: 14px;
    }
    
    /* Make navbar fully collapsible */
    .navbar-collapse {
        max-height: 70vh;
        overflow-y: auto;
    }
    
    /* Full width buttons */
    .btn-group-vertical {
        width: 100%;
    }
    
    .btn-group-vertical .btn {
        width: 100%;
    }
}

/* ===== Landscape Mode Optimizations ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar-collapse {
        max-height: 50vh;
    }
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ===== Print Styles (don't affect mobile) ===== */
@media print {
    .mobile-only,
    .no-print {
        display: none !important;
    }
}
