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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.logo {
    padding: 12px;
    margin-bottom: 12px;
}

#container {
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    height: 100vh;
    width: 100vw;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* Left Panel - Description and Legend */
#left-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#description-section {
    margin-bottom: 24px;
}

#left-panel h1 {
    font-size: 1.5em;
    margin-bottom: 16px;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: -0.02em;
}

#description {
    font-size: 0.9em;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
}

#description a {
    color: rgba(150, 150, 150, 0.8);
}

#description p {
    margin: 0;
}

#legend-section h2 {
    font-size: 0.95em;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Center Panel - Visualization */
#center-panel {
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#scene {
    width: 100%;
    height: 100%;
    display: block;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2em;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 32px 48px;
    border-radius: 12px;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    text-align: center;
    font-size: 1em;
    color: rgba(255, 255, 255, 0.9);
}

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

/* Right Panel - Controls */
#right-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#right-panel h2 {
    font-size: 0.95em;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-group {
    margin-bottom: 20px;
    color: rgba(150, 150, 150, 0.8);
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.control-group select,
.control-group input[type="range"] {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.control-group select:focus,
.control-group input[type="range"]:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.control-group select:hover {
    background: rgba(255, 255, 255, 0.08);
}

.control-group input[type="checkbox"] {
    margin-right: 8px;
    accent-color: rgba(255, 255, 255, 0.7);
}

/* Filter blocks */
.filter-block {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.filter-header select {
    flex: 1;
    margin-right: 8px;
}

.remove-filter {
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.remove-filter:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-content {
    margin-top: 8px;
}

.filter-checkboxes-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 8px;
}

.filter-buttons {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.filter-buttons button {
    flex: 1;
    margin: 0;
}

.filter-checkboxes {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 8px;
}

.filter-checkbox-item {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.filter-checkbox-item:last-child {
    margin-bottom: 0;
}

.filter-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.filter-checkbox-item label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.8);
}

button {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
    font-weight: 500;
}

button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

button:active {
    background: rgba(255, 255, 255, 0.2);
}

#addFilter {
    margin-bottom: 10px;
}

.select-all-filter,
.deselect-all-filter {
    width: 48%;
    display: inline-block;
    margin-right: 4%;
    padding: 8px;
}

.deselect-all-filter {
    margin-right: 0;
}

.info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.info p {
    margin-bottom: 8px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.6);
}

/* Time slider styling */
.time-slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.time-slider-wrapper input[type="range"] {
    width: 100%;
    accent-color: rgba(255, 255, 255, 0.7);
}

.time-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
}

.time-values span {
    display: flex;
    align-items: center;
}

/* Legend styling */
.legend {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 8px;
}

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

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-label {
    color: rgba(255, 255, 255, 0.8);
    word-break: break-word;
}

.legend-gradient {
    width: 100%;
    height: 30px;
    border-radius: 8px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.legend-gradient-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
}

/* Range input styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Scrollbar styling */
.panel-content::-webkit-scrollbar,
.filter-checkboxes::-webkit-scrollbar,
.legend::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track,
.filter-checkboxes::-webkit-scrollbar-track,
.legend::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb,
.filter-checkboxes::-webkit-scrollbar-thumb,
.legend::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
.filter-checkboxes::-webkit-scrollbar-thumb:hover,
.legend::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Remove old styles that are no longer needed */
#selectAll,
#deselectAll {
    display: none;
}
