/* NAVIGATION */

.navbar-nav .nav-link.active {
    font-weight: bold;
}

.navbar-nav .nav-link i {
    margin-right: 0.2em;
}

/* In embedded mode, hide header/footer/settings. "#header div" is kind of janky but for some reason if we hide the
whole of #header, the map vertical sizing breaks. */
[embedded-mode=true] #header div, [embedded-mode=true] #footer,
[embedded-mode=true] #settingsButtonRow, [embedded-mode=true] #settingsButtonRowMap {
    display: none;
}

/* Display floating footer in embedded mode only */
#embeddedModeFooter {
    display: none;
    position: fixed;
    bottom: 0;
    right: 0;
    background: var(--bs-body-bg);
    border-radius: 1em 0 0 0;
    font-size: 0.9em;
    border-top: 1px solid grey;
    border-left: 1px solid grey;
}

[embedded-mode=true] #embeddedModeFooter {
    display: block;
}

#embeddedModeFooter img.logo {
    position: relative;
    top: -2px;
}

/* Invert logo colours in dark mode */
[data-bs-theme=dark] .logo {
    filter: invert(100%) hue-rotate(180deg) brightness(80%);
}


/* INTRO/WARNING BOXES */

.permanently-dismissible-box {
    display: none;
}


/* GENERAL PAGE LAYOUT */

div.container {
    display: grid;
    grid-template-rows:auto 1fr auto;
    grid-template-columns:100%;

    /* fallback height */
    min-height: 100vh;

    /* new small viewport height for modern browsers */
    min-height: 100svh;
}

[embedded-mode=true] div.container {
    width: 100% !important;
    max-width: 100% !important;
}


/* ABOUT PAGE */

#info-container {
    width: 100%;
}

@media (min-width: 768px) {
    #info-container {
        max-width: 60em;
        margin: 0 auto;
    }
}


/* SPOTS/ALERTS PAGES, SETTINGS/STATUS AREAS */

input#search {
    max-width: 12em;
    padding-left: 2em;
}

i#searchicon {
    position: absolute;
    left: 0;
    top: 2px;
    padding: 10px;
    pointer-events: none;
}

div.appearing-panel {
    display: none;
}


/* SPOTS/ALERTS PAGES, MAIN TABLE */

td.nowrap, span.nowrap {
    text-wrap: nowrap;
}

span.flag-wrapper {
    display: inline-block;
    width: 1.8em;
    text-align: center;
    cursor: default;
}

img.flag {
    position: relative;
    top: -2px;
}

span.band-bullet {
    display: inline-block;
    cursor: default;
    padding-right: 0.2em;
}

span.icon-wrapper {
    display: inline-block;
    width: 1.5em;
    text-align: center;
    cursor: default;
}

span.freq-mhz {
    font-weight: bold;
}

span.freq-mhz-pad {
    display: inline-block;
    min-width: 1.7em;
    text-align: right;
}

span.freq-khz {
    padding: 0 0.2em;
}

span.freq-hz {
    font-size: 0.8em;
}

span.mode-q, span.bearing-q {
    padding-left: 0.5em;
    font-size: 0.7em;
    color: lightgray;
}

a.dx-link {
    color: var(--bs-emphasis-color);
    text-decoration: none;
    font-weight: bold;
}

a.sig-ref-link {
    color: var(--bs-emphasis-color);
    text-decoration: none;
}

/* QRT/faded styles */
tr.table-faded td {
    filter: grayscale(100%) opacity(30%) !important;
    text-decoration: line-through !important;
}

tr.table-faded td span {
    text-decoration: line-through !important;
}

/* New spot styles */
tr.new td {
    animation: 2s linear newspotanim;
}

@keyframes newspotanim {
    0% {
        background-color: var(--bs-success-border-subtle);
    }
    100% {
        background-color: initial;
    }
}


/* TABLE */
#table-container {
    border-radius: 5px;
    border: 1px solid var(--bs-primary-border-subtle);
    overflow: hidden;
}

#table-container table {
    margin-bottom: 0;
}


/* MAP */
div#map {
    width: auto;
    height: 100%;
    margin: 0;
    overflow: hidden;
    cursor: default;
    font-size: 16px;
}

#settingsButtonRowMap {
    position: relative;
    z-index: 1002;
}

.leaflet-container {
    font-family: var(--bs-body-font-family) sans-serif !important;
}

.leaflet-control-attribution {
    background: none;
}

/* Make buttons overlaid on the map have a non-transparent fill so you can see the text better */
.btn-outline-secondary {
    --bs-btn-bg: var(--bs-body-bg) !important;
}


/* BANDS PANEL */

div#bands-container {
    min-height: 64em;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
    overscroll-behavior-x: none;
}

#bands-table {
    min-width: 100%;
}

#bands-table th {
    width: 20%;
    max-height: 40px;
    min-width: 12em;
    padding: 0.5em;
    text-align: center;
    font-weight: bold;
}

#bands-table td {
    width: 20%;
    min-width: 12em;
    height: 62em;
}

div.band-container {
    height: 62em;
    width: 20%;
    min-width: 12em;
    position: relative;
}

div.band-markers {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 13;
    border-left: 2px dotted black;
}

div.band-spots {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 15;
}

canvas.band-lines-canvas {
    width: 5em;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 11;
}

div.band-spot {
    position: absolute;
    left: 5em;
    padding: 0 0.25em;
    background-color: white;
    border-radius: 3px;
    cursor: default;
}

[data-bs-theme=dark] div.band-spot {
    background-color: black;
}

div.band-spot:hover {
    z-index: 999;
}

div.band-spot span.band-spot-call {
    display: inline;
}

div.band-spot:hover span.band-spot-call {
    display: none;
}

div.band-spot span.band-spot-info {
    display: none;
}

div.band-spot:hover span.band-spot-info {
    display: inline;
}


/* UTILITY CLASSES */

/* For elements initially hidden and shown/hidden by JS. Unlike Bootstrap's d-none this has no !important,
   so jQuery's .show() / .hide() / .toggle() can override it with an inline style as expected. */
.js-hidden {
    display: none;
}

.table-fixed-on-desktop {
    table-layout: fixed;
}

.input-narrow {
    max-width: 8em;
}

.input-medium {
    max-width: 12em;
}

/* Pushes a submit button down to align with labelled inputs in a flex row */
.mt-2em {
    margin-top: 2em;
}


/* GENERAL MOBILE SUPPORT */

@media (max-width: 991px) {
    /* General "hide this on mobile" class */
    .hideonmobile {
        display: none !important;
    }

    /* Make map stretch to horizontal screen edges */
    div#map, div#table-container, div#bands-container {
        margin-left: -1em;
        margin-right: -1em;
    }

    /* Avoid map page filters panel being larger than the map itself */
    #settingsButtonRowMap .appearing-panel {
        max-height: 30em;
    }

    #settingsButtonRowMap .appearing-panel .card-body {
        max-height: 26em;
        overflow: scroll;
    }

    input#search {
        max-width: 7em;
    }

    .table-fixed-on-desktop {
        table-layout: auto !important;
    }
}

@media (min-width: 992px) {
    .hidenotonmobile {
        display: none !important;
    }
}