body {
    background-image: url("/static/images/cells.b6c76bacaef1.jpg");
    background-repeat: repeat;
}

:root {
    --navbar-offset: 43px;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Main container should have flexible height */
.flex-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    height: 100%;
}

.main-wrapper {
    padding-top: var(--navbar-offset);
    padding-bottom: 2px;
    min-height: 100%;
    height: 100%;
}

.main-offset {
    padding-top: var(--navbar-offset);
}

/* Ensures content takes up available space */
.flex-grow-1 {
    flex-grow: 1;
    min-height: 0; /* Important for flexbox to work properly */
}

/* Footer with fixed height */
.footer {
    height: 25px;
    flex-shrink: 0;
}

.sidebar-nav {
    margin-top: 20px;
    padding: 0;
    list-style: none;
}

#googleMap {
    width: 100%;
    height: 100%;
}

.gmap_canvas {
    overflow:hidden;
    background:none!important;
    height:500px;
    width:100%;
}

/* table of the list of Operators */
.tableFixHead          { overflow: auto; height: 600px; }
.tableFixHead thead th { position: sticky; top: 0; z-index: 1; }

/* table of Search */
/*.tableFixHead2          { overflow: auto; } /*height: 280px; }*/
/*.tableFixHead2 thead th { position: sticky; top: 0; z-index: 1; } */

/* Just common table stuff. */
table  { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 16px; }
th     { background:#eee; }

/* historic cells search */
#to, #from, #toLb, #fromLb { display: none; }

/* transparency */
div.card { background-color: rgba(0, 0, 0, 0.5); }

/* button transparency - same style as cards */
.btn-dark {
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.btn-dark:hover {
    background-color: rgba(0, 0, 0, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* placeholder text color */
::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
    color: grey;
    opacity: 1; /* Firefox */
}
:-ms-input-placeholder { color: grey; } /* Internet Explorer 10-11 */
::-ms-input-placeholder { color: grey; } /* Microsoft Edge */

/* for under construction / coming soon */
.bgimg {
    color: darkgray;
    font-family: "Courier New", Courier, monospace;
    font-size: 25px;
}
.middle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* Operation table icons */
.poi-icon {
    transition: transform 0.2s;
}

.poi-icon:hover {
    transform: scale(1.2);
}

/* icon preview */
#iconPreview {
    display: flex;
    justify-content: center;
    padding: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* select with icons */
.select-with-icons {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-left: 40px !important;
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 24px 24px;
}

/* select options */
.select-with-icons option {
    padding-left: 40px;
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 24px 24px;
}

/* Modal styles */
.modal-content.bg-dark {
    background-color: #343a40;
    color: white;
}

/* Form controls in dark mode */
.form-control.bg-secondary, .form-select.bg-secondary {
    background-color: #495057 !important;
    color: white !important;
    border-color: #6c757d;
}

/* Close button in modal */
.btn-close.btn-close-white {
    filter: invert(1);
}

/* Map container */
#poiMap {
    min-height: 500px;
}

/* Icon preview */
#iconPreview img {
    max-width: 32px;
    max-height: 32px;
}

/* Styles for draggable separator between map and results table */
.min-vh-400 {
    min-height: 400px;
}

.vh-75 {
    height: 75vh;
}

.cursor-row-resize {
    cursor: row-resize;
}

.user-select-none {
    user-select: none;
}

/* Ensure maps spans all height */
.mapouter .rounded {
    width: 100% !important;
    height: 100% !important;
    position:relative;
    text-align:right;
}

/* Cell count badge over map (bottom-left) */
.map-cell-count-badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 5;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 0.85rem;
    line-height: 1.2;
    pointer-events: none;
}

.d-flex.flex-column {
    min-height: 0 !important; /* IMPORTANT: Allows flexbox shrinking */
}

#mapPanel, #tablePanel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/*.tableFixHead, */ .tableFixHead2 {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.table-responsive {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* The table must occupy the entire available height */
.table-responsive table {
    height: 1px; /* Trick to make the table expand */
    min-height: 100%;
}

.table-responsive tbody {
    flex: 1 1 auto;
}

/* Global loading overlay for long-running search/result page transitions */
.page-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.page-loading-overlay.show {
    display: flex;
}

.page-loading-text {
    color: #f2f2f2;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

body.is-loading {
    cursor: progress;
}

/* Removes any fixed height that may be limiting */
.card, .card-body, .container-fluid, .row {
    min-height: 0 !important;
}

/* Ensures all flex elements are the correct height */
.h-100 {
    min-height: 0 !important;
}

/* Fixed headers */
.table-dark {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Removes extra margins */
.table {
    margin-bottom: 0 !important;
}

/* Ensures cells are of consistent size */
th, td {
    white-space: nowrap;
    vertical-align: middle;
}

/* Main container */
.flex-container {
    display: flex;
    flex-direction: column;
    min-height: 0; /* CRITICAL */
}

/* Compact navbar height without changing logo image size */
.navbar.nav-fill {
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
}

.navbar.nav-fill .navbar-brand {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex;
    align-items: center;
}

.navbar.nav-fill .nav-link {
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}

.navbar.nav-fill .navbar-toggler {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

/* Navbar dropdown items: match navbar color exactly with same hover effect */
.navbar .dropdown-menu {
    background-color: #212529 !important;
    border: none !important;
    box-shadow: none;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.navbar .dropdown-menu .dropdown-item {
    color: #d0d4da !important;
    background-color: transparent !important;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item:focus {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
}

/* Operation dropdown sometimes uses <p class="dropdown-item ..."> */
.navbar .dropdown-menu p.dropdown-item {
    cursor: pointer;
}

/* Align search button height with input field */
form input#userInput {
    height: 30px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border: 1px solid #ced4da !important;
}

form #searchButton {
    height: 36px !important;
    padding: 0.375rem 1.25rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

