/* Workshop Module - Mobile/Tablet Responsive Styles */

/* ============================================
   GENERAL RESPONSIVE UTILITIES
   ============================================ */

/* Hide on mobile */
@media (max-width: 767px) {
    .hidden-xs-custom { display: none !important; }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .hidden-sm-custom { display: none !important; }
}

/* ============================================
   DASHBOARD RESPONSIVE
   ============================================ */

/* Dashboard stat cards */
@media (max-width: 991px) {
    .wshop-dashboard .list-status {
        margin-bottom: 10px;
    }
    .wshop-dashboard .list-status a {
        padding: 10px !important;
    }
    .wshop-dashboard .list-status h4 {
        font-size: 12px !important;
    }
    .wshop-dashboard .list-status span {
        font-size: 14px !important;
    }
    .wshop-dashboard .list-status i {
        font-size: 18px !important;
    }
}

@media (max-width: 767px) {
    .wshop-dashboard .col-md-2 {
        width: 50% !important;
        float: left;
    }
    .wshop-dashboard .list-status a {
        flex-direction: column !important;
        text-align: center;
        padding: 8px !important;
    }
    .wshop-dashboard .list-status .col-md-10,
    .wshop-dashboard .list-status .col-md-11 {
        width: 100% !important;
        padding: 0;
    }
    .wshop-dashboard .list-status h4 {
        font-size: 10px !important;
        margin-top: 5px;
    }
}

/* ============================================
   SERVICE REMINDERS RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    /* Summary cards */
    .service-reminders-page .col-md-3 {
        width: 50%;
        float: left;
        margin-bottom: 10px;
    }
    .service-reminders-page .panel-body h3 {
        font-size: 24px;
    }
    
    /* Filter section */
    .service-reminders-page .mbot15 .col-md-3 {
        width: 50%;
        margin-bottom: 10px;
    }
}

@media (max-width: 767px) {
    .service-reminders-page .col-md-3 {
        width: 100%;
    }
    .service-reminders-page .mbot15 .col-md-3 {
        width: 100%;
    }
    
    /* Action buttons */
    .service-reminders-page .text-right {
        text-align: left !important;
        margin-top: 10px;
    }
    .service-reminders-page .text-right .btn {
        margin-bottom: 5px;
        display: block;
        width: 100%;
    }
    
    /* Table responsive */
    .service-reminders-page .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
    }
    .service-reminders-page .btn-group .btn-xs {
        padding: 4px 8px;
    }
}

/* ============================================
   SERVICE HISTORY REPORT RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    .service-history-page .col-md-3,
    .service-history-page .col-md-2 {
        width: 50%;
        float: left;
        margin-bottom: 10px;
    }
    .service-history-page .col-md-4 {
        width: 50%;
    }
}

@media (max-width: 767px) {
    .service-history-page .col-md-3,
    .service-history-page .col-md-2,
    .service-history-page .col-md-4 {
        width: 100%;
    }
    .service-history-page .btn {
        margin-bottom: 5px;
    }
}

/* ============================================
   REPAIR JOB FORM RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    /* Two column layout on tablet */
    .repair-job-form .col-md-6 {
        width: 100%;
    }
    .repair-job-form .col-md-4 {
        width: 50%;
    }
    .repair-job-form .col-md-3 {
        width: 50%;
    }
}

@media (max-width: 767px) {
    .repair-job-form .col-md-4,
    .repair-job-form .col-md-3,
    .repair-job-form .col-md-2 {
        width: 100%;
    }
    
    /* Service tracking section */
    .service-tracking-section .col-md-2,
    .service-tracking-section .col-md-3,
    .service-tracking-section .col-md-4 {
        width: 50%;
        float: left;
    }
}

/* ============================================
   TABLES RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    /* Make tables scrollable */
    .table-responsive {
        border: none;
    }
    
    /* Compact table cells */
    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    /* Stack action buttons vertically */
    .table .btn-group {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .table .btn-group .btn {
        margin: 1px 0;
    }
}

/* ============================================
   PANELS & CARDS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .panel_s {
        margin: 0 -15px;
        border-radius: 0;
    }
    .panel-body {
        padding: 10px;
    }
    
    /* Summary cards compact */
    .panel .panel-body.text-center h3 {
        font-size: 20px;
        margin: 5px 0;
    }
    .panel .panel-body.text-center p {
        font-size: 11px;
        margin: 0;
    }
}

/* ============================================
   FORMS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .form-group {
        margin-bottom: 10px;
    }
    
    /* Full width inputs */
    .form-control {
        font-size: 14px;
    }
    
    /* Bootstrap select */
    .bootstrap-select .btn {
        font-size: 14px;
    }
    
    /* Date inputs */
    .input-group-addon {
        padding: 6px 8px;
    }
}

/* ============================================
   BUTTONS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    /* Stack buttons on mobile */
    .btn-group-responsive {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    .btn-group-responsive .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Pull-right buttons */
    .pull-right.btn,
    .text-right .btn {
        float: none !important;
    }
}

/* ============================================
   MODALS RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .modal-dialog {
        margin: 10px;
        width: auto;
    }
    .modal-body {
        padding: 15px;
    }
    .modal-footer {
        padding: 10px 15px;
    }
    .modal-footer .btn {
        margin-bottom: 5px;
    }
}

/* ============================================
   CUSTOMER PORTAL RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
    .client-service-history .col-md-3 {
        width: 50%;
        float: left;
    }
    .client-service-history .col-md-4 {
        width: 50%;
    }
}

@media (max-width: 767px) {
    .client-service-history .col-md-3,
    .client-service-history .col-md-4 {
        width: 100%;
    }
    
    /* Vehicle cards */
    .client-service-history .panel-default {
        margin-bottom: 10px;
    }
}

/* ============================================
   CRON INFO BOX RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .alert code {
        display: block;
        margin-top: 5px;
        word-break: break-all;
        font-size: 11px;
    }
}

/* ============================================
   REPAIR JOB DETAIL RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    /* Tab navigation */
    .nav-tabs > li {
        width: 50%;
        text-align: center;
    }
    .nav-tabs > li > a {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    /* Info sections */
    .repair-job-detail .col-md-6 {
        width: 100%;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print,
    .btn,
    .nav-tabs,
    .sidebar,
    #header {
        display: none !important;
    }
    .panel_s {
        border: none;
        box-shadow: none;
    }
}

/* ============================================
   TOUCH FRIENDLY
   ============================================ */

@media (max-width: 991px) {
    /* Larger touch targets */
    .btn {
        min-height: 38px;
        padding: 8px 12px;
    }
    .btn-xs {
        min-height: 28px;
        padding: 5px 8px;
    }
    
    /* Checkbox/radio larger */
    input[type="checkbox"],
    input[type="radio"] {
        width: 18px;
        height: 18px;
    }
    
    /* Links more tappable */
    a {
        padding: 2px 0;
    }
}

/* ============================================
   LANDSCAPE TABLET OPTIMIZATION
   ============================================ */

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .wshop-dashboard .col-md-2 {
        width: 16.66%;
    }
    .service-reminders-page .col-md-3 {
        width: 25%;
    }
}

/* ============================================
   IPAD SPECIFIC
   ============================================ */

@media only screen 
and (min-device-width: 768px) 
and (max-device-width: 1024px) {
    .panel-body {
        padding: 12px;
    }
    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: 10px 8px;
    }
}
