/* Custom CSS for Vizcam Web UI */

.station-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.station-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#image-viewer-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

#slider-image {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #000;
}

#image-info {
    font-size: 14px;
    color: #6c757d;
}

.table {
    font-size: 14px;
}

.table td {
    vertical-align: middle;
}

h1, h3 {
    color: #2c3e50;
}

.card-title {
    color: #2c3e50;
    font-weight: 600;
}

.card-text {
    font-size: 14px;
}

/* Make slider more visible */
.rc-slider {
    margin-bottom: 20px;
    margin-top: 20px;
}

.rc-slider-track {
    background-color: #007bff;
}

.rc-slider-handle {
    border-color: #007bff;
}

.rc-slider-handle:hover {
    border-color: #0056b3;
}

/* Video timeline slider */
.video-timeline-slider {
    height: 4px;
    padding: 0;
    margin: 2px 0 4px 0;
}

.video-timeline-slider .rc-slider-rail {
    background-color: rgba(255, 255, 255, 0.3);
    height: 3px;
}

.video-timeline-slider .rc-slider-track {
    background-color: #fff;
    height: 3px;
}

.video-timeline-slider .rc-slider-handle {
    border: 2px solid #fff;
    background-color: #fff;
    width: 10px;
    height: 10px;
    margin-top: -4px;
    opacity: 1;
}

.video-timeline-slider .rc-slider-handle:hover,
.video-timeline-slider .rc-slider-handle:active,
.video-timeline-slider .rc-slider-handle:focus {
    border-color: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    opacity: 1;
}

/* Video type badge on media cards */
.media-type-video-badge {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    line-height: 1;
}

/* Track context menu popover */
.popover {
    z-index: 1060;
}
.popover .list-group-item:hover {
    background-color: #e9ecef;
}
.popover .list-group-item {
    border: none;
}

/* Responsive: reduce whitespace on narrow/stacked layouts */
@media (max-width: 767.98px) {
    .media-viewer-image-container {
        height: auto !important;
        max-height: 70vh;
        margin-bottom: 20px;
    }
    .media-viewer-row {
        min-height: auto !important;
    }
}

/* Observations page – classification checklist */
.obs-classification-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
}
.obs-classification-checklist label {
    user-select: none;
}

/* ============================
   Dark mode overrides
   ============================ */

/* Smooth transition when switching themes */
[data-bs-theme] {
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Image viewer container */
[data-bs-theme="dark"] #image-viewer-container {
    background-color: #1a1d21;
}

/* Slider image border */
[data-bs-theme="dark"] #slider-image {
    border-color: #495057;
}

/* Image info text */
[data-bs-theme="dark"] #image-info {
    color: #adb5bd;
}

/* Headings */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h3 {
    color: #dee2e6;
}

[data-bs-theme="dark"] .card-title {
    color: #dee2e6;
}

/* "No media available" placeholder */
[data-bs-theme="dark"] .bg-light.text-muted {
    background-color: #2b3035 !important;
    color: #adb5bd !important;
}

/* Popover track context menu */
[data-bs-theme="dark"] .popover .list-group-item:hover {
    background-color: #343a40;
}

/* Date-picker overrides (Dash date picker uses its own styles) */
[data-bs-theme="dark"] .DateInput_input {
    background-color: #2b3035;
    color: #dee2e6;
    border-color: #495057;
}

[data-bs-theme="dark"] .DateRangePickerInput,
[data-bs-theme="dark"] .SingleDatePickerInput {
    background-color: #2b3035;
    border-color: #495057;
}

/* Dash dropdown overrides */
[data-bs-theme="dark"] .Select-control {
    background-color: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] .Select-menu-outer {
    background-color: #2b3035;
    border-color: #495057;
}

[data-bs-theme="dark"] .Select-value-label,
[data-bs-theme="dark"] .Select-placeholder,
[data-bs-theme="dark"] .Select-input input {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .VirtualizedSelectOption {
    background-color: #2b3035;
    color: #dee2e6;
}

[data-bs-theme="dark"] .VirtualizedSelectFocusedOption {
    background-color: #495057;
}

/* Dark mode toggle button styling */
.dark-mode-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    line-height: 1;
}

.dark-mode-toggle:hover {
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}

/* Slider tooltip text – adapts to theme */
.slider-tooltip {
    color: #333;
}
[data-bs-theme="dark"] .slider-tooltip {
    color: #dee2e6;
}

/* Media viewer image container */
.media-viewer-image-container {
    background-color: #fff;
}
[data-bs-theme="dark"] .media-viewer-image-container {
    background-color: #1a1d21;
}

/* Fullscreen modal background in dark mode */
[data-bs-theme="dark"] .modal-content {
    background-color: #212529;
}

/* Plotly charts: make them transparent so page bg shows through */
[data-bs-theme="dark"] .js-plotly-plot .plotly .main-svg {
    background: transparent !important;
}
