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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    min-height: 100vh;
}
/* Password Protection Overlay */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.password-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    border: 2px solid #00ff88;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
}

.password-form h2 {
    color: #00ff88;
    margin-bottom: 15px;
    font-size: 1.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.password-form p {
    margin-bottom: 25px;
    opacity: 0.9;
    font-size: 1.1em;
}

#password-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 1.1em;
    border: 2px solid #00ff88;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

#password-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#password-input:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

#password-submit {
    width: 100%;
    padding: 12px 20px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #1a1a2e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#password-submit:hover {
    background: linear-gradient(135deg, #00cc66, #00aa55);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.password-error {
    color: #ff4444;
    margin-top: 15px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.password-error.show {
    opacity: 1;
}

.main-content-hidden {
    display: none;
}


header {
    text-align: center;
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #00ff88;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.visualization-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Steering Wheel Visualization */
.steering-scene-container {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 15px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    min-height: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.steering-wheel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.steering-wheel {
    position: relative;
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steering-wheel-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease-out;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

.steering-indicator {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid #00ff88;
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.steering-legend {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    font-size: 0.9em;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.left-turn {
    background: linear-gradient(45deg, #ff4444, #cc0000);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.right-turn {
    background: linear-gradient(45deg, #00ff88, #00cc66);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

/* Roundabout Visualization Styles */
.roundabout-container {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 15px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.roundabout-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #00ff88;
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.crash-subtitle {
    font-size: 0.9em;
    color: #ff6666;
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
    text-shadow: 0 0 3px rgba(255, 102, 102, 0.3);
}

.roundabout-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crash-scene-svg {
    width: 100%;
    max-width: 800px;
    height: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid #333;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.roundabout-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid #333;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.roundabout-legend {
    margin-top: 15px;
    width: 100%;
}

.legend-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.roundabout-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ccc;
    font-size: 0.85em;
}

.crash-legend {
    margin-top: 15px;
    width: 100%;
}

.crash-legend .legend-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.crash-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ccc;
    font-size: 0.8em;
}

.crash-legend .legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #fff;
}

.crash-summary {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    border: 1px solid #333;
}

.summary-title {
    font-size: 1em;
    font-weight: bold;
    color: #00ff88;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 0 3px rgba(0, 255, 136, 0.3);
}

.summary-moments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.moment-item {
    display: flex;
    gap: 8px;
    font-size: 0.85em;
    line-height: 1.4;
}

.moment-time {
    color: #ffaa00;
    font-weight: bold;
    min-width: 50px;
    text-shadow: 0 0 3px rgba(255, 170, 0, 0.3);
}

.moment-desc {
    color: #ccc;
    flex: 1;
}

.roundabout-legend .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid #fff;
}

/* Dashboard Styles */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gauge-row {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.gauge {
    flex: 1;
    text-align: center;
}

.gauge-label {
    font-size: 0.9em;
    margin-bottom: 10px;
    color: #00ff88;
    font-weight: bold;
}

.gauge-display {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    border: 3px solid #333;
    border-radius: 50%;
    background: radial-gradient(circle, #111, #222);
}

.gauge-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 35px;
    background: linear-gradient(to top, #ff4444, #ffaa00);
    transform-origin: bottom center;
    transform: translate(-50%, -100%) rotate(0deg);
    transition: transform 0.3s ease-out;
    border-radius: 1px;
}

.gauge-needle::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -2px;
    width: 6px;
    height: 6px;
    background: #ff4444;
    border-radius: 50%;
}

.gauge-value {
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Steering gauge scale marks for ±396° range */
.gauge-scale-small {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.scale-mark-small {
    position: absolute;
    color: #ccc;
    font-size: 0.5em;
    font-weight: bold;
    transform-origin: 50% 40px;
    text-align: center;
    width: 20px;
    margin-left: -10px;
    z-index: 5;
}

/* Steering gauge scale positions (-150 to +150 degrees for normal driving, mapped to 180 degree visual range) */
.steering-gauge .mark-left-full { transform: rotate(-90deg) translateY(-10px) rotate(90deg); }
.steering-gauge .mark-left-half { transform: rotate(-45deg) translateY(-10px) rotate(45deg); }
.steering-gauge .mark-center { transform: rotate(0deg) translateY(-10px) rotate(0deg); }
.steering-gauge .mark-right-half { transform: rotate(45deg) translateY(-10px) rotate(-45deg); }
.steering-gauge .mark-right-full { transform: rotate(90deg) translateY(-10px) rotate(-90deg); }

.bar-gauge {
    flex: 1;
    text-align: center;
}

.bar-container {
    width: 100%;
    height: 20px;
    background: #333;
    border-radius: 10px;
    margin: 10px 0;
    overflow: hidden;
    border: 2px solid #555;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #ffaa00, #ff4444);
    border-radius: 8px;
    transition: width 0.3s ease-out;
    width: 0%;
}


/* Controls Styles */
.controls-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.timeline-container {
    margin-bottom: 20px;
}

.timeline-label {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #00ff88;
    font-weight: bold;
}

.timeline {
    margin-bottom: 15px;
}

.timeline-track {
    position: relative;
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #555;
}

.timeline-progress {
    height: 100%;
    background: linear-gradient(90deg, #00ff88, #ffaa00);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
}

.timeline-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #ff4444;
    border-radius: 50%;
    top: -4px;
    left: 0%;
    transform: translateX(-50%);
    border: 2px solid #fff;
    transition: left 0.1s linear;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #ccc;
}

.current-time {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 20px;
    background: linear-gradient(145deg, #00ff88, #00cc66);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.4);
}

.control-btn:active {
    transform: translateY(0);
}

#speed-control {
    width: 100px;
    margin: 0 10px;
}

#speed-display {
    color: #00ff88;
    font-weight: bold;
}

.timeline-slider-container {
    margin: 15px 0;
    text-align: center;
}

.timeline-slider-container label {
    display: block;
    margin-bottom: 8px;
    color: #00ff88;
    font-size: 0.9em;
    font-weight: bold;
}

#timeline-slider {
    width: 100%;
    height: 8px;
    background: #333;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #00ff88, #00cc66);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.4);
}

#timeline-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #00ff88, #00cc66);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 255, 136, 0.4);
}


/* Data Table Styles */
.data-table-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.data-table-container h3 {
    margin-bottom: 20px;
    color: #00ff88;
    text-align: center;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #555;
}

.data-table th {
    background: #333;
    color: #00ff88;
    font-weight: bold;
}

.data-table tbody tr {
    transition: background-color 0.3s ease;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.data-table tbody tr:hover {
    background: rgba(0, 255, 136, 0.1);
}

.data-table tbody tr.current-row {
    background: rgba(255, 68, 68, 0.3);
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.clickable-time {
    cursor: pointer;
    color: #00ff88;
    font-weight: bold;
    transition: all 0.2s ease;
}

.clickable-time:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: scale(1.05);
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .visualization-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .visualization-container {
        grid-template-columns: 1fr;
    }
    
    .gauge-row {
        flex-wrap: wrap;
    }
    
    .control-buttons {
        justify-content: center;
    }
    
    .roundabout-legend .legend-row {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .timeline-labels {
        font-size: 0.7em;
    }
    
    .data-table {
        font-size: 0.8em;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 4px;
    }
}