/* Basic Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding-bottom: 40px;
}

.container-fluid {
    max-width: 1400px;
}

h1 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

h3 {
    color: #3498db;
    margin-top: 1.5rem;
}

/* Filter Area */
.filters {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    border: 1px solid #e9ecef;
}

/* View Toggle Switch */
.view-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    border: 1px solid #e9ecef;
    max-width: 400px;
    margin: 0 auto 20px;
}

.view-label {
    font-weight: 500;
    color: #6c757d;
    padding: 5px 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.view-label.active {
    color: #3498db;
    font-weight: 600;
}

.view-toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin: 0 15px;
}

.view-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.view-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9ecef;
    transition: .4s;
    border-radius: 34px;
    border: 1px solid #ced4da;
}

.view-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .view-toggle-slider {
    background-color: #3498db;
}

input:focus + .view-toggle-slider {
    box-shadow: 0 0 1px #3498db;
}

input:checked + .view-toggle-slider:before {
    transform: translateX(29px);
}

/* Navigation (keeping for backward compatibility) */
.nav-pills .nav-link {
    color: #495057;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-right: 8px;
}

.nav-pills .nav-link.active {
    background-color: #3498db;
}

/* Text View */
.accordion-button:not(.collapsed) {
    background-color: #e9f2fa;
    color: #2c3e50;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

.accordion-button {
    background-color: #f8f9fa;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding-right: 40px; /* Space for the accordion arrow */
}

/* Accordion button content layout */
.accordion-item-content {
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0; /* Allows flex items to shrink below content size */
}

.timestamp-section {
    flex: 0 0 180px; /* Fixed width */
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-section {
    flex: 1 1 300px; /* Changed to allow growing and shrinking with min-width of 300px */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
    max-width: 500px; /* Added max-width to prevent excessive growth */
}

.target-section {
    flex: 0 0 200px; /* Fixed width */
    white-space: nowrap; /* Changed back to nowrap to prevent line breaks */
    overflow: visible; /* Keep visible to show full text */
    text-overflow: clip; /* Keep clip to prevent ellipsis */
    padding: 0 10px;
}

.stats-section {
    flex: 0 0 auto; /* Auto width based on content */
    margin-left: auto; /* Push to the right */
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Responsive adjustments for accordion content */
@media (max-width: 991.98px) {
    .timestamp-section {
        flex: 0 0 160px;
    }
    
    .client-section {
        flex: 1 1 250px;
        max-width: 400px;
    }
    
    .target-section {
        flex: 0 0 180px;
        white-space: nowrap; /* Keep nowrap on smaller screens too */
        overflow: visible;
        text-overflow: clip;
    }
}

@media (max-width: 767.98px) {
    .accordion-item-content {
        flex-wrap: wrap;
    }
    
    .timestamp-section {
        flex: 0 0 100%;
        margin-bottom: 5px;
    }
    
    .client-section, 
    .target-section {
        flex: 1 1 auto;
    }
    
    .stats-section {
        flex: 0 0 100%;
        margin-top: 5px;
        margin-left: 0;
    }
}

.mtr-table {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    width: 100%;
    overflow-x: auto;
}

.mtr-header {
    font-weight: bold;
    background-color: #e9ecef;
    padding: 8px 0;
    border-radius: 4px;
    margin-bottom: 8px;
}

.hop-row {
    padding: 4px 0;
    border-bottom: 1px solid #efefef;
}

.hop-row:nth-child(odd) {
    background-color: #f9f9f9;
}

/* Chart Container */
.chart-container {
    height: 700px;
    width: 100%;
    position: relative;
}

/* Cards for Client/Target diagrams */
.card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,0.125);
    padding: 12px 16px;
}

.card-header h5 {
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-body {
    padding: 16px;
}

/* Tooltips */
.chart-tooltip {
    font-family: 'Courier New', monospace;
    white-space: pre;
    max-width: 400px;
    z-index: 1000;
}

/* Color Legend */
.color-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 6px;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .chart-container {
        height: 600px;
    }
}

@media (max-width: 767.98px) {
    .chart-container {
        height: 500px;
    }
    
    .card-header h5 {
        font-size: 0.9rem;
    }
    
    .mtr-table {
        font-size: 12px;
    }
    
    .nav-pills .nav-link {
        padding: 5px 10px;
        font-size: 14px;
    }
}

/* Info Texts */
.text-muted {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Gap Utilities */
.gap-3 {
    gap: 1rem !important;
}

/* Copy Link Button */
.copy-link-btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.copy-link-btn:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

.copy-link-btn i {
    font-size: 0.8rem;
}

/* Utilities for flexbox */
.d-flex {
    display: flex !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

.align-items-center {
    align-items: center !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

/* Time Picker Styles */
.time-picker-container {
    position: relative;
    width: 100%;
}

.time-picker-input {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background-color: var(--bs-accordion-btn-bg);
    color: var(--bs-body-color);
    background-clip: padding-box;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.time-picker-input:hover {
    background-color: #e9ecef;
}

[data-bs-theme=dark] .time-picker-input:hover {
    background-color: #495057;
}

.time-picker-input #selectedTimeRange {
    font-weight: 500;
    color: var(--bs-body-color);
}

.time-picker-input .calendar-icon {
    margin-left: 5px;
    margin-right: 5px;
}

/* Adjust badge in time picker */
.time-picker-input .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
}

.time-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    min-width: 280px;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-top: 1px solid var(--bs-border-color);
    border-radius: 0 0 0.25rem 0.25rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
    margin-top: -1px;
}

[data-bs-theme=dark] .time-picker-dropdown {
    background-color: #2c3034;
    color: #f8f9fa;
    border-color: #495057;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.time-picker-dropdown.show {
    display: block;
}

.time-picker-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 500;
}

.time-picker-body {
    padding: 0.5rem 0;
}

.time-range-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

.time-range-options li {
    padding: 0.375rem 1rem;
    cursor: pointer;
}

.time-range-options li:hover {
    background-color: #e9ecef;
}

[data-bs-theme=dark] .time-range-options li:hover {
    background-color: #495057;
}

.time-picker-divider {
    border-top: 1px solid var(--bs-border-color);
    margin: 0.5rem 0;
}

.absolute-time-form {
    padding: 0.75rem 1rem;
}

.time-field-group {
    margin-bottom: 15px;
}

.time-field-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--bs-body-color);
}

.time-field-group input[type="datetime-local"] {
    width: 100%;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: var(--bs-accordion-btn-bg);
    color: var(--bs-body-color);
}

.time-field-group input[type="datetime-local"]:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.time-picker-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--bs-border-color);
    text-align: right;
}

.time-picker-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
}

.apply-btn {
    background-color: #3498db;
    color: white;
    border: 1px solid #3498db;
}

.apply-btn:hover {
    background-color: #2980b9;
}

/* Dark mode variables and utilities */
:root {
    --bs-body-color: #212529;
    --bs-body-bg: #f5f5f5;
    --bs-card-bg: #fff;
    --bs-card-cap-bg: rgba(0,0,0,.03);
    --bs-accordion-btn-bg: #f8f9fa;
    --bs-accordion-active-bg: #e7f1ff;
    --bs-accordion-active-color: #0c63e4;
    --bs-border-color: #dee2e6;
    --filter-invert: 0;
}

[data-bs-theme=dark] {
    --bs-body-color: #f8f9fa;
    --bs-body-bg: #212529;
    --bs-card-bg: #2c3034;
    --bs-card-cap-bg: rgba(255,255,255,.03);
    --bs-accordion-btn-bg: #2c3034;
    --bs-accordion-active-bg: #0d6efd;
    --bs-accordion-active-color: #fff;
    --bs-border-color: #495057;
    --filter-invert: 1;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.card {
    background-color: var(--bs-card-bg);
    border-color: var(--bs-border-color);
}

.card-header {
    background-color: var(--bs-card-cap-bg);
    border-color: var(--bs-border-color);
}

.accordion-button {
    background-color: var(--bs-accordion-btn-bg);
    color: var(--bs-body-color);
}

.accordion-button:not(.collapsed) {
    background-color: var(--bs-accordion-active-bg);
    color: var(--bs-accordion-active-color);
}

.accordion-button::after {
    filter: invert(var(--filter-invert));
}

/* Custom Target Dropdown Styles */
.custom-target-select {
    position: relative;
    width: 100%;
}

.custom-target-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-top: 1px solid var(--bs-border-color);
    border-radius: 0 0 0.25rem 0.25rem;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: -1px;
}

[data-bs-theme=dark] .custom-target-dropdown {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.custom-target-display {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background-color: var(--bs-accordion-btn-bg);
    color: var(--bs-body-color);
    background-clip: padding-box;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-target-display:hover {
    background-color: #e9ecef;
}

[data-bs-theme=dark] .custom-target-display:hover {
    background-color: #495057;
}

.custom-target-display .dropdown-icon {
    margin-left: 5px;
}

.custom-target-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bs-body-bg);
}

.custom-target-item:hover {
    background-color: #e9ecef;
}

[data-bs-theme=dark] .custom-target-item:hover {
    background-color: #495057;
}

.custom-target-item.active {
    background-color: var(--bs-accordion-active-bg);
    color: var(--bs-accordion-active-color);
    font-weight: normal;
}

.target-count-badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #6c757d;
    border-radius: 10px;
    margin-left: 8px;
}

[data-bs-theme=dark] .target-count-badge {
    background-color: #495057;
}

.search-input {
    margin: 8px;
    padding: 6px;
    width: calc(100% - 16px);
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    background-color: var(--bs-accordion-btn-bg);
    color: var(--bs-body-color);
    box-sizing: border-box;
}

/* Chart placeholder in dark mode */
[data-bs-theme=dark] .chart-placeholder {
    background-color: #343a40;
    border-color: #495057;
}

/* Toggle styles for dark mode */
[data-bs-theme=dark] .toggle-container {
    background-color: #343a40;
    border-color: #495057;
}

[data-bs-theme=dark] .toggle-container:hover {
    background-color: #212529;
    border-color: #6c757d;
}

[data-bs-theme=dark] .toggle-label {
    color: #f8f9fa;
}

[data-bs-theme=dark] .view-toggle-container .toggle-label.active {
    color: #4dabf7;
}

/* Form controls in dark mode */
[data-bs-theme=dark] .form-select,
[data-bs-theme=dark] .form-control {
    background-color: #343a40;
    color: #f8f9fa;
    border-color: #495057;
}

[data-bs-theme=dark] .form-select:focus,
[data-bs-theme=dark] .form-control:focus {
    background-color: #3a4147;
    color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Filter section in dark mode */
[data-bs-theme=dark] .filters {
    background-color: #2c3034;
    border-color: #495057;
}

[data-bs-theme=dark] .form-label {
    color: #f8f9fa;
}

/* Dark mode styles for MTR output */
[data-bs-theme=dark] .mtr-header {
    background-color: #343a40;
    color: #f8f9fa;
}

[data-bs-theme=dark] .hop-row {
    border-bottom: 1px solid #495057;
    color: #f8f9fa;
}

[data-bs-theme=dark] .hop-row:nth-child(odd) {
    background-color: #2c3034;
}

[data-bs-theme=dark] .hop-row:nth-child(even) {
    background-color: #212529;
}

/* Original styles */
.copy-link-btn {
    cursor: pointer;
    color: #3498db;
    background-color: rgba(240, 240, 240, 0.8);
    border: 1px solid #e0e0e0;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

[data-bs-theme=dark] .copy-link-btn {
    color: #4dabf7;
    background-color: rgba(52, 58, 64, 0.8);
    border-color: #495057;
}

.copy-link-btn:hover {
    color: #2980b9;
    background-color: rgba(220, 220, 220, 0.9);
}

[data-bs-theme=dark] .copy-link-btn:hover {
    color: #74c0fc;
    background-color: rgba(73, 80, 87, 0.9);
}

.copy-link-btn i {
    margin-right: 5px;
}

.btn-container {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 10px;
}

.accordion-header {
    position: relative;
}

.accordion-body {
    position: relative;
}

/* Ensure loss% values have consistent width */
.loss-cell {
    display: inline-block;
    width: 60px;
    text-align: right;
}

/* Ensure latency ms values have consistent width */
.latency-cell {
    display: inline-block;
    width: 65px;
    text-align: right;
}

/* Placeholder for charts while loading */
.chart-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ced4da;
}

/* Reset CSS for toggle elements */
.toggle-row, .toggle-container, .toggle-section, .toggle-label, .view-toggle-switch {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main container for toggles */
.toggles-container {
    width: 100%;
    margin-bottom: 1rem;
}

/* Row containing both toggles */
.toggle-row {
    width: 100%;
    display: flex;
    align-items: center;
    height: 60px;
}

/* Sections within the row */
.toggle-section {
    flex: 1;
    display: flex;
    align-items: center;
}

.toggle-left {
    justify-content: flex-start;
}

.toggle-center {
    justify-content: center;
}

.toggle-right {
    justify-content: flex-end;
}

/* Toggle containers - identical styling */
.toggle-container {
    display: inline-flex;
    align-items: center;
    height: 44px;
    border: 1px solid #dee2e6;
    padding: 0 15px;
    border-radius: 6px;
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.toggle-container:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

/* Labels inside toggles */
.toggle-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    padding: 0 10px;
    display: flex;
    align-items: center;
    height: 24px;
}

/* Active state for view toggle labels */
.view-toggle-container .toggle-label.active {
    color: #2196F3;
    font-weight: 600;
}

/* Toggle switch styling */
.view-toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    margin: 0 5px;
}

.view-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.view-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.view-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .view-toggle-slider {
    background-color: #2196F3;
}

input:focus + .view-toggle-slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .view-toggle-slider:before {
    transform: translateX(24px);
}

/* Special mode styling */
.text-view-mode .toggle-center {
    flex: 0 0 100%;
}

/* Mobile responsiveness */
@media (max-width: 991.98px) {
    .toggle-row {
        flex-direction: column;
        height: auto;
        gap: 15px;
        padding: 15px 0;
    }
    
    .toggle-section {
        width: 100%;
        justify-content: center;
    }
    
    .toggle-container {
        width: 100%;
        max-width: 300px;
    }
}

/* Extra specific styles for perfect alignment */
.view-toggle-container {
    transform: translateY(0) !important;
}

.stdev-toggle-container {
    transform: translateY(0) !important;
}

/* Make sure all elements have identical vertical position */
.toggle-container > .view-toggle-switch {
    position: relative;
    top: 0;
    display: flex;
    align-items: center;
}

/* Force both toggle containers to use identical positioning */
.toggle-container {
    position: relative;
    top: 0;
}

/* Dark mode toggle */
.theme-toggle-container {
    display: inline-flex;
    align-items: center;
    height: 32px;
    border: 1px solid var(--bs-border-color);
    padding: 0 10px;
    border-radius: 6px;
    background-color: var(--bs-accordion-btn-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    font-size: 0.8rem;
    margin-left: auto;
}

.theme-toggle-container:hover {
    background-color: var(--bs-accordion-active-bg);
    border-color: var(--bs-border-color);
    cursor: pointer;
}

.theme-toggle-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--bs-body-color);
    padding: 0 5px;
    display: flex;
    align-items: center;
    height: 24px;
}

[data-bs-theme=dark] .moon-icon {
    display: none;
}

[data-bs-theme=light] .sun-icon {
    display: none;
}

.page-header-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
}

.page-title {
    margin-bottom: 0;
}

/* Hop row inline styles converted to classes */
.hop-number {
    width: 40px; 
    text-align: right;
}

.hop-host {
    width: 200px; 
    margin-left: 10px;
}

.hop-loss-container {
    width: 80px; 
    text-align: center; 
    padding: 0 5px; 
    border-radius: 3px; 
    margin-right: 5px;
}

.hop-snt {
    width: 70px; 
    text-align: right;
}

.hop-latency-container {
    width: 80px; 
    text-align: right;
}

/* Color legend styles */
.color-legend-dot {
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    margin-right: 5px;
}

.color-legend-green {
    background-color: rgba(44, 121, 44, 1);
}

.color-legend-light-green {
    background-color: rgba(148, 198, 91, 1);
}

.color-legend-yellow {
    background-color: rgba(255, 233, 85, 1);
}

.color-legend-orange {
    background-color: rgba(246, 159, 67, 1);
}

.color-legend-red {
    background-color: rgba(235, 100, 89, 1);
}

.color-legend-stdev {
    background-color: rgba(128, 128, 128, 0.15); 
    border: 1px dashed rgba(128, 128, 128, 0.4); 
    margin-right: 5px; 
    margin-left: 5px;
}

/* Lazy chart container fixed height */
.lazy-chart-container {
    height: 700px;
}

/* Canvas full size */
.chart-canvas {
    display: none; 
    width: 100%; 
    height: 100%;
}

/* Custom Client Dropdown Styles */
.custom-client-select {
    position: relative;
    width: 100%;
}

.custom-client-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-top: 1px solid var(--bs-border-color);
    border-radius: 0 0 0.25rem 0.25rem;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: -1px;
}

[data-bs-theme=dark] .custom-client-dropdown {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.custom-client-display {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background-color: var(--bs-accordion-btn-bg);
    color: var(--bs-body-color);
    background-clip: padding-box;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-client-display:hover {
    background-color: #e9ecef;
}

[data-bs-theme=dark] .custom-client-display:hover {
    background-color: #495057;
}

.custom-client-display .dropdown-icon {
    margin-left: 5px;
}

.custom-client-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bs-body-bg);
}

.custom-client-item:hover {
    background-color: #e9ecef;
}

[data-bs-theme=dark] .custom-client-item:hover {
    background-color: #495057;
}

.custom-client-item.active {
    background-color: var(--bs-accordion-active-bg);
    color: var(--bs-accordion-active-color);
    font-weight: normal;
}

.client-count-badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #6c757d;
    border-radius: 10px;
    margin-left: 8px;
}

[data-bs-theme=dark] .client-count-badge {
    background-color: #495057;
}

.time-picker-input #selectedTimeRange {
    font-weight: 500;
    color: var(--bs-body-color);
}

.time-range-options li.selected {
    background-color: var(--bs-accordion-active-bg);
    color: var(--bs-accordion-active-color);
    font-weight: 500;
}

[data-bs-theme=dark] .time-range-options li.selected {
    background-color: var(--bs-accordion-active-bg);
    color: var(--bs-accordion-active-color);
}
