
/* Mobile Responsive Styles for ACLS Simulator */

/* Base mobile styles */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 0.5rem !important;
    }
    
    .container-fluid {
        padding: 0.5rem;
    }
    
    /* Header adjustments */
    .d-flex.p-3.align-items-center {
        padding: 0.5rem !important;
        flex-direction: row;
        justify-content: center;
        text-align: center;
    }
    
    .d-flex.p-3.align-items-center img {
        width: 30px;
        margin-right: 0.5rem;
    }
    
    .d-flex.p-3.align-items-center h2 {
        font-size: 1.5rem;
        margin: 0;
    }
    
    /* Main layout - stack vertically on mobile */
    .row.align-items-start {
        flex-direction: column;
        margin: 0;
    }
    
    .row.align-items-start .col-lg-8,
    .row.align-items-start .col-lg-4 {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1rem;
        padding: 0.5rem;
    }
    
    /* Scenario dropdown */
    .d-flex.flex-column.flex-md-row {
        flex-direction: column !important;
        gap: 0.5rem;
    }
    
    .selectpicker {
        width: 100% !important;
    }
    
    .form-check.form-switch {
        align-self: center;
        margin: 0.5rem 0;
    }
    
    /* Monitor container on mobile */
    #monitor-container {
        margin: 0.5rem 0;
        padding: 0.75rem !important;
    }
    
    #monitor {
        font-size: 0.9rem !important;
    }
    
    .timers-section {
        text-align: center;
        margin-bottom: 0.75rem;
    }
    
    .tools-section {
        justify-content: center;
        padding: 0.5rem !important;
    }
    
    /* Menu section adjustments */
    #menu .d-flex.flex-column.flex-md-row {
        flex-direction: column !important;
        gap: 0.75rem;
    }
    
    #menu .flex-fill {
        width: 100% !important;
    }
    
    #menu .d-flex.align-items-center {
        width: 100%;
    }
    
    #menu .d-flex.align-items-center img {
        width: 24px;
        height: 24px;
        margin-right: 0.5rem;
    }
    
    /* Action and drug selectors */
    #action, #drug {
        width: 100% !important;
        margin-top: 0.5rem;
    }
    
    /* Shell panel */
    #shell-panel {
        height: 250px;
        font-size: 12px;
        margin: 0.5rem 0;
        padding: 0.75rem;
    }
    
    /* Vital parameters */
    #vitalParam {
        font-size: 1rem !important;
        padding: 0.5rem;
    }
    
    #vitalParam .row {
        margin: 0;
    }
    
    #vitalParam .col-md-6 {
        padding: 0.25rem;
    }
    
    #vitalParam > div > div {
        margin-bottom: 0.5rem;
        text-align: center;
    }
    
    /* ECG image */
    #ecgImg {
        width: 100%;
        max-width: 300px;
        height: auto;
        margin: 0.5rem 0;
    }
    
    /* Timers */
    .caseTimer, .cprTimer {
        font-size: 1rem;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    /* Tools section */
    #tools {
        text-align: center;
        padding: 0.5rem !important;
    }
    
    #tools img {
        width: 30px;
        height: auto;
        margin: 0 0.25rem;
    }
    
    /* Log section */
    #logBox {
        margin: 0.5rem 0;
        padding: 0.75rem;
    }
    
    #logBox h5 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    #log {
        font-size: 13px;
        max-height: 300px;
        overflow-y: auto;
    }
    
    #log .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Labor data table */
    #labor {
        padding: 0.5rem;
    }
    
    #labor h4 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .table-responsive {
        font-size: 11px;
    }
    
    .table-responsive table {
        margin: 0;
    }
    
    .table-responsive td, 
    .table-responsive th {
        padding: 0.25rem;
    }
    
    /* Bootstrap select adjustments */
    .bootstrap-select {
        width: 100% !important;
    }
    
    .bootstrap-select .dropdown-toggle {
        height: auto !important;
        padding: 0.75rem !important;
        font-size: 14px !important;
        white-space: normal !important;
        text-align: left !important;
    }
    
    .bootstrap-select .dropdown-menu {
        max-height: 250px;
        overflow-y: auto;
        font-size: 14px;
    }
    
    .bootstrap-select .dropdown-item {
        padding: 0.75rem 1rem !important;
        white-space: normal !important;
    }
    
    /* Form switches */
    .form-check.form-switch {
        margin: 1rem 0;
        justify-content: center;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 0.5rem;
    }
}

/* ECG image */
    #ecgImg {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0.5rem 0;
    }
    
    /* Timers */
    .caseTimer, .cprTimer {
        font-size: 0.9rem;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    /* Tools section */
    #tools {
        text-align: center;
        padding: 0.5rem !important;
    }
    
    #tools img {
        width: 28px;
        height: auto;
        margin: 0 0.25rem;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-body {
        padding: 0.5rem;
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575px) {
    body {
        font-size: 12px;
        padding: 0.25rem !important;
    }
    
    .d-flex.p-3.align-items-center h2 {
        font-size: 1.25rem;
    }
    
    #shell-panel {
        height: 200px;
        font-size: 11px;
        padding: 0.5rem;
    }
    
    #vitalParam {
        font-size: 0.9rem !important;
    }
    
    .bootstrap-select .dropdown-toggle {
        font-size: 12px;
        padding: 0.5rem !important;
    }
    
    #tools img {
        width: 24px;
    }
    
    .caseTimer, .cprTimer {
        font-size: 0.8rem;
    }
    
    #monitor-container {
        padding: 0.5rem !important;
    }
    
    #logBox {
        padding: 0.5rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .row.align-items-start {
        flex-direction: row;
    }
    
    .row.align-items-start .col-lg-8 {
        flex: 2;
        margin-right: 0.5rem;
    }
    
    .row.align-items-start .col-lg-4 {
        flex: 1;
        margin-left: 0.5rem;
    }
    
    #shell-panel {
        height: 180px;
    }
    
    #monitor-container {
        padding: 0.5rem !important;
    }
}

/* Touch-friendly improvements */
@media (pointer: coarse) {
    .bootstrap-select .dropdown-toggle,
    button,
    .form-check-input {
        min-height: 44px;
        min-width: 44px;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
    
    .form-check-input {
        width: 44px;
        height: 24px;
    }
    
    .form-check-label {
        padding-left: 0.5rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    #tools img,
    .d-flex.p-3.align-items-center img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}
