/* © 2026 Syntoon Holding BV. All rights reserved. */
/* Qupacity Application Styles */

/* Use fluid container for wider content - override Bootstrap's container max-widths */
.container {
    max-width: 1600px;
}

/* More compact spacing */
body {
    font-size: 0.875rem; /* 14px instead of 16px */
}

/* Smaller headings */
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.1rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

/* Compact form elements */
.form-control {
    font-size: 0.875rem;
    padding: 0.375rem 0.5rem;
}

.form-select {
    font-size: 0.875rem;
    padding: 0.375rem 2rem 0.375rem 0.5rem;
}

.form-control-sm {
    font-size: 0.8125rem;
    padding: 0.25rem 0.375rem;
}

.form-select-sm {
    font-size: 0.8125rem;
    padding: 0.25rem 1.75rem 0.25rem 0.375rem;
}

/* Compact buttons */
.btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
}

/* Compact tables */
.table {
    font-size: 0.875rem;
}

.table th, .table td {
    padding: 0.5rem;
}

.table-sm th, .table-sm td {
    padding: 0.3rem 0.5rem;
}

/* Table headers: theme-aware tinted background, visible in both light and dark themes */
.table thead th {
    --bs-table-bg: rgba(var(--bs-body-color-rgb), 0.075) !important;
    background-color: rgba(var(--bs-body-color-rgb), 0.075) !important;
}

/* Compact cards */
.card-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
}

.card-body {
    padding: 0.75rem;
}

/* Compact alerts */
.alert {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Align close button in compact alerts */
.alert .btn-close {
    padding: 0.625rem 0.75rem;
}

/* Compact badges */
.badge {
    font-size: 0.75rem;
}

/* Number inputs - hide spin buttons for cleaner look */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Input groups - more compact */
.input-group-text {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
}

/* Compact margins for form groups */
.mb-3 {
    margin-bottom: 0.75rem !important;
}

/* Navbar stays normal size for readability */
.navbar {
    font-size: 0.9375rem;
}

/* Breadcrumbs compact */
.breadcrumb {
    font-size: 0.8125rem;
    padding: 0.375rem 0;
    margin-bottom: 0.75rem;
}

/* Pagination compact */
.pagination {
    font-size: 0.875rem;
}

.page-link {
    padding: 0.375rem 0.625rem;
}

/* Modal headers */
.modal-header {
    padding: 0.75rem 1rem;
}

.modal-title {
    font-size: 1.1rem;
}

.modal-body {
    padding: 0.75rem 1rem;
}

.modal-footer {
    padding: 0.5rem 1rem;
}

/* Form labels more compact */
.form-label {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

/* Smaller form text/hints */
.form-text {
    font-size: 0.75rem;
}

/* Description text under fields */
small.text-muted {
    font-size: 0.75rem;
}

/* Global Search Modal */
#globalSearchModal .modal-content {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#globalSearchModal .modal-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

#globalSearchModal .input-group-text {
    color: var(--bs-secondary-color);
}

#globalSearchInput {
    font-size: 1rem;
}

#globalSearchInput:focus {
    box-shadow: none;
}

/* Search results */
.search-category {
    margin-bottom: 0.75rem;
}

.search-category:last-child {
    margin-bottom: 0;
}

.search-category-label {
    padding: 0.25rem 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
}

.search-result-item {
    border-radius: 0.25rem;
    color: var(--bs-body-color);
    transition: background-color 0.15s ease-in-out;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.search-result-item .search-result-name {
    font-weight: 500;
}

/* Keyboard shortcuts styling */
kbd {
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

/* Forecast tables - horizontal scrolling with auto-fit font shrinking */
.forecast-table {
    font-size: clamp(0.65rem, 1.5vw, 0.875rem);
}

.forecast-table th,
.forecast-table td {
    padding: 0.25rem 0.35rem;
    white-space: nowrap;
}

/* Ensure wide tables scroll horizontally */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* On small screens, make button groups stack */
@media (max-width: 575.98px) {
    /* Stack header action buttons on mobile */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 > div:last-child .btn {
        flex: 1 1 auto;
        min-width: 100px;
    }

    /* Make card headers stack on mobile */
    .card-header.d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start !important;
    }

    .card-header.d-flex > .btn,
    .card-header.d-flex > a.btn {
        align-self: stretch;
        text-align: center;
    }

    /* Compact forms on mobile */
    .row.mb-3 .col-md-6,
    .row.mb-3 .col-md-4,
    .row.mb-3 .col-md-3 {
        margin-bottom: 0.5rem;
    }

    /* Make definition lists stack on mobile */
    dl.row dt.col-sm-3,
    dl.row dt.col-sm-4 {
        padding-bottom: 0;
    }

    dl.row dd.col-sm-9,
    dl.row dd.col-sm-8 {
        margin-bottom: 0.5rem;
    }

    /* Smaller headings on mobile */
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.25rem; }
    h3, .h3 { font-size: 1.125rem; }

    /* Ensure modals don't overflow */
    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: 80px;
    }

    /* Back to top button - smaller on mobile */
    #backToTop {
        width: 40px !important;
        height: 40px !important;
        bottom: 10px !important;
        right: 10px !important;
    }

    #backToTop svg {
        width: 18px;
        height: 18px;
    }
}

/* Tablet adjustments */
@media (min-width: 576px) and (max-width: 991.98px) {
    /* Slightly smaller headings */
    h1, .h1 { font-size: 1.6rem; }

    /* Adjust container padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Chart containers - let Chart.js handle sizing within fixed-height wrappers */
.card-body canvas {
    max-width: 100%;
}

/* Navbar improvements for mobile */
@media (max-width: 991.98px) {
    .navbar-nav.align-items-center {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    /* Stack navbar controls better */
    .navbar-collapse .navbar-nav + .navbar-nav {
        border-top: 1px solid rgba(255,255,255,0.1);
        padding-top: 0.5rem;
        margin-top: 0.5rem;
    }

    /* Full width selects in collapsed navbar */
    .navbar-collapse select.form-select {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets on touch devices */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.375rem 0.75rem;
    }

    .form-control,
    .form-select {
        min-height: 44px;
    }

    .form-control-sm,
    .form-select-sm {
        min-height: 36px;
    }

    /* Larger checkboxes and radios */
    .form-check-input {
        width: 1.25em;
        height: 1.25em;
    }

    /* More space for table rows */
    .table td,
    .table th {
        padding: 0.75rem 0.5rem;
    }

    /* Dropdown items easier to tap */
    .dropdown-item {
        padding: 0.5rem 1rem;
    }

    /* Nav tabs easier to tap */
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Hide non-essential columns on small screens */
@media (max-width: 767.98px) {
    .d-table-cell-md-only {
        display: none !important;
    }

    /* List group items - ensure text wraps */
    .list-group-item {
        flex-wrap: wrap;
    }
}

/* Utility class for horizontally scrollable tables */
.table-scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Badge wrapping on small screens */
@media (max-width: 575.98px) {
    .badge {
        white-space: normal;
        text-align: left;
    }
}

/* Ensure alerts don't cause horizontal scroll */
.alert {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Action buttons in list items */
@media (max-width: 575.98px) {
    .list-group-item .btn-group {
        margin-top: 0.5rem;
        width: 100%;
    }

    .list-group-item .btn-group .btn {
        flex: 1;
    }
}

/* ==========================================================================
   CAPACITY BANDS & GAP STATUS
   ========================================================================== */

/* Bandwidth breakdown display for flex capacity */
.bandwidth-breakdown {
    font-size: 0.75rem;
    line-height: 1.3;
}

.bandwidth-breakdown i.bi {
    font-size: 0.7rem;
    vertical-align: middle;
}

/* Gap status badges in capacity tables */
.badge small {
    font-size: 0.65em;
    opacity: 0.85;
}
