/* Mobile/responsive fixes for all pages (Bootstrap 3) */

@media (max-width: 991px) {
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 8px;
        padding-right: 8px;
    }
    .masthead div[role="navigation"] {
        float: none !important;
        width: 100% !important;
        white-space: normal !important;
    }
    .masthead .nav-right > li {
        display: inline-block;
        width: auto;
    }
    h3.text-muted { font-size: 18px; }
    center > table.table { width: 100% !important; }
    img { max-width: 100%; height: auto; }
    .panel .panel-body { padding: 10px; }

    /* modals: inline style="width:800px" needs !important */
    .modal-dialog {
        width: auto !important;
        max-width: 96vw !important;
        margin: 10px auto !important;
    }
    .modal-content {
        max-width: 100%;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-body table, .modal-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-body img { max-width: 100% !important; height: auto !important; }
    input.form-control, select.form-control, textarea.form-control {
        max-width: 100%;
    }
    .form-profile input[type="text"],
    .form-profile input[type="password"],
    .form-profile input[type="email"],
    .form-profile select { max-width: 100% !important; }

    /* wide data tables scroll horizontally instead of breaking layout */
    table.table, table.datatable {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    table.table td, table.table th,
    table.datatable td, table.datatable th {
        word-break: break-word;
    }
    #divBtcAddresses { font-size: 1em !important; word-break: break-all; }
    #qrcodeImg { width: 160px !important; height: 160px !important; }
    #dataTable { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    #dataTable .table { min-width: 480px; }
    #dataTable td, #dataTable th { font-size: 12px; }

    /* filter / search blocks stack */
    .form-inline .form-group { margin-bottom: 8px; }
}

@media (max-width: 767px) {
    .modal { padding: 0 !important; }
    .modal-dialog {
        width: auto !important;
        max-width: none !important;
        margin: 8px !important;
    }
    .modal-content { max-height: calc(100vh - 16px); }
}

@media (max-width: 480px) {
    .masthead .nav-right > li > a { font-size: 12px; padding: 4px 6px !important; }
    td[style*="font-size: 30px"] span { font-size: 18px !important; }
    #qrcodeImg { width: 140px !important; height: 140px !important; }
    body { font-size: 13px; }
    table.table td, table.table th { font-size: 11px; padding: 4px !important; }
}
