/* ==========================================================================
Table of contents:
1. General styling
2. Custom utils
    - Lightbox
3. Page specific styles
    - Gear pages
4. Compat styles for External Libraries (Select2, NoUISlider, Highcharts)
    - Select2 Tabler Theme Overrides
    - NoUISlider Tabler Theme Overrides
    - Highcharts Theme Adjustments
5. Mobile/desktop/print specific styles
==========================================================================  */


/* 1. GENERAL STYLES */
body {
    overflow-y: scroll;
}

/* HIDE INPUT NUMBER ARROWS */
/* Chrome, Safari, Edge, Opera */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}

.brand-unified {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.75rem;
    padding: 0;
}

.btn .fa,
.btn .fas,
.btn .far {
    vertical-align: middle;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Custom Backgrounds for Dark Mode compat */
.bg-secondary-lt {
    background-color: rgba(var(--tblr-secondary-rgb), 0.1) !important;
}

.bg-purple-lt {
    background-color: rgba(var(--tblr-purple-rgb), 0.1) !important;
}

.bg-blue-lt {
    background-color: rgba(var(--tblr-blue-rgb), 0.1) !important;
}

.bg-green-lt {
    background-color: rgba(var(--tblr-green-rgb), 0.1) !important;
}

.bg-tracker {
    height: 22px;

    background: url('/images/sprites/trackers.png');
    display: inline-block;
    background-repeat: no-repeat;
}

.bg-LB {
    width: 36px;
    background-position: -69px -5px;
}

.bg-boogie {
    width: 26px;
    background-position: -3px -5px;
}

.bg-flysight {
    width: 28px;
    background-position: -35px -5px;
}

.video {
    aspect-ratio: 16/9;
    width: 100%;
    height: 100%;
    min-width: 200px;
}

#goup {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    opacity: .5;
}

.border-dashed {
    border-style: dashed !important;
}

.cursor-pointer {
    cursor: pointer;
}

.bg-azure-lt {
    background-color: var(--tblr-azure-lt) !important;
}

.border-bottom-2 {
    border-bottom-width: 2px !important;
}

/* Min Height adjustment for compact headers */
.min-h-0 {
    min-height: 0 !important;
}

/* Scale down switches slightly for mobile density */
.scale-90 {
    transform: scale(0.9);
    transform-origin: left center;
}

.scale-75 {
    transform: scale(0.75);
    transform-origin: right center;
}

/* Cursor fix */
.cursor-pointer {
    cursor: pointer;
}

/* ============================================
                2. CUSTOM UTILS 
=============================================== */
/* Lightbox styles */
.lightbox {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}


.lightbox-content {
    position: relative;
    margin: auto;
    width: 90%;
    max-height: 80%;
    background: #000;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
}

.lightbox-close:hover {
    color: #ccc;
}



/* ============================================
            3. PAGE SPECIFIC STYLES 
========================================== */
/* Gear page cover gear image */

h1#gearName {
    margin-bottom: 0
}

.coverGear {
    max-width: 300px;
    width: 100%;
    height: auto;
    display: block;
}

#mobileGearAnchorBar {
    position: fixed;
    bottom: 70px;
    right: 20px;
    background-color: rgba(var(--tblr-body-bg-rgb), 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--tblr-border-color);
    border-radius: 0.5rem;
    z-index: 1020;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#mobileGearAnchorBar a {
    padding: 0.75rem 0.5rem;
    color: var(--tblr-secondary);
}



/* SCROLLBAR DARK MODE FIX */
[data-bs-theme="dark"] #scroll-top::-webkit-scrollbar-track,
[data-bs-theme="dark"] #scroll-bottom::-webkit-scrollbar-track {
    background: #1f2937;
    /* Dark background matching Tabler */
}

[data-bs-theme="dark"] #scroll-top::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] #scroll-bottom::-webkit-scrollbar-thumb {
    background: #4b5563;
    /* Dark Grey Handle */
    border-radius: 4px;
}

[data-bs-theme="dark"] #scroll-top::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark"] #scroll-bottom::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}





/* ==========================================================================
                    MINIMAL SLIDER THEME
========================================================================== */
.noUi-target {
    background: rgba(var(--tblr-body-color-rgb), 0.1);
    /* Subtle track */
    border: none;
    box-shadow: none;
    height: 2px;
    /* Thinner track */
}

.noUi-connect {
    background: var(--tblr-primary);
}

.noUi-handle {
    background: var(--tblr-bg-surface);
    /* Handle matches card background */
    border: 2px solid var(--tblr-primary);
    /* Ring border */
    box-shadow: none;
    width: 14px !important;
    /* Smaller */
    height: 14px !important;
    /* Smaller */
    border-radius: 50%;
    right: -7px !important;
    top: -6px !important;
    /* Centered on 2px track */
    cursor: grab;
    transition: transform 0.1s ease, border-color 0.1s ease;
}

.noUi-handle:active {
    cursor: grabbing;
    transform: scale(1.2);
    /* Visual feedback on press */
    background: var(--tblr-primary);
    /* Fill on press */
}

/* Remove default lines */
.noUi-handle:before,
.noUi-handle:after {
    display: none;
}


/* ==========================================================================
   SELECT2 TABLER THEME OVERRIDES (GLOBAL)
   Forces Select2 to respect Tabler CSS Variables and Dark/Light Modes
   ========================================================================== */

/* 1. The Main Selection Box (Single & Multiple) */
body .select2-container--default .select2-selection--single,
body .select2-container--default .select2-selection--multiple {
    background-color: var(--tblr-bg-surface) !important;
    border: 1px solid var(--tblr-border-color) !important;
    color: var(--tblr-body-color) !important;
    min-height: 2.5rem !important;
    border-radius: var(--tblr-border-radius) !important;
}

/* 2. Text Color & Alignment (Single) */
body .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--tblr-body-color) !important;
    line-height: 2.3rem !important;
    /* Vertically center text */
    padding-left: 0.75rem !important;
}

/* 3. The Dropdown Arrow */
body .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 2.4rem !important;
    right: 5px !important;
}

/* Arrow Color Logic */
body .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--tblr-muted) transparent transparent transparent !important;
}

body .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--tblr-muted) transparent !important;
}

/* 4. Focus State (Matches Tabler Blue Glow) */
body .select2-container--default.select2-container--focus .select2-selection--single,
body .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.25rem rgba(32, 107, 196, 0.25) !important;
    outline: 0 !important;
}

/* 5. The Dropdown Menu Wrapper */
body .select2-dropdown {
    background-color: var(--tblr-bg-surface) !important;
    border: 1px solid var(--tblr-border-color) !important;
    color: var(--tblr-body-color) !important;
    z-index: 1055 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* 6. The Search Input inside the dropdown */
body .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--tblr-bg-surface) !important;
    border: 1px solid var(--tblr-border-color) !important;
    color: var(--tblr-body-color) !important;
    border-radius: var(--tblr-border-radius) !important;
    padding: 0.375rem 0.75rem !important;
}

/* 7. Dropdown Options (Hover & Selected) */
/* Default Text Color */
body .select2-container--default .select2-results__option {
    color: var(--tblr-body-color) !important;
    padding: 6px 12px !important;
}

/* Hover / Highlighted State */
body .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--tblr-primary) !important;
    color: #fff !important;
}

/* Selected Option State */
body .select2-container--default .select2-results__option[aria-selected=true],
body .select2-container--default .select2-results__option--selected {
    background-color: var(--tblr-bg-surface-secondary) !important;
    color: var(--tblr-body-color) !important;
}

body .select2-container--default .select2-results__option--selected.select2-results__option--highlighted {
    background-color: var(--tblr-primary) !important;
    color: #fff !important;
}

/* 8. Multiple Select Chips/Tags */
body .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--tblr-bg-surface-secondary) !important;
    border: 1px solid var(--tblr-border-color) !important;
    color: var(--tblr-body-color) !important;
    border-radius: 4px !important;
    padding-left: 5px !important;
}

/* Remove 'x' on chips */
body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--tblr-muted) !important;
    border-right: 1px solid var(--tblr-border-color) !important;
    margin-right: 5px !important;
}

body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--tblr-danger) !important;
    background-color: transparent !important;
}

body .select2-container--open {
    z-index: 1061 !important;
}

body .select2-dropdown {
    z-index: 1061 !important;
}

/*      ============================
        Highcharts theme adjustments 
        ============================ */
.highcharts-series path {
    stroke-width: 1px !important;
}

.highcharts-plot-band-label {
    font-size: 12px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.6);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.signalLoss {
    fill: orange !important;
    fill-opacity: 0.2 !important;
}

.planePhase.highcharts-plot-band,
.landedPhase.highcharts-plot-band,
.phase-plane.highcharts-plot-band,
.phase-landed.highcharts-plot-band {
    fill: grey !important;
    fill-opacity: 0.03 !important;
}

.freefallPhase.highcharts-plot-band,
.phase-freefall.highcharts-plot-band {
    fill: aliceblue !important;
    fill-opacity: 0.05 !important;
}

.OpeningPhase.highcharts-plot-band,
.phase-opening.highcharts-plot-band {
    fill: yellow !important;
    fill-opacity: 0.05 !important;
}

.canopyPhase.highcharts-plot-band,
.phase-canopy.highcharts-plot-band {
    fill: green !important;
    fill-opacity: 0.05 !important;
}

.speed-fastest-3s.highcharts-plot-band {
    fill: rgb(255, 12, 12);
    fill-opacity: 0.1
}

.speed-scoring-end-line {
    stroke: red;
    stroke-width: 1px;
    stroke-dasharray: 4, 4;
}

/* 


/* Mobile specific styles */
@media (max-width: 767.98px) {
    #notif-drop {
        position: static !important;
    }

    #notif-drop .dropdown-menu {
        width: 94%;
        margin: 0 3%;
    }

    #notif-drop .dropdown-menu-arrow.dropdown-menu-end::before {
        right: calc(0.75em + 55px) !important;
    }

    .coverGear {
        margin: 0 auto 20px auto;
    }
}

/* Desktop specific styles */
@media (min-width: 768px) {
    #notif-drop {
        position: relative !important;
    }

    #notif-drop .dropdown-menu {
        width: 25rem;
    }

    .brand-unified {
        position: static !important;
        transform: none !important;
        margin-top: 0.5rem;
        padding-right: 1rem;
    }

    .coverGear {
        float: left;
        margin-right: 20px;
        margin-bottom: 20px;
    }

    #mobileGearAnchorBar {
        display: none;
    }

    h1#gearName {
        font-size: 2rem !important;
    }
}