@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Rg.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-It.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Lt.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-LtIt.woff2') format('woff2');
    font-weight: 300;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Bk.woff2') format('woff2');
    font-weight: 350;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-BkIt.woff2') format('woff2');
    font-weight: 350;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Md.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-MdIt.woff2') format('woff2');
    font-weight: 500;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Smbd.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-SmbdIt.woff2') format('woff2');
    font-weight: 600;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Bd.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-BdIt.woff2') format('woff2');
    font-weight: 700;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Xbd.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-XbdIt.woff2') format('woff2');
    font-weight: 800;
    font-style: italic;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-Xlt.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
}
@font-face {
    font-family: 'ES Klarheit Kurrent';
    src: url('fonts/ESKlarheitKurrent-XltIt.woff2') format('woff2');
    font-weight: 200;
    font-style: italic;
}

/* =============================================================================
   CSS Variables
   ============================================================================= */

:root {
    --panel-width: 300px;
    --panel-transition: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --panel-bg: rgba(20, 20, 22, 0.92);
    --panel-border: rgba(255, 255, 255, 0.08);
    --toggle-bg: rgba(38, 38, 42, 0.95);
    --panel-text: #e4e4e7;
    --panel-text-muted: #a1a1aa;
    --panel-accent: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'ES Klarheit Kurrent', sans-serif;
    overflow: hidden;
    background: #f0f0f0;
}

/* Cesium container */
#cesiumContainer {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
}

/* Hide Cesium credits */
.cesium-viewer-bottom {
    display: none !important;
}

/* Cesium widget overrides */
.cesium-viewer .cesium-widget-credits {
    display: none !important;
}

/* View mode toggle buttons */
.view-mode {
    background: #6c757d !important;
    color: white !important;
    padding: 6px 12px !important;
}

.view-mode:hover {
    background: #5a6268 !important;
}

.view-mode.selected {
    background: #007bff !important;
}

.view-mode.selected:hover {
    background: #0056b3 !important;
}

/* Wind indicator */
#wind-indicator {
    background: rgba(38, 38, 42, 0.8);
    padding: 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--panel-text-muted);
    border: 1px solid var(--panel-border);
}

#wind-indicator h4 {
    margin-bottom: 8px;
    color: var(--panel-text);
    font-size: 12px;
    font-weight: 600;
}

.wind-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

#wind-icon {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
    filter: brightness(0.9) invert(1);
}

#wind-speed-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--panel-text);
    white-space: nowrap;
}

/* =============================================================================
   Panel Wrapper System - Slidable Panels
   ============================================================================= */

.panel-wrapper {
    position: fixed;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    z-index: 1000;
    padding-top: 10px;
    padding-bottom: 10px;
    transition: transform var(--panel-transition);
}

/* Left panel: anchored to left edge, content then toggle */
.panel-wrapper.panel-left {
    left: 0;
    flex-direction: row;
    /* Total width = 10px margin + 300px panel + 24px toggle */
    width: calc(var(--panel-width) + 34px);
}

/* Right panel: anchored to right edge, toggle then content */
.panel-wrapper.panel-right {
    right: 0;
    flex-direction: row;
    /* Total width = 24px toggle + 300px panel + 10px margin */
    width: calc(var(--panel-width) + 34px);
}

/* Left panel collapsed: slide left, only toggle visible */
.panel-wrapper.panel-left.collapsed {
    transform: translateX(calc(-1 * var(--panel-width) - 10px));
}

/* Right panel collapsed: slide right, only toggle visible */
.panel-wrapper.panel-right.collapsed {
    transform: translateX(calc(var(--panel-width) + 10px));
}

/* Panel content - fixed width container */
.panel-content {
    width: var(--panel-width);
    min-width: var(--panel-width);
    max-width: var(--panel-width);
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    padding: 12px;
    flex-shrink: 0;
}

/* Left panel content has left margin */
.panel-left .panel-content {
    margin-left: 10px;
}

/* Right panel content has right margin */
.panel-right .panel-content {
    margin-right: 10px;
}

/* Panel toggle buttons */
.panel-toggle {
    width: 24px;
    min-width: 24px;
    height: 48px;
    background: var(--toggle-bg);
    border: 1px solid var(--panel-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
    margin-top: 20px;
}

.panel-toggle:hover {
    background: rgba(58, 58, 62, 0.95);
}

/* Left panel toggle: on right side of content, rounds right corners */
.panel-toggle-left {
    border-radius: 0 6px 6px 0;
    border-left: none;
    margin-left: -1px;
}

/* Right panel toggle: on left side of content, rounds left corners */
.panel-toggle-right {
    border-radius: 6px 0 0 6px;
    border-right: none;
    margin-right: -1px;
}

/* Toggle icon (chevron) */
.toggle-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--panel-text-muted);
    border-bottom: 2px solid var(--panel-text-muted);
    transition: transform 0.2s;
}

/* Left toggle: chevron points left (to collapse left) */
.panel-toggle-left .toggle-icon {
    transform: rotate(135deg);
    margin-left: 2px;
}

/* Right toggle: chevron points right (to collapse right) */
.panel-toggle-right .toggle-icon {
    transform: rotate(-45deg);
    margin-left: 2px;
}

/* Rotate chevrons when collapsed */
.panel-left.collapsed .panel-toggle-left .toggle-icon {
    transform: rotate(-45deg);
    margin-left: -2px;
}

.panel-right.collapsed .panel-toggle-right .toggle-icon {
    transform: rotate(135deg);
    margin-left: -2px;
}

/* Legacy left panel ID now refers to content inside wrapper */
#left-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

#controls {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    min-width: unset;
}

#controls h2 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--panel-text);
    border-bottom: 2px solid var(--panel-accent);
    padding-bottom: 8px;
}

.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--panel-text-muted);
    font-weight: 600;
}

/* Dark theme select elements */
.control-group select,
#scenarioSelect,
#blueOptionSelect {
    background: rgba(38, 38, 42, 0.95);
    color: var(--panel-text);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 8px;
}

.control-group select:focus,
#scenarioSelect:focus,
#blueOptionSelect:focus {
    outline: none;
    border-color: var(--panel-accent);
}

.control-group select option {
    background: rgba(38, 38, 42, 0.98);
    color: var(--panel-text);
}

.control-group button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    margin-right: 5px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.control-group button:hover {
    background: #0056b3;
}

.control-group button.stop {
    background: #dc3545;
}

.control-group button.stop:hover {
    background: #c82333;
}

.control-group button.reset {
    background: #ffc107;
    color: #333;
}

.control-group button.reset:hover {
    background: #e0a800;
}

.control-group button.play {
    background: #28a745;
}

.control-group button.play:hover {
    background: #218838;
}

.control-group button.pause {
    background: #fd7e14;
}

.control-group button.pause:hover {
    background: #e76b00;
}

.control-group button.speed {
    background: #6c757d;
    color: white;
    padding: 6px 12px;
}

.control-group button.speed:hover {
    background: #5a6268;
}

.control-group button.speed.selected {
    background: #28a745;
}

.control-group button.speed.selected:hover {
    background: #218838;
}


.control-group button.team {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
}

.control-group button.team:hover {
    background: #5a6268;
}

.control-group button.team.selected {
    background: #28a745;
}

.control-group button.team.selected:hover {
    background: #218838;
}

/* Right sidebar container - now inside panel wrapper */
#right-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

@keyframes alertSelectPulse {
    0% { transform: scale(1.02); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.02); }
}

#legend {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 12px;
}

#legend h4 {
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.legend-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

#scale {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

#scale-bar {
    width: 100px;
    height: 4px;
    background: #333;
    position: relative;
}

#scale-bar::before,
#scale-bar::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 10px;
    background: #333;
    top: -3px;
}

#scale-bar::before {
    left: 0;
}

#scale-bar::after {
    right: 0;
}

#properties {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 12px;
}

#properties h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--panel-text);
    border-bottom: 2px solid var(--panel-accent);
    padding-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#properties .property-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--panel-border);
    width: 100%;
}

#properties .property-section:last-child {
    border-bottom: none;
}

#properties .property-section strong {
    display: block;
    margin-bottom: 5px;
    color: var(--panel-text);
}

#properties .property-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: var(--panel-text-muted);
    gap: 8px;
    width: 100%;
}

#properties .property-label {
    color: var(--panel-text-muted);
    flex-shrink: 0;
}

#properties .property-value {
    font-weight: 600;
    color: var(--panel-text);
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

#properties .no-selection {
    color: var(--panel-text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

#help {
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 11px;
    color: #666;
}

#help div {
    margin-bottom: 4px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    :root {
        --panel-width: 260px;
    }

    .control-group button {
        padding: 6px 12px;
        font-size: 12px;
    }

    #legend, #help {
        display: none; /* Hide on mobile for cleaner view */
    }

    #messages {
        max-height: 100px;
    }
}

@media (max-width: 480px) {
    :root {
        --panel-width: 240px;
    }

    #controls h2 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .control-group label {
        display: none;
    }

    /* Hide right panel on very small screens */
    #right-panel-wrapper {
        display: none;
    }
}

/* Scenario Completion Modal */
.completion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.completion-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    min-width: 350px;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.completion-header {
    padding: 20px 25px;
    color: white;
    text-align: center;
}

.completion-header h2 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 500;
    opacity: 0.9;
}

.completion-header .winner-label {
    font-size: 24px;
    font-weight: 700;
}

.completion-body {
    padding: 20px 25px;
}

.completion-reason {
    text-align: center;
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.completion-time {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.completion-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.completion-stats .stat-group {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
}

.completion-stats .stat-group h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completion-stats .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
}

.completion-stats .stat-row span:first-child {
    color: #666;
}

.completion-stats .stat-row span:last-child {
    font-weight: 600;
    color: #333;
}

.completion-footer {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
}

.completion-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.completion-btn:hover {
    background: #5a6268;
}

/* Score display in completion modal */
.score-display {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    color: white;
    text-align: center;
}

.score-display .score-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8892b0;
    margin-bottom: 10px;
}

.score-display .score-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.score-display .score-number {
    font-size: 48px;
    font-weight: 700;
    color: white;
}

.score-display .score-grade {
    font-size: 24px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
}

.score-display .score-breakdown {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.score-display .score-component {
    display: flex;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
}

.score-display .component-label {
    flex: 1;
    text-align: left;
    color: #8892b0;
}

.score-display .component-value {
    color: white;
    font-weight: 600;
    margin-right: 8px;
}

.score-display .component-weight {
    color: #5a6a8a;
    font-size: 11px;
    min-width: 40px;
    text-align: right;
}

/* =============================================================================
   Tab Navigation
   ============================================================================= */

#tab-nav {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: rgba(58, 58, 62, 0.6);
    color: var(--panel-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.tab-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.tab-btn:hover {
    background: rgba(68, 68, 72, 0.8);
}

.tab-btn.active {
    background: rgba(78, 78, 82, 0.9);
    color: var(--panel-text);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* =============================================================================
   Recording Checkbox
   ============================================================================= */

.recording-group {
    padding: 8px 0;
    border-top: 1px solid var(--panel-border);
    border-bottom: 1px solid var(--panel-border);
    margin: 8px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--panel-text);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #dc3545;
}

/* Speed limit checkbox - appears on new row under speed buttons */
.speed-limit-checkbox {
    width: 100%;
    margin-top: 8px;
    font-size: 12px;
}

/* =============================================================================
   Recording Indicator
   ============================================================================= */

#recording-indicator {
    background: rgba(220, 53, 69, 0.95);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

#recording-indicator.hidden {
    display: none;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: recording-pulse 1.5s infinite;
}

@keyframes recording-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.recording-text {
    color: white;
    font-size: 13px;
    font-weight: 600;
    flex: 1;
}

.stop-recording {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.stop-recording:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* =============================================================================
   Recordings Panel
   ============================================================================= */

#recordings-panel {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    max-height: 400px;
    overflow-y: auto;
}

#recordings-panel h2 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--panel-text);
    border-bottom: 2px solid #6c757d;
    padding-bottom: 8px;
}

#recordings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading-recordings,
.no-recordings {
    color: var(--panel-text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px 0;
    font-size: 13px;
}

/* Scenario Group */
.scenario-group {
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    overflow: hidden;
}

.scenario-group-header {
    background: rgba(58, 58, 62, 0.6);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.scenario-group-header:hover {
    background: rgba(68, 68, 72, 0.8);
}

.scenario-group-header .scenario-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--panel-text);
}

.scenario-group-header .run-count {
    font-size: 11px;
    color: var(--panel-text-muted);
    background: rgba(78, 78, 82, 0.8);
    padding: 2px 8px;
    border-radius: 10px;
}

.scenario-group-runs {
    display: none;
    background: rgba(38, 38, 42, 0.6);
}

.scenario-group.expanded .scenario-group-runs {
    display: block;
}

/* Run Item */
.run-item {
    padding: 10px 12px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.run-item:hover {
    background: rgba(58, 58, 62, 0.6);
}

.run-item.selected {
    background: rgba(59, 130, 246, 0.2);
}

.run-info {
    flex: 1;
    min-width: 0;
}

.run-date {
    font-size: 12px;
    color: var(--panel-text);
    font-weight: 500;
}

.run-details {
    font-size: 11px;
    color: var(--panel-text-muted);
    margin-top: 2px;
}

.run-actions {
    display: flex;
    gap: 5px;
}

.run-play-btn,
.run-delete-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.run-play-btn {
    background: #007bff;
    color: white;
}

.run-play-btn:hover {
    background: #0056b3;
}

.run-delete-btn {
    background: #dc3545;
    color: white;
}

.run-delete-btn:hover {
    background: #c82333;
}

/* =============================================================================
   Playback Controls
   ============================================================================= */

#playback-controls {
    background: rgba(38, 38, 42, 0.8);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--panel-border);
    margin-top: 10px;
}

#playback-controls.hidden {
    display: none;
}

#playback-controls h3 {
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--panel-text);
    border-bottom: 2px solid var(--panel-accent);
    padding-bottom: 5px;
}

.playback-info {
    margin-bottom: 10px;
}

#playback-scenario {
    font-size: 12px;
    color: var(--panel-text-muted);
}

.playback-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: var(--panel-text);
    margin-bottom: 8px;
}

.time-separator {
    color: var(--panel-text-muted);
}

.playback-seek {
    margin-bottom: 12px;
}

#playback-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(78, 78, 82, 0.8);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#playback-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--panel-accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

#playback-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#playback-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--panel-accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.playback-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.playback-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #007bff;
    color: white;
}

.playback-btn:hover {
    background: #0056b3;
}

.playback-btn.hidden {
    display: none;
}

.playback-btn.unload {
    background: #6c757d;
}

.playback-btn.unload:hover {
    background: #5a6268;
}

#playbackSpeedSelect {
    padding: 6px 10px;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    font-size: 12px;
    background: rgba(38, 38, 42, 0.95);
    color: var(--panel-text);
    cursor: pointer;
}

/* Playback loading indicator */
.playback-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--panel-text-muted);
    font-size: 12px;
}

.playback-loading.hidden {
    display: none;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(78, 78, 82, 0.8);
    border-top-color: var(--panel-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Disabled slider styling */
#playback-slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================================================
   Playback Mode Indicator
   ============================================================================= */

.playback-mode-banner {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 123, 255, 0.95);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 2000;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.playback-mode-banner.hidden {
    display: none;
}

.playback-mode-banner .playback-icon {
    width: 16px;
    height: 16px;
}

/* Hidden utility class */
.hidden {
    display: none !important;
}

/* =============================================================================
   Dark Theme Scrollbar
   ============================================================================= */

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

#properties::-webkit-scrollbar {
    width: 6px;
}

#properties::-webkit-scrollbar-track {
    background: transparent;
}

#properties::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

#properties::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* =============================================================================
   Cesium Widget Overrides
   Remove default backgrounds and styling from Cesium widgets
   ============================================================================= */

/* Remove any background from selection indicator wrapper */
.cesium-selection-wrapper {
    background: none !important;
    background-image: none !important;
}

/* Remove background from any Cesium viewer elements that might show text */
.cesium-viewer-selectionIndicatorContainer {
    background: none !important;
    background-image: none !important;
}

/* Override InfoBox styling (in case it's somehow enabled) */
.cesium-infoBox {
    background: rgba(0, 0, 0, 0.8) !important;
    background-image: none !important;
}

.cesium-infoBox-title {
    background: none !important;
    background-image: none !important;
}

.cesium-infoBox-description {
    background: none !important;
    background-image: none !important;
}

/* Remove background from any Cesium widget */
.cesium-widget,
.cesium-widget * {
    background-image: none !important;
}

/* Simulation time display */
#simTime {
    display: none;
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'ES Klarheit Kurrent', monospace;
    font-size: 24px;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 20px;
    border-radius: 6px;
    z-index: 1000;
    pointer-events: none;
    letter-spacing: 1px;
}

/* DEFCON indicator */
.defcon-indicator {
    display: none;
    position: fixed;
    top: 60px;  /* Position below the time display with padding */
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 6px;
    font-family: 'ES Klarheit Kurrent', monospace;
    font-size: 16px;
    font-weight: 600;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.defcon-indicator.show {
    display: block;
}

.defcon-label {
    margin-right: 8px;
    opacity: 0.85;
    font-size: 14px;
}

.defcon-level {
    font-size: 20px;
    font-weight: bold;
}

/* DEFCON color scheme matching radar monitor */
.defcon-indicator.defcon-5 {
    background: #4caf50;
}

.defcon-indicator.defcon-4 {
    background: #2196f3;
}

.defcon-indicator.defcon-3 {
    background: #ff9800;
}

.defcon-indicator.defcon-2 {
    background: #f44336;
}

.defcon-indicator.defcon-1 {
    background: #d32f2f;
    animation: defcon-pulse 1.5s infinite;
}

/* Pulse animation for DEFCON 1 */
@keyframes defcon-pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }
    50% {
        box-shadow: 0 2px 20px rgba(211, 47, 47, 0.9);
    }
}

/* Ensure credit/attribution area doesn't have grainy background */
.cesium-viewer-bottom,
.cesium-widget-credits {
    background: none !important;
    background-image: none !important;
}
