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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    position: relative;
}

.controls {
    width: 350px;
    padding: 30px;
    background: #1a1a1a;
    border-right: 1px solid #333;
    overflow-y: auto;
    transition: width 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.controls.hidden {
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-right: none;
    overflow: hidden;
    flex-shrink: 0;
}

.toggle-controls-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: #252525;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #4a9eff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
}

.toggle-controls-btn:hover {
    background: #2a2a2a;
    border-color: #4a9eff;
}

.toggle-controls-btn.visible {
    display: block;
}

.recenter-camera-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: #252525;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #4a9eff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.recenter-camera-btn:hover {
    background: #2a2a2a;
    border-color: #4a9eff;
}

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

.controls h1 {
    font-size: 24px;
    color: #ffffff;
    margin: 0;
}

.hide-controls-btn {
    background: none;
    border: none;
    color: #4a9eff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.hide-controls-btn:hover {
    color: #6ab0ff;
}

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

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #aaa;
    font-weight: 500;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    transition: background 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #6ab0ff;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    background: #6ab0ff;
}

.control-group select {
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    background: #252525;
    color: #ffffff;
    border: 1px solid #404040;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.control-group select:hover {
    border-color: #4a9eff;
    background: #2a2a2a;
}

.control-group select:focus {
    outline: none;
    border-color: #4a9eff;
    background: #2a2a2a;
}

.control-group span {
    display: inline-block;
    margin-top: 8px;
    font-size: 16px;
    color: #4a9eff;
    font-weight: 600;
}

.info {
    margin-top: 40px;
    padding: 20px;
    background: #252525;
    border-radius: 8px;
    border: 1px solid #333;
}

.info p {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.info p:last-child {
    margin-bottom: 0;
}

.info strong {
    color: #aaa;
}

.info span {
    color: #4a9eff;
    font-weight: 600;
}

.viewer {
    flex: 1;
    position: relative;
    background: #0f0f0f;
    min-width: 0;
}

#mainViewer {
    flex: 1;
    display: flex !important;
}

#comparisonViewer {
    display: none !important;
    flex: 1;
}

#mainViewer.hidden {
    display: none !important;
}

#comparisonViewer.visible {
    display: flex !important;
}

.container.comparison #mainViewer {
    width: 50%;
    flex: 0 0 50%;
}

.container.comparison #comparisonViewer.visible {
    width: 50%;
    flex: 0 0 50%;
}

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

.control-group input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #4a9eff;
}

.control-group input[type="checkbox"] + label,
.control-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
    font-size: 14px;
    color: #ffffff;
    font-weight: 400;
}

.tv-sizes-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 8px;
}

.tv-size-column {
    display: flex;
    flex-direction: column;
}

.tv-label {
    display: block;
    font-size: 12px;
    color: #888;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tv-sizes-wrapper.side-by-side {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tv-sizes-wrapper.side-by-side .tv-size-column {
    flex: 1;
}

.on-screen-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    background: rgba(37, 37, 37, 0.9);
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
    backdrop-filter: blur(8px);
}

.on-screen-info.visible {
    display: flex;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.info-label {
    color: #aaa;
    font-weight: 500;
    min-width: 120px;
}

.info-value {
    color: #4a9eff;
    font-weight: 600;
    text-align: right;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .controls {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .viewer {
        height: 60vh;
    }
}
