/* static/css/styles.css */

/* Default variables (dark mode) */
:root {
    --font-family: 'Noto Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --line-height: 1.5;
    --font-weight: 400;
    --letter-spacing: 0.05em;
    --text-color: rgb(220, 217, 217);
    --text-color-form: rgb(18, 18, 18);
    --bg-color: rgb(18, 18, 18);
    --link-color: rgb(220, 217, 217);
    --link-hover-color: rgba(233, 88, 61, 0.66);
    --button-bg: rgba(233, 88, 61, 0.66);
    --button-hover-bg: rgb(220, 217, 217);
    --button-hover-text: rgba(233, 88, 61, 0.66);
    --navbar-bg: transparent;
    --navbar-border: 1px solid rgba(255, 255, 255, 0.1);
    --dropdown-bg: #242424;
    --primary-bg: rgb(30, 30, 30);
    --table-bg: rgb(30, 30, 30);
    --alt-bg: rgb(38, 39, 41);
    --hl-bg: #2f2f32;
    --table-hover-bg: #2f2f32;
    --table-border: rgba(255, 255, 255, 0.1);
    --accordion-hover-bg: rgb(38, 39, 41);
    --form-control-bg: rgb(220, 217, 217);
    --accent-color: rgb(233, 88, 61);
    --border-color: #585b5f;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --channel-btn-text: rgba(255, 255, 255, 0.53);
    --gray: rgb(117, 117, 117) !important;
    --light-gray-text: rgb(163, 163, 163) !important;
}

/* Light mode overrides */
:root.light-mode {
    --text-color: rgb(25, 25, 25);
    --text-color-form: rgb(25, 25, 25);
    --bg-color: rgb(240, 240, 240);
    --link-color: rgb(25, 25, 25);
    --link-hover-color: rgba(233, 88, 61, 1);
    --button-bg: rgba(233, 88, 61, 1);
    --button-hover-bg: rgba(233, 88, 61, 0.8);
    --button-hover-text: rgb(255, 255, 255);
    --navbar-border: 1px solid rgba(0, 0, 0, 0.1);
    --dropdown-bg: #ffffff;
    --primary-bg: rgb(255, 255, 255);
    --table-bg: rgb(245, 245, 245);
    --alt-bg: rgb(245, 245, 245);
    --table-border: #dbdbdb99;
    --table-hover-bg: rgba(154, 154, 154, 0.76);
    --hl-bg: #CACACCED;
    --accordion-hover-bg: rgba(154, 154, 154, 0.76);
    --form-control-bg: rgb(255, 255, 255);
    --accent-color: rgba(233, 88, 61, 1);
    --shadow-color: rgba(0, 0, 0, 0.15);
    --border-color: #dcdcdc;
    --channel-btn-text: rgba(0, 0, 0, 0.53);
    --gray: rgb(117, 117, 117) !important;
}

html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Edge, Internet Explorer */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Base styles */
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    min-width: 320px;
    min-height: 100vh;
    font-family: var(--font-family);
    letter-spacing: 0.04em;
    line-height: var(--line-height);
    font-weight: var(--font-weight);
    color: var(--text-color);
    background-color: var(--bg-color);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color-scheme: light dark;
}

h1 {
    font-size: 3.2em;
    line-height: 1.1;
}

/* Reusable utilities */
.border-radius-8 {
    border-radius: 8px;
}

.border-none {
    border: none !important;
}

.font-weight-500 {
    font-weight: 500;
}

.transition-bg-color {
    transition: background-color 0.25s;
}

.transition-color {
    transition: color 0.25s;
}

.cursor-pointer {
    cursor: pointer;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    color: var(--link-hover-color);
}

a i {
    background-color: transparent;
}

a i:hover {
    color: var(--link-hover-color);
    text-decoration: none;
}

a.channel-setting-btn {
    color: var(--channel-btn-text);
}

a.channel-setting-btn:hover {
    color: var(--primary-bg);
}

/* Buttons */
button,
input.button {
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 0.6em 1.2em;
    font-size: 1em;
    font-weight: 500;
    font-family: var(--font-family);
    background-color: var(--button-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s;
}

label.button {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.3em 0.6em;
    font-size: 1em;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s;
}

label.btn.button:hover {
    border: 1px solid var(--border-color);
    color: var(--button-bg);
}

.btn-check:checked + .btn, .btn.active, .btn.show, .btn:first-child:active, :not(.btn-check) + .btn:active {
    color: var(--button-bg);
    background-color: var(--table-hover-bg);
    border-color: var(--border-color);
}

button:hover,
.btn:hover,
input.button:hover {
    background-color: var(--button-hover-bg);
    color: var(--button-hover-text);
}

button:focus,
button:focus-visible {
    outline: 4px auto -webkit-focus-ring-color;
}

.btn.channel-btn {
    text-align: center;
    font-size: smaller;
    background-color: var(--dropdown-bg);
    padding: 3px 5px;
    min-width: 6em;
    border: 0;
    box-shadow: 1px 1px 3px #0000006b;
    transition: background-color 0.2s;
}

.btn.channel-btn:hover {
    background-color: var(--button-bg);
    color: var(--text-color);
    transition: background-color 0.3s;
}

.get-btn {
    background-color: #213547;
    color: var(--text-color);
}

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

/* Containers */
.body_background {
    background-color: var(--bg-color) !important;
}

.subzone-container {
    border: 1px solid var(--alt-bg);
    padding: 0.5em;
    border-radius: 8px;
}

.owner-search-container .owner-item[style*="display: none"] {
    display: none !important;
}

.channel-grid {
    border: 1px solid var(--table-border);
    padding: 0.2em 0.4em;
    border-radius: 8px;
}

.channel-details {
    border-left: 15px solid var(--border-color) !important;
}

.added-ctrl-container {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed var(--table-border);
    margin-bottom: 1rem;
}

.form-grouping {
    background-color: var(--primary-bg);
}

.channel-zones {
    border-bottom: 1px solid var(--table-border);
}

.zones-container {
    display: flex !important;
    max-height: 0;
    overflow: hidden;
}

.zones-container[style*="display: none"] {
    display: none !important;
}

.subzone-outer-container {
    display: flex !important;
    margin-bottom: 0;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-in-out;
}

.subzone-outer-container[style*="display: none"] {
    display: none !important;
}

/* Navbar */
.navbar {
    padding: 0.3rem 1.5rem;
    border-bottom: var(--navbar-border);
    background-color: var(--navbar-bg);
}

.navbar-brand {
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.5rem;
}

.navbar-brand:hover {
    color: var(--link-hover-color);
}

.nav-link {
    color: var(--text-color) !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s ease-in-out;
}

.nav-link:hover {
    color: var(--link-hover-color) !important;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.87)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Dropdowns */
.dropdown-menu {
    background-color: var(--dropdown-bg);
    border: none;
    box-shadow: 0 4px 6px var(--shadow-color);
    border-radius: 4px;
}

.dropdown-item {
    color: var(--text-color);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    color: var(--link-hover-color);
    background-color: rgba(0, 0, 0, 0.04);
}

/* Modals */
.modal-colour {
    background-color: var(--primary-bg);
}

.modal-header {
    border-bottom: 0;
    background-color: var(--button-bg);
}

.modal-custom-size {
    max-width: 80vw;
}

.modal-secondary-title {
    color: var(--primary-bg);
}

/* Accordion */
.accordion {
    border: 1px solid var(--border-color);
}

.accordion-collapse {
    transition: height 0.2s ease-in-out;
    overflow: hidden; /* Ensures content doesn’t spill during transition */
}

.accordion-collapse:not(.show) {
    height: 0;
}

.accordion-collapse.show {
    height: auto;
}

.accordion-item {
    background-color: var(--primary-bg);
    border: 1px solid #585b5f;
}

:root.light-mode .accordion-item {
    border: 1px solid #f2f2f2;
}

.accordion-button {
    color: var(--text-color);
    background-color: var(--primary-bg);
    font-weight: 500;
    font-size: 0.5em;
    padding: 0.5rem 2rem 0.5rem 1rem;
}

.accordion-button:focus {
    box-shadow: none;
}

.accordion-button:not(.collapsed) {
    /*font-weight: 600;*/
    /*font-size: 0.7em;*/
    letter-spacing: 0.05em;
    background-color: var(--button-bg);
    color: var(--text-color);
    box-shadow: none;
}

.channels-accordion.accordion-button:not(.collapsed) {
    letter-spacing: 0.05em;
    background-color: var(--primary-bg);
    color: var(--accent-color);
    box-shadow: none;
}

.accordion-button::after,
.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='var(--text-color)' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 16 16'%3E%3Cpath d='M2 5L8 11L14 5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 1.25rem;
}

.accordion-button:hover {
    background-color: var(--accordion-hover-bg);
}

.accordion-body {
    color: var(--text-color);
    background-color: var(--primary-bg);
    padding: 0;
}

/* Tables */
.table {
    margin-bottom: 0;
    border: 1px solid var(--table-border);
}

.table-dark {
    --bs-table-bg: var(--table-bg);
    --bs-table-color: var(--text-color);
    --bs-table-hover-bg: var(--table-hover-bg);
}

.table-dark-inactive {
    --bs-table-bg: var(--gray);
    --bs-table-color: var(--text-color-form);
    --bs-table-hover-bg: var(--gray);
}

.inactive-a {
    color: var(--text-color-form);
}

.selectable-row {
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.selectable-row:hover {
    background-color: var(--button-bg) !important;
    --bs-table-hover-bg: transparent !important;
}

.no-hover:hover {
    background-color: var(--primary-bg) !important;
    --bs-table-hover-bg: transparent !important;
}

/* Direct child overrides for Bootstrap table rows */
tr.selected-row > td,
tr.selected-row > th {
    background-color: var(--button-bg) !important;
}

/* Forms */
.form-control {
    background-color: var(--primary-bg);
    color: var(--text-color);
    border: 0;
}

.form-control::placeholder {
    color: var(--gray);
}

.form-checkbox {
    font-size: 1.938em !important
}

/* Attempt to target the calendar icon in Chrome/Safari */
input[type="date"]::-webkit-calendar-picker-indicator {
    color: var(--accent-color);
    filter: invert(48%) sepia(79%) saturate(2476%) hue-rotate(342deg) brightness(90%) contrast(89%);
    cursor: pointer;
}

/* For Firefox */
input[type="date"]::-moz-calendar-picker-indicator {
    color: var(--accent-color);
    filter: invert(48%) sepia(79%) saturate(2476%) hue-rotate(342deg) brightness(90%) contrast(89%);
    cursor: pointer;
}

.flatpickr-calendar {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid #ced4da;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.flatpickr-day.today {
    border-color: #0d6efd;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus {
    border-color: #86b7fe;
}

.numInputWrapper input {
    border-radius: 0.25rem;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgb(158, 66, 51, 72);
}

.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgb(158, 66, 51, 72);
}

.form-select:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.25rem rgb(158, 66, 51, 72);
}

.form-control:disabled {
    opacity: 0.5;
    background-color: var(--primary-bg)
}

.form-select:disabled {
    opacity: 0.5;
    background-color: var(--primary-bg)
}

#accordionSearch.form-control {
    color: var(--text-color-form);
    background-color: var(--form-control-bg);
    border: 0;
}

#tableSearch.form-control {
    color: var(--text-color-form);
    background-color: var(--form-control-bg);
    border: 0;
}

.light-mode #accordionSearch.form-control {
    border: 1px solid var(--border-color);
}

.light-mode #tableSearch.form-control {
    border: 1px solid var(--border-color);
}

.form-select {
    background-color: var(--primary-bg);
    color: var(--text-color);
    border: 0;
}

.input-group-text {
    background-color: var(--alt-bg);
    color: var(--text-color);
    width: 12em;
}

.input-group-text.short {
    width: 9.25em;
}

.form-opacity {
    background-color: #2f2f32;
    color: var(--text-color-form);
    opacity: 0.4;
    pointer-events: none;
}

.no-opacity {
    opacity: 1 !important;
}

.graph-datetime-select {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-weight: 500;
    font-size: 1em;
    border: 1px solid var(--table-hover-bg);
    min-height: auto;
    padding: 0 0 0 .1em;
    margin: 0;
}

.form-check-input:checked {
    background-color: #9e4233;
    border-color: #9e4233;
}

textarea.form-control {
    min-height: 150px;
}

/* Cards */
.card {
    background-color: var(--primary-bg);
    color: var(--text-color);
    border: 1px solid var(--navbar-border);
}

.card-header {
    background-color: var(--button-bg);
    border-bottom: 1px solid var(--navbar-border);
}

.card-header.clickable-header {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-weight: 400;
    padding: 0.25rem 0.5rem 0.25rem 0.5rem;
    border: 0;
    border-radius: 0;
}

.card-header.clickable-header:hover {
    background-color: var(--table-hover-bg);
    color: var(--text-color);
}

.card-header.clicked {
    background-color: var(--alt-bg) !important;
    border: 3px solid var(--button-bg);
    border-bottom: 0;
}

.card-header.clicked:hover {
    background-color: var(--primary-bg) !important;
}

.card-header.channel-card-header {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-weight: 400;
    padding: 0.25rem 0.5rem 0.25rem 0.5rem;
    border: 0;
    border-radius: 0;
}

.card-header.channel-card-header:hover {
    background-color: var(--table-hover-bg);
    color: var(--text-color);
}

/* nav-link for Channel Cards */
.nav-pills .nav-link.active {
    background-color: var(--table-hover-bg);
    color: var(--text-color) !important;
    border-bottom: 3px solid var(--button-bg);
}

.nav-pills .nav-link {
    /* border-radius: var(--bs-nav-pills-border-radius); */
    /* background-color: #2f2f32; */
    font-size: smaller;
    font-weight: 500;
    border-bottom: 3px solid var(--table-hover-bg);
    color: var(--gray) !important;
    padding: 0.5em .75em !important;
    border-radius: 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.card-header.controller-card-header {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-weight: 500;
    padding: 0.25rem 0.5rem 0.25rem 0.5rem;
    border: 0;
    border-radius: 0;
}

.card-header.controller-card-header:hover {
    background-color: var(--table-hover-bg);
    color: var(--text-color);
}

.card-header a:hover {
    color: var(--primary-bg);
}

.card-header-edit {
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.4em;
    padding-left: 0.2rem;
    border: 0;
    border-radius: 0.5rem;
}

.card-header-edit:active,
.card-header-edit:focus {
    background-color: var(--primary-bg);
    color: var(--text-color);
}

.alert {
    z-index: 99999;
    color: var(--text-color);
    font-weight: bolder;
    text-align: center;
    position: fixed;
    border-radius: 0;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 1;
}

.modal-alert {
    color: var(--text-color);
    font-weight: bolder;
    text-align: center;
    border-radius: 0;
    width: 100%;
    opacity: 0.94;
}

.permanent-alert {
    color: var(--text-color);
    font-size: larger;
    margin: .5rem;
    font-weight: bolder;
    text-align: center;
    border-radius: 0;
    width: 100%;
    opacity: 0.94;
}


.error {
    background-color: #b52323;
}

.success {
    background-color: #034808;
}

.warning {
    background-color: #b1740a;
}

.light-bg {
    background-color: var(--form-control-bg);
    color: rgba(25, 25, 25, 0.83);
}

.light-bg-hover:hover {
    background-color: var(--button-bg);
    color: rgba(25, 25, 25, 0.83);
}

.gray-text {
    color: var(--gray) !important;
}

.orange-text-table {
    --bs-table-color: var(--accent-color);
}

.orange-text {
    color: var(--accent-color) !important;
}

.gray-dark-bg-text {
    color: rgba(169, 162, 162, 1);
}

.gray-dark-bg-text:hover {
    color: var(--accent-color);
}

.gray-bg {
    background-color: rgb(117, 117, 117);
    color: rgb(30, 30, 30);
}

.contrast-background {
    background-color: var(--alt-bg) !important;
}

.contrast-background-rounded {
    background-color: var(--alt-bg);
    border-radius: 8px;
}

/* Borders */
.no_border {
    border: none !important;
}

.border-colour {
    border-color: #585b5f;
}

.border-lt-grey {
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.border-b-lt {
    border-bottom: 1px solid var(--border-color);
}

.border-b-lt-big {
    border-bottom: 15px solid var(--border-color);
}

.border-t-lt {
    border-top: 1px solid var(--border-color);
}

.orange-border {
    border: 1px solid var(--accent-color) !important;
}

.border-dashed {
    border: 2px dashed var(--navbar-border);
}

.light-mode .search-clear-btn {
    border: 1px solid #fdfdfd;
    border-left: 0;
}

.search-clear-btn {
    border: 0;
}

/* Layout and spacing */
.row.flex-column {
    flex-direction: column;
}

.width-90 {
    width: 90%;
}

.mb-2px {
    margin-bottom: 2px;
}

.mt-n1em {
    margin-top: -1em;
}

.nmt-6 {
    margin-top: -6px !important;
}

.active-container {
    padding-top: 10px;
}

.max-width-100 {
    max-width: 100%;
}

/* Icons and sizes */
.logo {
    width: 60px;
    height: auto;
    opacity: 0.7;
}

.input-icon {
    width: 2.4em;
}

.ch-input-length {
    min-width: 100px;
    width: 150px;
}

.details-label {
    min-width: 170px;
}

.coord-input-length {
    width: 80px;
}

.label-length {
    min-width: 140px;
}

.label-length-s {
    min-width: 100px;
}

.font-xxs {
    font-size: .7em;
    font-weight: 400;
}

.icon-size-sm {
    font-size: .6em;
}

.icon-size-md {
    font-size: .8em;
}

.icon-size-lg {
    font-size: 1.2em;
}

.icon-size-xl {
    font-size: 1.5em;
}

.icon-size-xxl {
    font-size: 2.8em;
}

.icon-size-date::before {
    font-size: 1.7em;
    vertical-align: middle;
    line-height: normal;
}

/* Miscellaneous */
.border-orange {
    border-color: var(--button-bg) !important;
}

.accordion-separator {
    /*border-bottom: 1px solid var(--border-color);*/
    height: 10px;
    background-color: var(--button-bg);
    margin-top: 1.25em;
}

.shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.htmx-indicator {
    max-height: 1px;
    display: none;
}

.htmx-request.htmx-indicator {
    display: flex !important;
    max-height: revert;
}

.htmx-request.spinner-container {
    margin: 30px 30px;
}

.date-time-selector {
    margin-left: 0;
}

.cursor-pointer:hover {
    background-color: var(--table-hover-bg);
    color: var(--text-color) !important;
}

.cursor-pointer:hover .orange-text {
    color: var(--text-color) !important;
}

#siteDetails.htmx-added {
    opacity: 0;
}

#siteDetails {
    opacity: 1;
    transition: opacity 300ms ease-in-out;
}

.slider-title {
    position: absolute;
    top: .5em;
    left: 1em;
}

.user-settings-dropdown {
    min-width: 2em;
}

/* Slide actions */
.actions-slide {
    height: 2em;
    display: flex;
    align-items: center;
    position: absolute !important;
    top: 1px;
    right: 2em;
    background-color: var(--primary-bg);
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.01s ease-in-out;
    z-index: 1000;
}

.interval-slide {
    height: auto;
    display: flex;
    align-items: center;
    position: absolute !important;
    top: 0;
    left: 4.85em;
    background-color: var(--primary-bg);
    padding: 0rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: transform 0.01s ease-in-out;
    z-index: 2;
    pointer-events: auto;
}

.interval-slide[style*="display: flex"] {
    pointer-events: none;
}

/* Settings toggle */
.settings-toggle {
    color: var(--text-color);
    position: relative !important;
}

.settings-toggle:hover {
    color: var(--link-hover-color);
}

.dropdown-toggle .small-padding {
    padding: 0.25rem 0.25rem !important;
}

/* Graph/Chart */
/*.card-changes-msg-container {*/
/*position: fixed;*/
/*bottom: 0;*/
/*width: 100%;*/
/*background-color: transparent;*/
/*}*/

/*.card-changes-msg {*/
/*    width: 80%;*/
/*    background-color: #1e1e1ecf;*/
/*    border-top-left-radius: 8px;*/
/*    border-top-right-radius: 8px;*/
/*}*/

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--bg-color);
    padding: 0 0.5em;
    box-shadow: 0 2px 6px 4px rgb(0 0 0 / 47%);
}

.page-container {
    padding-top: 120px;
}

.extra-top-padding {
    padding-top: 160px !important;
}

.date-range-selector {
    font-size: 1em !important;
}

.date-range-menu {
    min-width: fit-content;
}

.chart-container {
    border-radius: 8px;
    position: relative;
    height: 200px;
}

.chart-container-alert {
    border-radius: 8px;
    position: relative;
    height: 250px;
}


.nav-main-dropdown {
    min-width: 200px;
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: -100%;
    margin-top: 0;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-submenu > .dropdown-item::after {
    display: block;
    content: " ";
    float: right;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
    border-width: 5px 5px 5px 0;
    border-right-color: var(--text-color);
    margin-top: 5px;
    margin-right: -10px;
}

.dropdown-submenu-left {
    right: 100%;
    left: auto !important;
}

.dropdown-submenu:hover > .dropdown-item {
    background-color: var(--table-hover-bg);
}


.resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-color: rgba(204, 204, 204, 0.15);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    cursor: ns-resize;
}

.sidebar-panel {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;

    width: 0;
    z-index: 1050;
    background-color: var(--primary-bg);
    overflow-x: hidden;
    padding-top: 60px;
    transition: 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-panel .closebtn {
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 24px;
    text-decoration: none;
    color: #495057;
}

.sidebar-content {
    padding: 0;
}

.overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040; /* Just below the sidebar */
    display: none; /* Hidden by default */
}


.overlay-backdrop.show {
    display: block;
    opacity: 1;
}


.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Mobile first: 2 columns */
    gap: 1rem; /* Your exact spacing */
}


.channel-btn {
    position: relative;
    padding-right: 30px; /* Make room for the gear icon */
    text-align: left;
}

.channel-setting-btn {
    position: absolute;
    right: 5px;
    top: 47%;
    transform: translateY(-50%);
    cursor: pointer;
}

.channel-setting-btn i {
    font-size: 0.8em;
}


.sortable-ghost {
    opacity: 0.2;
    background: rgba(255, 43, 0, 0.41);
    border-radius: .5em;
}

.reason-textarea {
    transition: height 0.1s;
    min-height: 32px;
    max-height: 160px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    /* Add more styling as needed to match input fields */
}

.neg-30-my {
    margin-left: -30px !important;
    margin-right: -30px !important;
}

.small-text {
    font-size: 0.8em;
}

.form-text-small {
    font-size: 0.875em;
}

.actions-invalid {
    border: 2px solid #dc3545 !important;
    border-radius: 4px;
}

.red {
    color: #a80211;
}

.green {
    color: #008000;
}

/* Media queries */
@media (max-width: 560px) {
    :root {
        font-size: 12px;
    }

    .label-length {
        min-width: 100px;
    }

    .modal-custom-size {
        max-width: 100vw;
    }

    .hidden-small {
        display: none;
    }

    .sidebar-panel.open {
        width: 100%;
    }

    .table {
        font-size: 0.85em;
    }
}

/* Medium screens */
@media (min-width: 380px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .chart-container {
        height: 350px;
        position: relative;
        background-color: var(--bg-color);
    }

    .sidebar-panel.open {
        width: 100%;
    }
}

/* Medium screens */
@media (min-width: 576px) {
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .chart-container {
        height: 400px;
        position: relative;
        background-color: var(--bg-color);
    }
}

/* Larger screens */
@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(5, 1fr);
    }

    .chart-container {
        height: 450px;
        position: relative;
        background-color: var(--bg-color);
    }

    .sidebar-panel.open {
        width: 100%;
    }
}

/* Desktop screens */
@media (min-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(6, 1fr);
    }

    .chart-container {
        height: 500px;
        position: relative;
        background-color: var(--bg-color);
    }

    .sidebar-panel.open {
        width: 600px;
    }
}

/* Toggle switch for map address updates */
.map-address-toggle {
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
}

.map-address-toggle:hover {
    background-color: var(--alt-bg);
    border-color: var(--accent-color);
}

.map-address-toggle .form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.map-address-toggle .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(233, 88, 61, 0.25);
}

.map-address-toggle .form-check-label {
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.map-address-toggle .form-check-input:checked + .form-check-label {
    color: var(--accent-color);
    font-weight: 500;
}

.map-address-toggle .form-check-input:not(:checked) + .form-check-label {
    color: var(--light-gray-text);
}

/* Subtle animation for toggle state changes */
.map-address-toggle .form-check-input {
    transition: all 0.3s ease;
}

/* Extra large screens */
@media (min-width: 1515px) {
    .grid-container {
        grid-template-columns: repeat(11, 1fr);
    }

    .chart-container {
        height: 500px;
        position: relative;
        background-color: var(--bg-color);
    }
}