/* Base Layout */
:root {
    /* Primary Colors */
    --optimotive-orange: #FE5000;
    --optimotive-orange-glow: rgba(254, 80, 0, 0.15);

    /* Greys and Blacks */
    --dark-bg: #0a0a0a;
    --darker-grey: #000000;
    --medium-grey: #2a2a2a;
    --light-grey: #404040;
}

/* Gauge pulsing animation for 0% values */
@keyframes pulseRedGauge {
    0% {
        filter: brightness(1) drop-shadow(0 0 3px rgba(220, 53, 69, 0.6));
        transform: scale(1);
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 0 8px rgba(220, 53, 69, 0.9));
        transform: scale(1.02);
    }
    100% {
        filter: brightness(1) drop-shadow(0 0 3px rgba(220, 53, 69, 0.6));
        transform: scale(1);
    }
}

/* Upload label hover effect */
.upload-label-hover {
    background: #e6470a !important;
    transition: background 0.2s ease;
}

.gauge-pulse-red canvas {
    animation: pulseRedGauge 2s infinite;
    transition: all 0.3s ease;
    border-radius: 50%;
}

/* Page background */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark-bg);
    z-index: -2;
    pointer-events: none;
}

/* Robot Asset Card Styling */
.robot-asset-card {
    background: #2a2a2a;
    border: 2px solid #404040;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.robot-asset-card:hover {
    border-color: #FE5000;
    background: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 80, 0, 0.2);
}

.robot-asset-card.selected {
    border-color: #FE5000 !important;
    background: #332a00 !important;
    box-shadow: 0 0 15px rgba(254, 80, 0, 0.4) !important;
}

.robot-asset-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.robot-asset-icon {
    font-size: 24px;
    color: #FE5000;
    width: 40px;
    text-align: center;
}

.robot-asset-details h6 {
    margin: 0;
    color: #ffffff;
    font-weight: 600;
}

.robot-asset-details small {
    color: #999999;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.robot-asset-location {
    color: #cccccc;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Priority styling for available robots */
.robot-asset-card.high-priority {
    border-left: 4px solid #28a745;
}

.robot-asset-card.medium-priority {
    border-left: 4px solid #17a2b8;
}

.robot-asset-card.low-priority {
    border-left: 4px solid #6c757d;
}

/* Asset Status Badge Colors - Force override Bootstrap defaults */
#siteAssets .badge.bg-success,
.badge.bg-success {
    background-color: #28a745 !important;
    color: white !important;
    border: none !important;
}

#siteAssets .badge.bg-warning,
.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
    border: none !important;
}

#siteAssets .badge.bg-danger,
.badge.bg-danger {
    background-color: #dc3545 !important;
    color: white !important;
    border: none !important;
}

#siteAssets .badge.bg-primary,
.badge.bg-primary {
    background-color: #007bff !important;
    color: white !important;
    border: none !important;
}

#siteAssets .badge.bg-secondary,
.badge.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
    border: none !important;
}



/* Service button styles */
.service-unit-btn {
    background: var(--optimotive-orange);
    border: 1px solid var(--optimotive-orange);
    color: white;
    transition: all 0.3s ease;
}

.service-unit-btn:hover:not(:disabled) {
    background: rgba(254, 80, 0, 0.8);
    border-color: var(--optimotive-orange);
    transform: translateY(-1px);
}

.service-unit-btn.disabled,
.service-unit-btn:disabled {
    background: #555555 !important;
    border-color: #555555 !important;
    color: #999999 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    transform: none !important;
}

.service-unit-btn.disabled:hover,
.service-unit-btn:disabled:hover {
    background: #555555 !important;
    border-color: #555555 !important;
    color: #999999 !important;
    transform: none !important;
}

/* Main content container */
.container {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

/* Map container */
#robotMap {
    position: relative;
    z-index: 4;
    pointer-events: all !important;
    cursor: default;
}

.leaflet-container {
    z-index: 4 !important;
    position: relative;
    background-color: #000 !important; /* Ensure dark background */
}

.leaflet-pane,
.leaflet-control {
    z-index: 5 !important;
    position: relative;
}

/* Custom marker styles - fixed size regardless of zoom */
.custom-marker {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.custom-marker div {
    position: relative;
    display: block;
}

/* Map Controls */
.map-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* 2D/3D Toggle buttons */
.map-type-button {
    background-color: #111 !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
    color: #ccc !important;
    transition: all 0.3s ease;
}

.map-type-button:hover {
    background-color: #222 !important;
    color: white !important;
}

.map-type-button.active {
    background-color: var(--optimotive-orange) !important;
    color: white !important;
    border-color: var(--optimotive-orange) !important;
    box-shadow: 0 0 10px rgba(254, 80, 0, 0.5);
}

/* Fullscreen button */
.fullscreen-button {
    background-color: #111 !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
    transition: all 0.3s ease;
}

.fullscreen-button:hover {
    background-color: #222 !important;
    color: white !important;
}

/* Draw button */
.draw-button {
    background-color: #111 !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
    transition: all 0.3s ease;
}

.draw-button:hover {
    background-color: #222 !important;
    color: white !important;
}

.active-draw-button,
.draw-button.active {
    background-color: var(--optimotive-orange) !important;
    color: white !important;
    border-color: var(--optimotive-orange) !important;
    box-shadow: 0 0 10px rgba(254, 80, 0, 0.5);
}

/* Leaflet Draw controls styling */
.leaflet-draw {
    margin-top: 50px !important; /* Ensure space below other controls */
}

.leaflet-draw-toolbar a {
    background-color: #000 !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
    color: #ccc !important;
}

.leaflet-draw-toolbar a:hover {
    background-color: #222 !important;
}

.leaflet-draw-actions a {
    background-color: #000 !important;
    color: #ccc !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
}

.leaflet-draw-actions a:hover {
    background-color: #222 !important;
    color: white !important;
}

/* Drawn shape styling */
.leaflet-interactive {
    stroke: var(--customer-primary) !important;
    fill-opacity: 0.2 !important;
    stroke-width: 3 !important;
    stroke-opacity: 0.7 !important;
}

/* Popup styling for 2D map */
.marker-popup {
    padding: 5px;
    color: #fff;
    max-width: 240px !important; /* Prevent content from making popup too wide */
    width: auto !important;
}

.marker-popup h6 {
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--optimotive-orange);
    font-weight: bold;
}

.popup-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.popup-detail {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.popup-label {
    font-weight: bold;
    color: #aaa;
    margin-right: 8px;
}

.popup-value {
    color: #fff;
}

/* Status indicator markers */
.location-marker {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Custom location marker to avoid default Leaflet styling */
.custom-location-marker {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    /* Reset any default leaflet styles */
    margin: 0 !important;
    padding: 0 !important;
}

/* Status animations */
@keyframes flashRed {
    0% {
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
        opacity: 0.7;
    }
    50% {
        box-shadow: 0 0 15px rgba(220, 53, 69, 1);
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
        opacity: 0.7;
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
        transform: scale(1);
    }
}

/* Site highlight animation */
@keyframes siteHighlight {
    0% {
        opacity: 0.9;
        fill-opacity: 0.7;
        stroke-width: 3;
        stroke-opacity: 0.9;
    }
    50% {
        opacity: 0.5;
        fill-opacity: 0.3;
        stroke-width: 2;
        stroke-opacity: 0.5;
    }
    100% {
        opacity: 0.9;
        fill-opacity: 0.7;
        stroke-width: 3;
        stroke-opacity: 0.9;
    }
}

.site-highlight-animation {
    animation: siteHighlight 1.5s ease-in-out infinite;
}

/* Site tour button */
.site-tour-button {
    background-color: #111 !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
    transition: all 0.3s ease;
}

.site-tour-button:hover {
    background-color: #222 !important;
    color: white !important;
}

.site-tour-button.active {
    background-color: var(--optimotive-orange) !important;
}

/* Pitcrew Interface Buttons */
.technician-action-btn {
    background-color: #111 !important;
    border: 2px solid rgba(254, 80, 0, 0.4) !important;
    color: white !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.technician-action-btn:hover {
    background-color: #222 !important;
    border-color: rgba(254, 80, 0, 0.8) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(254, 80, 0, 0.2) !important;
}

.technician-action-btn:active {
    background-color: rgba(254, 80, 0, 0.1) !important;
    border-color: var(--optimotive-orange) !important;
    transform: translateY(0) !important;
}

.technician-action-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(254, 80, 0, 0.25) !important;
    background-color: #111 !important;
    border-color: var(--optimotive-orange) !important;
    color: white !important;
}

/* Service page specific styling */
.service-unit-btn {
    background-color: #111 !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.service-unit-btn:hover {
    background-color: #222 !important;
    border-color: rgba(254, 80, 0, 0.8) !important;
    color: white !important;
    transform: translateY(-1px) !important;
}

/* Passport button styling */
.passport-btn {
    background-color: #000 !important;
    border: 2px solid var(--optimotive-orange) !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.passport-btn:hover {
    background-color: #111 !important;
    border-color: var(--optimotive-orange) !important;
    color: white !important;
    transform: translateY(-1px) !important;
}

.passport-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(254, 80, 0, 0.25) !important;
    background-color: #000 !important;
    border-color: var(--optimotive-orange) !important;
    color: white !important;
}

/* Optimotive Orange Outline Button */
.btn-outline-optimotive {
    color: var(--optimotive-orange) !important;
    border-color: var(--optimotive-orange) !important;
    background-color: transparent !important;
    transition: all 0.3s ease !important;
}

.btn-outline-optimotive:hover {
    color: white !important;
    background-color: var(--optimotive-orange) !important;
    border-color: var(--optimotive-orange) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(254, 80, 0, 0.3) !important;
}

.btn-outline-optimotive:focus {
    box-shadow: 0 0 0 0.2rem rgba(254, 80, 0, 0.25) !important;
}

.btn-outline-optimotive:active {
    color: white !important;
    background-color: rgba(254, 80, 0, 0.9) !important;
    border-color: var(--optimotive-orange) !important;
    transform: translateY(0) !important;
}

.service-unit-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(254, 80, 0, 0.25) !important;
    background-color: #111 !important;
    border-color: var(--optimotive-orange) !important;
    color: white !important;
}

/* Build unit slide positioning */
.slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    pointer-events: none;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.slide .d-flex {
    width: 100% !important;
    height: 100% !important;
}

/* Ensure form elements are interactive */
.slide.active select,
.slide.active input,
.slide.active button {
    pointer-events: auto !important;
    z-index: 10;
    position: relative;
}

/* Site summary display */
.site-summary-container {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 3px solid var(--customer-primary, var(--optimotive-orange));
    max-width: 300px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.site-summary-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.site-summary-title {
    font-family: 'Bebas Neue', sans-serif;
    color: var(--optimotive-orange);
    font-size: 2.2rem;
    margin: 0 0 5px 0;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.site-summary-stat {
    font-family: 'Bebas Neue', sans-serif;
    color: white;
    font-size: 1.5rem;
    margin: 2px 0;
    display: flex;
    justify-content: space-between;
    letter-spacing: 1px;
}

.site-summary-label {
    margin-right: 15px;
}

.site-summary-value {
    color: var(--optimotive-orange);
    font-size: 1.8rem;
}

/* Table styling */
.table {
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: -8px;
    background-color: var(--dark-bg);
    position: relative;
    z-index: 2;
}

.table tbody tr {
    background-color: var(--darker-grey);
    transition: all 0.3s ease;
    margin-bottom: 8px;
    cursor: pointer;
    position: relative;
    z-index: 3;
}

.table tbody tr:hover {
    background: var(--medium-grey);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.table td {
    padding: 1rem;
    border: none;
    background-color: var(--darker-grey);
    position: relative;
    z-index: inherit;
}

.table th {
    border: none;
    color: var(--optimotive-orange);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.1rem;
    background-color: var(--darker-grey);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    color: white;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--optimotive-orange-glow);
}

/* Form Controls */
.form-control, .form-select {
    background: var(--darker-grey);
    border: 1px solid rgba(254, 80, 0, 0.2);
    color: white;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: var(--medium-grey);
    border-color: var(--optimotive-orange);
    box-shadow: 0 0 15px var(--optimotive-orange-glow);
    color: white;
}

/* Card Styles */
.card {
    background: rgba(17, 17, 17, 0.8);
    border: 1px solid rgba(254, 80, 0, 0.2);
    box-shadow: 0 0 20px var(--optimotive-orange-glow);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Custom Optimotive Header Style */
.optimotive-header {
    background: linear-gradient(135deg, #333333 0%, #222222 100%) !important;
    border-bottom: 2px solid var(--optimotive-orange);
    box-shadow: 0 2px 10px rgba(254, 80, 0, 0.2);
    color: white !important;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    position: relative;
    z-index: 1;
}

/* Prevent any highlighting effects on header */
.card-header.optimotive-header::before,
.card-header.optimotive-header::after {
    display: none !important;
}

/* Prevent text highlighting in card headers */
.card-header h5,
.card-header .card-title {
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    background: transparent !important; /* Ensure no background appears on hover */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    position: relative; /* Position for z-index */
    z-index: 5; /* Ensure text is above any highlights */
}

.card:hover {
    box-shadow: 0 0 30px var(--optimotive-orange-glow);
    transform: translateY(-2px);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .d-flex.gap-2 {
        flex-direction: column;
    }

    .form-control, .form-select {
        margin-bottom: 0.5rem;
        width: 100%;  /* Full width on mobile */
    }

    h1 {
        font-size: 2rem;
    }
}

/* Status Badges */
.badge {
    font-size: 0.85em;
    padding: 0.6em 1em;
    border-radius: 0;  /* Hard edges */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transition: all 0.5s ease-in-out;
}

/* Flat color overrides for Bootstrap badge backgrounds - remove gradients */
.badge.bg-primary,
.system-badge-assigned {
    background: #007bff !important;
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.badge.bg-success,
.system-badge-onsite {
    background: #28a745 !important;
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.badge.bg-warning {
    background: #ffc107 !important;
    background-image: none !important;
    color: #212529 !important;
    filter: none !important;
    box-shadow: none !important;
}

.badge.bg-danger {
    background: #dc3545 !important;
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.badge.bg-info {
    background: #17a2b8 !important;
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.badge.bg-secondary {
    background: #6c757d !important;
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
}

/* Additional specific overrides for customer portal badges */
span.badge.bg-success.ms-1,
span.badge.bg-primary.ms-1 {
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
}

/* Force removal of any gradients, shadows, and filters on ALL badges */
.badge,
.badge[class*="bg-"] {
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
    background-blend-mode: normal !important;
}

/* Re-apply the flat background colors after removing gradients */
.badge.bg-primary { background-color: #007bff !important; }
.badge.bg-success { background-color: #28a745 !important; }
.badge.bg-warning { background-color: #ffc107 !important; color: #212529 !important; }
.badge.bg-danger { background-color: #dc3545 !important; }
.badge.bg-info { background-color: #17a2b8 !important; }
.badge.bg-secondary { background-color: #6c757d !important; }

/* Force override specific badge selectors that may have gradients from other CSS files */
.site-details .badge,
.badge[class*="bg-"],
span.badge,
.system-badge-onsite,
.system-badge-assigned,
.status-badge {
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
}

/* Re-apply solid colors to specific badge types */
.site-details .badge,
.badge.bg-success,
.system-badge-onsite,
span.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-primary,
.system-badge-assigned,
span.badge.bg-primary {
    background-color: #007bff !important;
}

/* MAXIMUM SPECIFICITY OVERRIDE - Force flat colors on ALL badges */
body .badge,
body span.badge,
body .badge.bg-primary,
body .badge.bg-success,
body .badge.bg-warning,
body .badge.bg-danger,
body .badge.bg-info,
body .badge.bg-secondary,
body .system-badge-onsite,
body .system-badge-assigned,
body span.badge.bg-success.ms-1,
body span.badge.bg-primary.ms-1,
body span.badge.bg-success.ms-1.system-badge-onsite,
body span.badge.bg-primary.ms-1.system-badge-assigned,
html body .badge[class*="bg-"],
html body span[class*="badge"] {
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Re-apply solid flat background colors with maximum specificity */
body .badge.bg-success,
body .system-badge-onsite,
body span.badge.bg-success,
body span.badge.bg-success.ms-1,
body span.badge.bg-success.ms-1.system-badge-onsite {
    background-color: #28a745 !important;
}

body .badge.bg-primary,
body .system-badge-assigned,
body span.badge.bg-primary,
body span.badge.bg-primary.ms-1,
body span.badge.bg-primary.ms-1.system-badge-assigned {
    background-color: #007bff !important;
}

body .badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

body .badge.bg-danger {
    background-color: #dc3545 !important;
}

body .badge.bg-info {
    background-color: #17a2b8 !important;
}

body .badge.bg-secondary {
    background-color: #6c757d !important;
}

/* Override Bootstrap's rounded-pill class */
.badge.rounded-pill {
    border-radius: 0 !important;
}

/* Industrial-style status badge animations */
.badge-status-change {
    animation: industrialStatusFlash 20s cubic-bezier(0.4, 0, 0.2, 1);
}

/* TV Mode Overlay Styles */
.tv-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #111111;  /* Solid dark background, no transparency */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tv-mode-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: clamp(5px, 1vh, 15px);
    padding: clamp(5px, 1vh, 15px);
    box-sizing: border-box;
}

.tv-mode-header {
    height: 8vh;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 17, 0.9);
    border-radius: 8px;
    padding: 1vh;
}

.tv-exit-button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(254, 80, 0, 0.9);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tv-exit-button:hover {
    background: var(--optimotive-orange);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(254, 80, 0, 0.5);
}

/* TV Mode Layout - Clean Implementation */
#tvModeOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--dark-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tv-mode-container {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: 180px 1fr;
    gap: 0;
    overflow: hidden;
}

/* Gauges section - Fixed height */
.tv-gauges-container {
    height: 180px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    padding: 20px 40px;
    background: rgba(17, 17, 17, 0.95);
    border-bottom: 2px solid var(--optimotive-orange);
    align-items: center;
}

.tv-gauges-container .col-md-4 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.tv-gauges-container .gauge-container {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tv-gauges-container .gauge-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 8px auto;
    flex-shrink: 0;
}

.tv-gauges-container canvas {
    width: 100%;
    height: 100%;
}

.tv-gauges-container .gauge-value {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    z-index: 10;
}

.tv-gauges-container .gauge-value h3 {
    font-size: 1.4rem;
    margin: 0;
    color: #FE5000;
    font-weight: bold;
    line-height: 1;
}

.tv-gauges-container .gauge-value p {
    font-size: 0.7rem;
    margin: 2px 0 0 0;
    color: #ccc;
    line-height: 1;
}

.tv-gauges-container h5 {
    font-size: 0.9rem;
    margin: 4px 0 0 0;
    color: white;
    font-weight: 600;
    line-height: 1.2;
}

.tv-gauges-container p.small {
    font-size: 0.7rem;
    margin: 2px 0 0 0;
    color: #999;
    line-height: 1;
}

/* Map section - Fills remaining space */
.tv-map-container {
    flex: 1;
    min-height: 0;
    position: relative;
    background: rgba(17, 17, 17, 0.9);
}

#tvMapContainer {
    width: 100%;
    height: 100%;
    position: relative;
}

#tvRobotMap {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments for TV mode */
@media screen and (max-height: 600px) {
    .tv-mode-container {
        grid-template-rows: 140px 1fr;
    }
    
    .tv-gauges-container {
        height: 140px;
        gap: 20px;
        padding: 15px 30px;
    }
    
    .tv-gauges-container .gauge-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .tv-gauges-container h5 {
        font-size: 0.8rem;
    }
    
    .tv-gauges-container .gauge-value h3 {
        font-size: 1rem;
    }
}

@media screen and (min-width: 1400px) {
    .tv-mode-container {
        grid-template-rows: 220px 1fr;
    }
    
    .tv-gauges-container {
        height: 220px;
        gap: 60px;
        padding: 30px 60px;
    }
    
    .tv-gauges-container .gauge-wrapper {
        width: 160px;
        height: 160px;
    }
    
    .tv-gauges-container h5 {
        font-size: 1.1rem;
    }
    
    .tv-gauges-container .gauge-value h3 {
        font-size: 1.8rem;
    }
}

.tv-map-container {
    flex: 1;
    position: relative;
    background: rgba(17, 17, 17, 0.9);
    border-radius: 8px;
    overflow: hidden;
    min-height: 0;
}

.tv-site-summary-container {
    position: absolute;
    left: 20px;
    bottom: 20px;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px 25px;
    border-radius: 8px;
    border-left: 4px solid var(--optimotive-orange);
    max-width: 350px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tv-site-summary-title {
    font-family: 'Bebas Neue', sans-serif;
    color: var(--optimotive-orange);
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.tv-site-summary-stat {
    font-family: 'Bebas Neue', sans-serif;
    color: white;
    font-size: 1.3rem;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    letter-spacing: 1px;
}

.tv-site-summary-label {
    margin-right: 20px;
}

.tv-site-summary-value {
    color: var(--optimotive-orange);
    font-size: 1.5rem;
}

/* Hide side panels when TV mode is active */
.tv-mode-overlay ~ .container .row .col-md-4,
.tv-mode-overlay ~ .container .row .col-lg-4 {
    display: none !important;
}

/* TV mode hides specific panels but keeps site summary visible */
.tv-mode-active .trackable-assets-panel,
.tv-mode-active .active-sites-panel,
.tv-mode-active #data-tables-header,
.tv-mode-active #data-tables-section {
    display: none !important;
}

/* Ensure site summary is visible and properly positioned in TV mode - increased by 25% */
.tv-mode-active #siteSummaryContainer {
    display: block !important;
    position: fixed !important;
    left: 30px !important;
    bottom: 30px !important;
    z-index: 10000 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    padding: 30px 35px !important;
    border-radius: 12px !important;
    border-left: 6px solid var(--optimotive-orange) !important;
    max-width: 450px !important;
    color: white !important;
    transform: scale(1.25) !important;
    transform-origin: bottom left !important;
}

/* TV mode layout optimization - AGGRESSIVE OVERRIDES */
#tvModeOverlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-direction: column !important;
}

#tvModeOverlay .tv-mode-container {
    height: 100vh !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

#tvModeOverlay .tv-gauges-container {
    height: 500px !important;
    flex-shrink: 0 !important;
}

#tvModeOverlay .tv-map-container {
    flex: 1 !important;
    height: auto !important;
    min-height: 0 !important;
}

#tvModeOverlay .tv-map-container #tvMapContainer {
    height: 100% !important;
    width: 100% !important;
}

#tvModeOverlay .tv-map-container #tvRobotMap {
    height: 100% !important;
    width: 100% !important;
}

/* Fullscreen TV Mode Styles */
.tv-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: var(--dark-grey) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.tv-mode .container-fluid {
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

.tv-mode .row {
    width: 100% !important;
    margin: 0 !important;
}

.tv-mode .col-12 {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.tv-mode .card {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.tv-mode .card-header {
    display: none !important;
}

.tv-mode .card-body {
    padding: 0 !important;
}

/* Key fix: Make map row fill remaining space using flex */
.tv-mode .col-12:nth-child(3) {
    flex: 1 !important;
    height: auto !important;
    min-height: 0 !important;
}

.tv-mode .map-row .card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.tv-mode .map-row .card-body {
    height: 100% !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.tv-mode #mapContainer {
    height: 100% !important;
    width: 100% !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.tv-mode #robotMap {
    height: 100% !important;
    width: 100% !important;
    flex: 1 !important;
}

/* TV Mode Responsive Gauge Section */
.tv-mode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 17, 17, 0.98);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.tv-mode-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.tv-gauges-container {
    flex-shrink: 0;
    height: 22vh;
    min-height: 200px;
    max-height: 250px;
    padding: 2vh 2vw;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid var(--optimotive-orange);
    display: flex;
    align-items: center;
}

.tv-gauges-container .row {
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
}

.tv-gauges-container .col-md-4 {
    padding: 0.5vh;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.tv-gauges-container .gauge-container {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tv-gauges-container .gauge-wrapper {
    position: relative;
    height: min(13.8vh, 161px) !important;
    width: min(13.8vh, 161px) !important;
    margin: 0 auto 1vh auto;
}

.tv-gauges-container canvas {
    height: 100% !important;
    width: 100% !important;
    max-height: 120px !important;
    max-width: 120px !important;
}

.tv-map-container {
    flex: 1;
    min-height: 0;
    position: relative;
    background: rgba(17, 17, 17, 0.9);
}

.tv-gauges-container .gauge-value {
    position: absolute;
    bottom: 15% !important;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    text-align: center;
    z-index: 10;
}

.tv-gauges-container .gauge-value h3 {
    font-size: clamp(1.6rem, 2.2vh, 2.2rem) !important;
    margin: 0;
    color: #FE5000;
    font-weight: bold;
    line-height: 1;
}

.tv-gauges-container .gauge-value p {
    font-size: clamp(0.7rem, 1vh, 0.9rem) !important;
    margin: 2px 0 0 0;
    color: #ccc;
    line-height: 1;
}

.tv-gauges-container h5 {
    font-size: clamp(0.9rem, 1.4vh, 1.1rem) !important;
    margin: 0.5vh 0 0 0;
    color: white;
    font-weight: 600;
    line-height: 1.2;
}

.tv-gauges-container p.small {
    font-size: clamp(0.7rem, 0.9vh, 0.8rem) !important;
    margin: 2px 0 0 0;
    color: #999;
    line-height: 1;
}

/* Exit button positioning */
.tv-exit-button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(254, 80, 0, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tv-exit-button:hover {
    background: rgba(254, 80, 0, 1);
    transform: scale(1.1);
}

/* TV Mode Site Summary - Enhanced for Large Display */
.tv-site-summary-container {
    position: absolute;
    top: 30px;
    left: 50px;
    background: rgba(0, 0, 0, 0.95) !important;
    border: 3px solid var(--optimotive-orange) !important;
    border-radius: 12px;
    padding: 25px 30px;
    color: white;
    min-width: 350px;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: all 0.3s ease;
    z-index: 2000;
    font-size: 1.4rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.tv-site-summary-container.visible {
    opacity: 1;
    visibility: visible;
}

.tv-site-summary-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem !important;
    margin-bottom: 15px !important;
    color: var(--optimotive-orange) !important;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.tv-site-summary-stat {
    margin-bottom: 12px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Bebas Neue', sans-serif;
}

.tv-site-summary-label {
    font-size: 1.5rem !important;
    color: #ddd;
    font-weight: 500;
    letter-spacing: 1px;
}

.tv-site-summary-value {
    color: var(--optimotive-orange) !important;
    font-size: 1.8rem !important;
    font-weight: bold;
    letter-spacing: 1px;
}

.tv-site-summary-value {
    font-size: 2.2rem !important;
    font-weight: bold !important;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* TV mode styles removed */

/* Status Colors */
.bg-primary,
.badge.bg-primary {
    background-color: var(--optimotive-orange) !important;
    color: white !important;
}

.bg-success {
    background-color: #28a745 !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

.bg-info {
    background-color: #17a2b8 !important;
}

/* Site tag styling */
.site-tag {
    font-weight: 600;
    color: white;
    display: inline-block;
    background-color: #17a2b8;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    box-shadow: 0 0 8px rgba(23, 162, 184, 0.4);
    border: 1px solid rgba(23, 162, 184, 0.6);
    letter-spacing: 0.5px;
}

.bg-secondary {
    background-color: #6c757d !important;
}

.bg-dark {
    background-color: #343a40 !important;
}

.bg-purple {
    background-color: #6f42c1 !important;
    color: white !important;
}

@keyframes industrialStatusFlash {
    0% {
        filter: brightness(0.3);
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    }
    15% {
        filter: brightness(1.5);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    }
    30% {
        filter: brightness(0.8);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    }
    45% {
        filter: brightness(1.3);
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
    }
    60% {
        filter: brightness(0.9);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    }
    75% {
        filter: brightness(1.2);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    }
    90% {
        filter: brightness(0.95);
        box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
    }
    100% {
        filter: brightness(1);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    }
}

/* Special warning animation for maintenance status */
.badge.bg-danger.badge-status-change {
    animation: maintenanceWarning 2s ease-in-out infinite;
}

@keyframes maintenanceWarning {
    0%, 100% {
        box-shadow: 0 0 15px rgba(220, 53, 69, 0.6);
        filter: brightness(0.8);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.9);
        filter: brightness(1.5);
    }
}

/* Navbar */
.navbar {
    background: var(--dark-bg) !important;
    border-bottom: 1px solid var(--optimotive-orange);
    box-shadow: 0 1px 10px var(--optimotive-orange-glow);
}

.navbar-text {
    font-size: 1rem;
    font-weight: 500;
    margin-right: 1rem;
}

/* Brand Colors */
.bg-primary {
    background-color: var(--optimotive-orange) !important;
}

.badge.bg-operational {
    background-color: var(--optimotive-orange) !important;
}

/* Fleet Health Gauges */
.fleet-health-gauge {
    width: 100px;
    height: 50px;  /* Reduced height since we're using semi-circular gauges */
    margin: 0 auto;
    position: relative;
}

/* Gauge Labels */
.gauge-label {
    color: white;
    text-align: center;
    margin-top: 0.25rem;
    font-size: 1.2rem;  /* Increased from 0.9rem */
    font-weight: 500;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
}

/* Card modifications for gauges */
.gauge-card {
    margin-bottom: 0.75rem;
}

.gauge-card .card-body {
    padding: 0.75rem;
    height: 100px;  /* Fixed height for gauge cards */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .d-flex.gap-2 {
        flex-direction: column;
    }

    .form-control, .form-select {
        margin-bottom: 0.5rem;
        width: 100%;  /* Full width on mobile */
    }

    /* Mobile table adjustments */
    #robotsTableMobile {
        width: 100%;
        table-layout: fixed;
    }

    #robotsTableMobile th:nth-child(1),
    #robotsTableMobile td:nth-child(1) {
        width: 25%;
    }

    #robotsTableMobile th:nth-child(2),
    #robotsTableMobile td:nth-child(2) {
        width: 35%;
    }

    #robotsTableMobile th:nth-child(3),
    #robotsTableMobile td:nth-child(3) {
        width: 40%;
    }

    #robotsTableMobile td:nth-child(3) {
        white-space: normal;
        word-wrap: break-word;
        font-size: 0.85rem;
    }

    .badge {
        padding: 0.35em 0.65em;
        font-size: 0.75em;
        white-space: normal;
        display: inline-block;
        line-height: 1.2;
    }

    #robotsTableMobile td:nth-child(2) {
        white-space: normal;
        word-wrap: break-word;
    }

    h1 {
        font-size: 2rem;
    }
}

/* Pulsing red glow animation for critical gauges */
@keyframes pulseRedGlow {
    0% {
        filter: drop-shadow(0 0 2px rgba(220, 53, 69, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(220, 53, 69, 0.8));
    }
    100% {
        filter: drop-shadow(0 0 2px rgba(220, 53, 69, 0.3));
    }
}

.gauge-critical {
    animation: pulseRedGlow 2s ease-in-out infinite;
}

/* Toast styling */
.toast-container {
    z-index: 1060;
    pointer-events: auto;
}

.toast {
    background: var(--darker-grey);
    border: 1px solid rgba(254, 80, 0, 0.2);
    box-shadow: 0 0 20px var(--optimotive-orange-glow);
}

/* Dropdown menu styling to match site theme */
.dropdown-menu {
    background-color: var(--darker-grey) !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
    box-shadow: 0 0 20px var(--optimotive-orange-glow) !important;
    backdrop-filter: blur(5px);
    border-radius: 4px;
    padding: 0.5rem 0;
    min-width: 220px;
}

.dropdown-header {
    color: var(--optimotive-orange) !important;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.5rem 1rem 0.25rem 1rem;
    border-bottom: 1px solid rgba(254, 80, 0, 0.2);
    margin-bottom: 0.25rem;
}

.dropdown-item {
    color: white !important;
    background-color: transparent !important;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--medium-grey) !important;
    color: white !important;
}

.dropdown-item:focus {
    background-color: var(--medium-grey) !important;
    color: white !important;
}

.dropdown-item.text-danger {
    color: #dc3545 !important;
}

.dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

.dropdown-divider {
    border-color: rgba(254, 80, 0, 0.2) !important;
    margin: 0.5rem 0;
}

/* Form controls inside dropdown */
.dropdown-menu .form-control,
.dropdown-menu .form-select {
    background-color: var(--medium-grey) !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
    color: white !important;
    font-size: 0.9rem;
}

.dropdown-menu .form-control:focus,
.dropdown-menu .form-select:focus {
    background-color: var(--light-grey) !important;
    border-color: var(--optimotive-orange) !important;
    box-shadow: 0 0 10px var(--optimotive-orange-glow) !important;
    color: white !important;
}

.dropdown-menu .form-check-input {
    background-color: var(--medium-grey) !important;
    border: 1px solid rgba(254, 80, 0, 0.3) !important;
}

.dropdown-menu .form-check-input:checked {
    background-color: var(--optimotive-orange) !important;
    border-color: var(--optimotive-orange) !important;
}

.dropdown-menu .form-check-label {
    color: white !important;
    font-size: 0.9rem;
}

.dropdown-menu .text-muted {
    color: #aaa !important;
    font-size: 0.8rem;
}

/* Robot Passport Text Readability Fixes */
.card-body .text-muted {
    color: #cccccc !important; /* Light gray for better readability on dark background */
}

.card-body .text-dark {
    color: #ffffff !important; /* Ensure white text on dark background */
}

.card-body .small.text-muted {
    color: #bbbbbb !important; /* Slightly darker than regular text-muted for hierarchy */
}

/* Master Control Section */
.master-control-card {
    border: 2px solid #dc3545;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
}

.emergency-stop-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 2px;
    padding: 1rem 2rem;
    border: 2px solid #dc3545;
    animation: warningPulse 2s infinite;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.emergency-stop-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(220, 53, 69, 0.6);
    background-color: #dc3545;
    border-color: #dc3545;
}

@keyframes warningPulse {
    0% {
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
    }
}

/* Confirmation Modal for Emergency Stop */
.emergency-stop-modal .modal-content {
    border: 2px solid #dc3545;
    box-shadow: 0 0 30px rgba(220, 53, 69, 0.3);
}

.emergency-stop-modal .modal-header {
    background-color: #dc3545;
    color: white;
    border-bottom: 2px solid rgba(220, 53, 69, 0.5);
}

.emergency-stop-modal .modal-title {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    width: 100%;
    text-align: center;
}

.emergency-stop-modal .modal-body {
    padding: 2rem;
}

.emergency-stop-modal .btn-danger {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    animation: warningPulse 2s infinite;
}

.emergency-stop-modal .btn-secondary {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 1px;
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.emergency-stop-modal .modal-footer {
    border-top: 2px solid rgba(220, 53, 69, 0.5);
    padding: 1.5rem;
}

/* Robot Control Buttons */
.robot-control-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.3rem;
    letter-spacing: 1.5px;
    padding: 0.8rem 1.5rem;
    margin: 0.5rem;
    transition: all 0.3s ease;
    min-width: 200px;
}

.robot-control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(254, 80, 0, 0.3);
}

.robot-control-btn.btn-danger {
    animation: warningPulse 2s infinite;
}

.robot-control-btn.btn-danger:hover {
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.6);
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .robot-control-btn {
        min-width: auto;  /* Remove minimum width constraint */
        width: 100%;      /* Make buttons full width */
        font-size: 1.1rem; /* Slightly smaller font */
        padding: 0.6rem 1rem; /* Reduced padding */
        margin: 0.25rem 0; /* Adjust vertical margins */
    }

    /* Improve button container spacing */
    .d-flex.justify-content-center.gap-4 {
        gap: 0.5rem !important;
        flex-direction: column;
        width: 100%;
    }
}

/* Modal centering fixes for mobile */
@media (max-width: 576px) {
    .modal {
        padding: 0 !important;
    }

    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: 95% !important;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1rem) !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Ensure buttons don't overflow on small screens */
    .btn-group {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .btn-group .btn {
        flex: 1 1 auto !important;
        white-space: nowrap !important;
    }
}

/* Improve modal stacking */
.modal-backdrop + .modal-backdrop {
    z-index: 1046 !important;
}

.modal + .modal {
    z-index: 1057 !important;
}

/* 3D Mapbox marker pulse animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.9);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
        transform: scale(1);
    }
}

/* Mapbox GL Marker styling */
.mapbox-gl-marker {
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.mapbox-gl-marker:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Mapbox popup styling */
.mapbox-popup {
    color: white;
    padding: 5px;
    border-radius: 4px;
}

.mapbox-popup strong {
    color: var(--optimotive-orange);
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
}

.mapbox-popup .site-tag {
    display: inline-block;
    background-color: #17a2b8;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 3px;
    font-size: 11px;
    box-shadow: 0 0 6px rgba(23, 162, 184, 0.4);
}

/* Enhanced 3D Mapbox popup styling */
.mapboxgl-popup {
    z-index: 10000 !important; 
}

/* Video Streaming Modal Styling */
    background-color: var(--darker-grey) !important;
    border: 1px solid var(--optimotive-orange);
}



/* Hide Joystick Configuration text and related elements */
    display: none !important;
    visibility: hidden !important;
}

/* Hide joystick control elements by common class patterns */
    display: none !important;
}

/* Hide ROS topic selection elements */
    display: none !important;
    visibility: hidden !important;
}



/* Hide any loading overlays from the Transitive component that might conflict */
    position: relative !important;
    z-index: 1 !important;
}

/* Hide status indicators from view but keep them functional for data extraction */
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    /* Keep them in DOM and functional but invisible */
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Hide all session popups completely from view */
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -9999 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Comprehensive session popup hiding - catch all variations */
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -9999 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

    /* If element has white background and reasonable size, hide it */
}

/* Hide white background elements only if they're small popup-like elements */
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -9999 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure tooltips from hidden elements can still appear */
    position: fixed !important;
    z-index: 10000 !important;
    visibility: visible !important;
    opacity: 1 !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
}

/* Specifically target the "LOADING" text overlay */
    display: none !important;
    visibility: hidden !important;
}

    position: relative !important;
    width: 100% !important;
    height: 400px !important;
    overflow: hidden !important;
}

    position: relative !important;
    z-index: 1000 !important;
}

#connectionStatus {
    border: 2px solid transparent !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    transition: all 0.3s ease !important;
}

/* Connected status - green border */
#connectionStatus.bg-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4) !important;
}

/* Connecting status - yellow border */
#connectionStatus.bg-warning {
    border-color: #ffc107 !important;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.4) !important;
}

/* Error/Disconnected status - red border */
#connectionStatus.bg-danger {
    border-color: #dc3545 !important;
    box-shadow: 0 0 8px rgba(220, 53, 69, 0.4) !important;
}

.mapboxgl-popup-content {
    background-color: rgba(30, 30, 30, 0.9) !important;
    color: white !important;
    border-radius: 8px !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5) !important;
    padding: 15px !important;
    font-size: 14px !important;
    border: 2px solid var(--optimotive-orange) !important;
}

.mapboxgl-popup-close-button {
    color: white !important;
    font-size: 16px !important;
    padding: 5px 10px !important;
    background-color: transparent !important;
    right: 5px !important;
    top: 5px !important;
}

.mapboxgl-popup-close-button:hover {
    color: var(--optimotive-orange) !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
}

.mapboxgl-popup-tip {
    border-top-color: rgba(30, 30, 30, 0.9) !important;
    border-bottom-color: rgba(30, 30, 30, 0.9) !important;
}

/* Fleet tracker specific popup size constraints */
#robotMap .leaflet-popup-content-wrapper {
    max-width: 250px !important;
    width: auto !important;
    min-width: 200px !important;
}

/* Additional popup size control for all Leaflet popups */
.leaflet-popup {
    max-width: 250px !important;
    width: auto !important;
}

.leaflet-popup-content {
    max-width: 240px !important;
    width: auto !important;
    margin: 8px 12px !important;
}


/* Full width container for main layout */
.wide-container {
    max-width: 1800px; /* Very wide container */
    margin: 0 auto;
    padding-left: 30px;
    padding-right: 30px;
}

/* Assets table container - fixed display */
.assets-table-container {
    width: 100%;
    display: block; /* Ensure full block display */
    min-width: 100%; /* Ensure minimum width */
}

.assets-table-container.no-scroll {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* Override conflicting overflow from index-page.css */
.card-body .assets-table-container {
    overflow-x: visible !important;
    overflow-y: visible !important;
}

.assets-table-container table {
    width: 100%;
    table-layout: auto; /* Changed from fixed to auto to allow flexible column sizing */
}

/* Making the table columns exactly sized */
#locationsTable th:nth-child(1) { /* Name */
    width: 25%; /* Increased from 15% to accommodate badges */
}
#locationsTable th:nth-child(2) { /* Location */
    width: 15%;
}
#locationsTable th:nth-child(3) { /* Site */
    width: 15%;
}
#locationsTable th:nth-child(4) { /* Coordinates */
    width: 20%; /* Reduced from 25% */
}
#locationsTable th:nth-child(5) { /* Status */
    width: 12%; /* Reduced from 15% */
}
#locationsTable th:nth-child(6) { /* Last Update */
    width: 13%; /* Reduced from 15% */
}

/* Cell content styling to prevent overflow */
#locationsTable td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px;
}

/* Site name styling to properly wrap long names */
.site-name-cell {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
    display: inline-block !important;
    text-overflow: ellipsis !important;
}
    overflow-wrap: break-word !important;
    max-width: 200px !important;
}

/* Make sure badge text doesn't get truncated */
.badge {
    white-space: normal !important;
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Desktop table padding adjustments */
@media (min-width: 768px) {
    /* No scrolling for tables */
    .table-responsive {
        max-height: none;
        overflow-y: visible;
        overflow-x: visible;
    }
    
    /* Table wrapper style */
    .card-body {
        padding: 20px;
    }
    
    /* Prevent all scrolling on tables */
    .assets-table-container {
        overflow: visible;
    }
    
    /* Make sure content is visible and doesn't cause scrolling */
    #locationsTable td {
        padding: 10px;
    }

    /* Webkit scrollbar styling only where needed */
    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: var(--darker-grey);
    }

    ::-webkit-scrollbar-thumb {
        background-color: var(--customer-primary, var(--optimotive-orange));
        border-radius: 4px;
    }
}

/* ============================== */
/* Mobile Responsive Fleet Table  */
/* ============================== */

/* Mobile and tablet devices (below 768px) */
@media (max-width: 767px) {
    /* Container adjustments for mobile */
    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Fleet header responsive */
    .fleet-header {
        font-size: 1.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Back button responsive */
    .btn-outline-light {
        font-size: 0.85rem !important;
        padding: 0.375rem 0.75rem !important;
    }
    
    /* Card padding reduction */
    .card {
        margin: 0 !important;
        border-radius: 0.5rem !important;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    .card-header {
        padding: 0.75rem !important;
    }
    
    /* Search and filter controls */
    #searchInput,
    #statusFilter {
        font-size: 0.875rem !important;
        padding: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .d-flex.flex-row.gap-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    /* Make table container scrollable horizontally */
    .assets-table-container {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -0.75rem !important;
        padding: 0 0.75rem !important;
    }
    
    .assets-table-container.no-scroll {
        overflow-x: auto !important;
    }
    
    /* Table responsive styling */
    #locationsTable {
        min-width: 600px !important;
        font-size: 0.875rem !important;
    }
    
    #locationsTable th,
    #locationsTable td {
        padding: 0.5rem !important;
        white-space: nowrap !important;
    }
    
    /* Adjust column widths for mobile */
    #locationsTable th:nth-child(1),
    #locationsTable td:nth-child(1) { /* Name */
        min-width: 120px !important;
        width: auto !important;
    }
    
    #locationsTable th:nth-child(2),
    #locationsTable td:nth-child(2) { /* Site */
        min-width: 150px !important;
        width: auto !important;
    }
    
    #locationsTable th:nth-child(3),
    #locationsTable td:nth-child(3) { /* Status */
        min-width: 100px !important;
        width: auto !important;
    }
    
    #locationsTable th:nth-child(4),
    #locationsTable td:nth-child(4) { /* Last Update */
        min-width: 120px !important;
        width: auto !important;
    }
    
    #locationsTable th:nth-child(5),
    #locationsTable td:nth-child(5) { /* Actions */
        min-width: 100px !important;
        width: auto !important;
    }
    
    /* Badge styling for mobile */
    .badge {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Action buttons in table */
    #locationsTable .btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
        margin: 0.125rem !important;
    }
    
    /* Visual scroll indicator */
    .assets-table-container:after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.3));
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .assets-table-container:hover:after {
        opacity: 1;
    }
}

/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
    /* Even smaller header */
    .fleet-header {
        font-size: 1.5rem !important;
    }
    
    /* Compact back button */
    .btn-outline-light {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    .btn-outline-light .fas {
        display: none !important;
    }
    
    /* Minimal card padding */
    .card-body {
        padding: 0.5rem !important;
    }
    
    .card-header {
        padding: 0.5rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Smaller table font */
    #locationsTable {
        font-size: 0.75rem !important;
        min-width: 500px !important;
    }
    
    #locationsTable th,
    #locationsTable td {
        padding: 0.375rem !important;
    }
    
    /* Hide less important columns on very small screens */
    #locationsTable th:nth-child(4),
    #locationsTable td:nth-child(4) { /* Last Update */
        display: none !important;
    }
    
    /* Adjust minimum widths for remaining columns */
    #locationsTable th:nth-child(1),
    #locationsTable td:nth-child(1) { /* Name */
        min-width: 100px !important;
    }
    
    #locationsTable th:nth-child(2),
    #locationsTable td:nth-child(2) { /* Site */
        min-width: 120px !important;
    }
    
    #locationsTable th:nth-child(3),
    #locationsTable td:nth-child(3) { /* Status */
        min-width: 80px !important;
    }
    
    #locationsTable th:nth-child(5),
    #locationsTable td:nth-child(5) { /* Actions */
        min-width: 80px !important;
    }
}


.login-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark-bg);
    filter: blur(10px);
    z-index: -1;
}

html, body {
    height: 100%;
}

    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

/* Modal container */
#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    pointer-events: none;
}

/* Modal styling */
.modal {
    pointer-events: none;
    z-index: 1050 !important;
}

.modal.show {
    pointer-events: auto;
    z-index: 1050 !important;
}

.modal-dialog {
    pointer-events: auto;
    z-index: 1055 !important;
}

.modal-content {
    background-color: var(--darker-grey);
    border: 1px solid var(--optimotive-orange);
    box-shadow: 0 0 20px var(--optimotive-orange-glow);
    position: relative;
    z-index: 1056 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
    pointer-events: auto;
}

/* Handle multiple stacked modals */
.modal-backdrop:nth-of-type(1) {
    z-index: 1040 !important;
}

.modal-backdrop:nth-of-type(2) {
    z-index: 1060 !important;
}

.modal-backdrop:nth-of-type(3) {
    z-index: 1080 !important;
}

.modal:nth-of-type(1).show {
    z-index: 1050 !important;
}

.modal:nth-of-type(2).show {
    z-index: 1070 !important;
}

.modal:nth-of-type(3).show {
    z-index: 1090 !important;
}

/* Specific fix for Report Generation Modal on top of View Reports Modal */
#viewReportsModal.show {
    z-index: 1050 !important;
}

#reportGenerationModal.show {
    z-index: 1070 !important;
}

#chatAssistantModal.show {
    z-index: 1070 !important;
}

/* Ensure proper backdrop stacking when Report Generation Modal is shown */
.modal-backdrop.show + .modal-backdrop.show {
    z-index: 1060 !important;
}

/* Handle third level modal backdrop (for chat assistant on top of report generation) */
.modal-backdrop.show + .modal-backdrop.show + .modal-backdrop.show {
    z-index: 1080 !important;
}

/* Ensure chat assistant modal is on top when opened from reports dashboard */
#viewReportsModal.show ~ #chatAssistantModal.show {
    z-index: 1070 !important;
}

/* Toast container */
.toast-container {
    z-index: 1060;
    pointer-events: auto;
}

/* Master Key Modal specific styling */
#masterKeyModal .modal-content,
#resumeKeyModal .modal-content {
    border: 2px solid #dc3545;
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.3);
}

/* Draw button styling */
.draw-button {
    background-color: white;
    color: #333;
    transition: all 0.2s ease;
}

.draw-button:hover {
    background-color: #eaeaea;
}

.active-draw-button {
    background-color: #3388ff !important;
    color: white !important;
    box-shadow: 0 0 8px rgba(51, 136, 255, 0.6);
}

/* Map Type Control Styles */
.map-type-control {
    display: flex;
    gap: 5px;
}

.map-type-button {
    padding: 6px 10px;
    background-color: #343a40;
    color: #fff;
    border: 1px solid #495057;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-type-button:hover {
    background-color: #495057;
}

.map-type-button.active {
    background-color: #FE5000;
    border-color: #FE5000;
}

/* Active Sites Table Styling */
#sitesTable .btn {
    margin-right: 0.25rem;
}

#sitesTable .btn-outline-primary {
    border-color: #FE5000;
    color: #FE5000;
}

#sitesTable .btn-outline-primary:hover {
    background-color: #FE5000;
    color: white;
}

#sitesTable .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

#sitesTable .btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
}

/* Fix dropdown z-index issues in active sites table */
.active-sites-panel {
    position: relative;
    z-index: 100;
}

.active-sites-panel .card {
    position: relative;
    z-index: 100;
    overflow: visible;
}

.active-sites-panel .card-body {
    position: relative;
    z-index: 100;
    overflow: visible !important;
}

#sitesTable {
    position: relative;
    z-index: 100;
}

#sitesTable .dropdown {
    position: relative;
    z-index: 200;
}

#sitesTable .dropdown-menu {
    z-index: 10000 !important;
    position: absolute !important;
    background-color: var(--medium-grey) !important;
    border: 1px solid var(--optimotive-orange) !important;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.8) !important;
    min-width: 250px !important;
    will-change: transform;
    transform: translateZ(0);
}

#sitesTable .dropdown-toggle {
    z-index: 201 !important;
    position: relative !important;
}

/* Force all dropdown menus to be on top */
.dropdown-menu.show {
    z-index: 10000 !important;
    position: absolute !important;
}

/* Prevent any containers from clipping dropdowns */
.container-fluid,
.row,
.col-lg-4,
.col-md-12 {
    overflow: visible !important;
}

/* Site Edit Modal - Indefinite Checkbox Styling */
#siteEditModal .form-check-input:checked,
#isIndefiniteCheck:checked,
#isIndefiniteCheckInline:checked {
    background-color: #FE5000 !important;
    border-color: #FE5000 !important;
}

#siteEditModal .form-check-input:focus,
#isIndefiniteCheck:focus,
#isIndefiniteCheckInline:focus {
    border-color: #FE5000 !important;
    box-shadow: 0 0 0 0.25rem rgba(254, 80, 0, 0.25) !important;
}

#masterKeyInput:focus,
#resumeKeyInput:focus {
    border-color: #dc3545;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.5);
    background-color: var(--darker-grey);
    color: white;
}

#masterKeyInput,
#resumeKeyInput {
    background-color: var(--darker-grey);
    border: 1px solid #dc3545;
    color: white;
}

/* Configuration Modal Styling */
#configModal .list-group-item {
    background-color: var(--dark-bg);
    border: 1px solid var(--light-grey);
    color: white;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

#configModal .list-group-item:hover {
    background-color: var(--darker-grey);
    border-color: var(--optimotive-orange);
    box-shadow: 0 0 10px var(--optimotive-orange-glow);
}

#configModal .modal-content {
    background-color: var(--darker-grey);
    border: 1px solid var(--optimotive-orange);
}

#configModal .btn-outline-primary {
    color: var(--optimotive-orange);
    border-color: var(--optimotive-orange);
}

#configModal .btn-outline-primary:hover {
    background-color: var(--optimotive-orange);
    color: white;
}

#configModal .text-muted {
    color: #adb5bd !important;
}

#configModal .badge {
    background-color: var(--light-grey);
}

#trackableSearch {
    background-color: var(--dark-bg);
    border: 1px solid var(--light-grey);
    color: white;
}

#trackableSearch:focus {
    border-color: var(--optimotive-orange);
    box-shadow: 0 0 10px var(--optimotive-orange-glow);
}

#trackableSearchFeedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block !important; /* Force display when needed */
}

#trackableSearchFeedback.d-none {
    display: none !important;
}

/* Map Type Control */
.map-type-control {
    background-color: var(--darker-grey);
    border: 1px solid rgba(254, 80, 0, 0.2);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 0 15px var(--optimotive-orange-glow);
    z-index: 1000;
    display: flex;
    gap: 6px;
}

.map-type-button {
    background-color: var(--dark-bg);
    color: white;
    border: 1px solid var(--light-grey);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.map-type-button:hover {
    background-color: var(--medium-grey);
    border-color: var(--optimotive-orange);
    box-shadow: 0 0 8px var(--optimotive-orange-glow);
}

.map-type-button.active {
    background-color: var(--optimotive-orange);
    color: white;
    border-color: var(--optimotive-orange);
    box-shadow: 0 0 12px var(--optimotive-orange-glow);
}

/* MapboxGL 3D marker styles */
.mapbox-custom-marker {
    background-color: transparent !important;
    border: none !important;
    contain: none !important;
    z-index: 10000 !important;
    pointer-events: all !important;
}

/* Custom markers for 3D terrain */
.mapbox-terrain-marker {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    box-shadow: 0 0 15px rgba(0,0,0,0.8) !important;
    border: 3px solid white !important;
    z-index: 10000 !important;
    pointer-events: all !important;
    display: block !important;
}

/* Enhanced popup styling for 3D mode */
.leaflet-popup-content-wrapper,
.mapboxgl-popup-content {
    z-index: 10001 !important;
}

.leaflet-popup-tip-container,
.mapboxgl-popup-tip {
    z-index: 10001 !important;
}

/* Make popups more visible against terrain */
.leaflet-popup-content-wrapper,
.mapboxgl-popup-content {
    background: rgba(25, 25, 30, 0.95) !important; /* Dark grey background with slight blue tint */
    box-shadow: 0 1px 14px rgba(0,0,0,0.8) !important;
    border: 1px solid #333 !important;
    color: white !important; /* White text */
    font-family: inherit !important;
    padding: 12px 15px !important; /* Slightly larger padding */
    max-width: 250px !important; /* Prevent popup from stretching across screen */
    width: auto !important;
}

/* Popup title styling */
.marker-popup h6 {
    color: var(--optimotive-orange) !important; /* Orange header */
    font-size: 16px !important;
    margin-bottom: 5px !important;
}

/* Popup content styling */
.popup-details {
    margin-top: 8px;
}

.popup-label {
    font-weight: bold;
    opacity: 0.8;
}

/* Style the popup tip to match background */
.leaflet-popup-tip {
    background: rgba(25, 25, 30, 0.95) !important;
}

/* Style for Mapbox GL markers */
.mapbox-gl-marker {
    animation: none;
    cursor: pointer;
    z-index: 10000 !important;
}

/* Enhanced styling for 3D Mapbox markers */
.mapbox-gl-marker.active {
    box-shadow: 0 0 30px rgba(40, 167, 69, 0.8) !important; /* Green glow */
}

.mapbox-gl-marker.inaccurate {
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.8) !important; /* Yellow glow */
}

.mapbox-gl-marker.unreachable {
    box-shadow: 0 0 30px rgba(220, 53, 69, 0.8) !important; /* Red glow */
}

/* 3D mode styling for the canvas */
.mapboxgl-canvas-container {
    background-color: #121212; /* Dark background for 3D map */
}

/* Style for the map controls in 3D mode */
.mapboxgl-ctrl-group {
    background-color: rgba(25, 25, 30, 0.8) !important;
    border: none !important;
}

.mapboxgl-ctrl button {
    color: white !important;
    background-color: rgba(40, 40, 50, 0.9) !important;
}

/* Style for 3D site polygons/lines */
.mapboxgl-site-polygon {
    stroke-width: 3;
    stroke-opacity: 0.8;
    fill-opacity: 0.2;
}

.mapbox-gl-marker:hover {
    animation: pulse 2s infinite;
}

/* Hide dummy Leaflet markers */
.hidden-marker {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Animation for pulsing marker effect is defined at the top */

/* ===== TV MODE ENHANCEMENTS ===== */

/* TV Mode Header Styling */
.tv-mode-header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: 3px solid var(--optimotive-orange);
    padding: 25px 40px;
    margin-bottom: 20px;
}

.tv-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    position: relative;
}

.tv-logo {
    height: 75px;
    width: auto;
    filter: brightness(1.1);
    flex-shrink: 0;
}

.tv-title {
    color: white;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    font-weight: 400;
    margin: 0;
    text-shadow: 0 3px 6px rgba(0,0,0,0.7);
    letter-spacing: 4px;
    line-height: 1.1;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* TV Mode Orange Borders */
.tv-bordered-section {
    border: 2px solid var(--optimotive-orange);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    background: rgba(254, 80, 0, 0.05);
    box-shadow: 0 0 15px rgba(254, 80, 0, 0.2);
}

.tv-map-container {
    border: 2px solid var(--optimotive-orange);
    border-radius: 8px;
    background: rgba(254, 80, 0, 0.05);
    box-shadow: 0 0 15px rgba(254, 80, 0, 0.2);
    overflow: hidden;
}

/* Streaming functionality removed */

/* Streaming functionality removed */

/* Clickable row styling for assets table */
.clickable-asset-row {
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

.clickable-asset-row:hover {
    background-color: rgba(254, 80, 0, 0.1) !important;
}

/* Non-streamable rows (vehicles) - different cursor */
.clickable-asset-row.non-streamable {
    cursor: default !important;
}

.clickable-asset-row.non-streamable:hover {
    background-color: transparent !important;
}

/* Custom component badges in fleet tracker tables */
#locationsTable td:first-child {
    white-space: normal !important; /* Override the nowrap rule */
    overflow: visible !important; /* Allow content to be visible */
    text-overflow: initial !important; /* Remove ellipsis */
}

/* Service page table - Actions column needs more space */
.assets-table-container #locationsTable th:nth-child(5),
.assets-table-container #locationsTable td:nth-child(5) {
    min-width: 260px !important; /* Ensure Actions column has enough space for buttons */
    white-space: nowrap !important; /* Prevent button wrapping */
}

/* Custom component badges container */
.custom-components-badges,
#locationsTable .custom-components-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important; /* Better spacing between badges */
    max-width: 100% !important;
    line-height: 1.5 !important;
}

/* Badge styling */
#locationsTable .badge,
.custom-components-badges .badge {
    display: inline-block !important;
    white-space: nowrap !important;
    max-width: 150px !important; /* Prevent individual badges from being too wide */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: middle !important;
    font-size: 0.7rem !important;
}

/* Container for custom component badges (for service page compatibility) */
#locationsTable td div[style*="flex"] {
    display: flex !important;
    flex-wrap: wrap !important;
    max-width: 100% !important;
    line-height: 1.8 !important; /* Add space between wrapped lines */
}

/* Fleet table action buttons - optimized sizing */
#locationsTable .btn-group-sm {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
}

#locationsTable .btn-group-sm .passport-btn {
    padding: 0.25rem 0.45rem !important;
    font-size: 0.82rem !important;
    white-space: nowrap;
    border-width: 1px !important; /* Thinner border to save space */
}

#locationsTable .btn-group-sm .passport-btn i {
    font-size: 0.8rem;
    margin-right: 0.3rem;
}

/* Disabled Notes button styling */
#locationsTable .btn-group-sm .notes-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #333 !important;
    border-color: #555 !important;
    color: #888 !important;
}

#locationsTable .btn-group-sm .notes-btn:not(.disabled):hover {
    background-color: var(--optimotive-orange) !important;
    border-color: var(--optimotive-orange) !important;
    color: white !important;
}

/* Actions column width constraint */
#locationsTable th:last-child,
#locationsTable td:last-child {
    min-width: 380px; /* Ensure enough space for buttons */
    white-space: nowrap;
}