/* CRTscape Creator - Retro 3D Environment Builder Styles */

@import url('https://fonts.googleapis.com/css2?family=MS+Sans+Serif:wght@400;700&display=swap');

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

body {
    font-family: 'MS Sans Serif', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11px;
    background: #008080;
    overflow: hidden;
}

.desktop-background {
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #008080 0%, #004040 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Windows 95/98 Dialog Recreation */
.window-frame {
    width: 900px;
    height: 650px;
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.title-bar {
    background: linear-gradient(90deg, #0000FF 0%, #000080 100%);
    color: white;
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 11px;
}

.title-text {
    margin-left: 4px;
}

.window-controls {
    display: flex;
    gap: 1px;
}

.control-btn {
    width: 16px;
    height: 14px;
    background: #C0C0C0;
    border: 1px outset #C0C0C0;
    font-size: 8px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:active {
    border: 1px inset #C0C0C0;
}

/* Tab Navigation */
.tab-strip {
    display: flex;
    background: #C0C0C0;
    border-bottom: 1px solid #808080;
    padding-left: 8px;
}

.tab {
    padding: 6px 12px 4px 12px;
    border: 1px solid #808080;
    border-bottom: none;
    background: #C0C0C0;
    cursor: pointer;
    margin-right: 2px;
    position: relative;
    top: 1px;
}

.tab.active {
    background: #C0C0C0;
    border-top: 1px solid #FFFFFF;
    border-left: 1px solid #FFFFFF;
    border-right: 1px solid #808080;
    z-index: 1;
}

.window-content {
    flex: 1;
    background: #C0C0C0;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
}

/* CRT Monitor */
.monitor-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crt-monitor {
    position: relative;
}

.monitor-bezel {
    background: linear-gradient(135deg, #2A2A2A 0%, #1A1A1A 50%, #0A0A0A 100%);
    padding: 20px;
    border-radius: 15px;
    box-shadow: inset 2px 2px 8px rgba(255,255,255,0.1),
                inset -2px -2px 8px rgba(0,0,0,0.8),
                4px 4px 16px rgba(0,0,0,0.5);
}

.screen-area {
    width: 320px;
    height: 240px;
    background: #000;
    border: 2px inset #333;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

#scene-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#scene-container canvas {
    width: 100% !important;
    height: 100% !important;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0,0,0,0.3) 1px,
        rgba(0,0,0,0.3) 2px
    );
    pointer-events: none;
    z-index: 10;
}

.phosphor-glow {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: radial-gradient(ellipse at center, 
        rgba(0,255,100,0.1) 0%, 
        rgba(0,255,100,0.05) 50%, 
        transparent 70%);
    pointer-events: none;
    border-radius: 8px;
}

.monitor-label {
    text-align: center;
    color: #AAA;
    font-size: 8px;
    margin-top: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Controls Area */
.controls-area {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-weight: bold;
    color: #000;
}

/* Retro Form Controls */
.retro-dropdown {
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 2px 4px;
    font-family: inherit;
    font-size: 11px;
    width: 100%;
}

.texture-gallery {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.texture-thumb {
    width: 32px;
    height: 32px;
    border: 2px outset #C0C0C0;
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

.texture-thumb[data-texture="brick"] {
    background: repeating-linear-gradient(45deg, #8B4513, #8B4513 2px, #A0522D 2px, #A0522D 4px);
}

.texture-thumb[data-texture="marble"] {
    background: linear-gradient(135deg, #F5F5DC 0%, #E6E6FA 50%, #F5F5DC 100%);
}

.texture-thumb[data-texture="circuit"] {
    background: radial-gradient(circle, #00FF00 1px, #000 1px, #000 3px, #00FF00 3px);
    background-size: 8px 8px;
}

.texture-thumb[data-texture="metal"] {
    background: linear-gradient(90deg, #708090 0%, #C0C0C0 50%, #708090 100%);
}

.texture-thumb.active {
    border: 2px inset #C0C0C0;
}

.retro-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    background: #C0C0C0;
    border: 2px inset #C0C0C0;
    outline: none;
}

.retro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
    cursor: pointer;
}

.retro-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #666;
    margin-top: 2px;
}

.spinner-control {
    display: flex;
    align-items: center;
    gap: 2px;
}

.spinner-control input {
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    padding: 2px 4px;
    font-family: inherit;
    font-size: 11px;
    width: 60px;
    text-align: right;
}

.spinner-buttons {
    display: flex;
    flex-direction: column;
}

.spinner-up, .spinner-down {
    width: 16px;
    height: 10px;
    background: #C0C0C0;
    border: 1px outset #C0C0C0;
    font-size: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.spinner-up:active, .spinner-down:active {
    border: 1px inset #C0C0C0;
}

/* Checkboxes */
.checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 13px;
    height: 13px;
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    position: relative;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    position: absolute;
    top: -3px;
    left: 1px;
    font-size: 11px;
    color: #000;
    font-weight: bold;
}

/* Buttons */
.button-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #808080;
    margin-top: 12px;
}

.dialog-buttons {
    display: flex;
    gap: 8px;
}

.retro-button {
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
    padding: 4px 16px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    min-width: 75px;
}

.retro-button:active {
    border: 2px inset #C0C0C0;
}

.retro-button.small {
    padding: 3px 8px;
    min-width: auto;
    font-size: 10px;
}

/* Modal Dialog */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    width: 400px;
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.5);
}

.modal-content {
    padding: 16px;
}

.settings-tabs .tab-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.setting-row label {
    font-weight: bold;
    min-width: 100px;
}

.era-labels {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #666;
    margin-top: 2px;
    width: 100%;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #808080;
}

/* Export Panel */
.export-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 180px;
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
    padding: 12px;
}

.panel-header {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 11px;
}

.export-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .window-frame {
        width: 95vw;
        height: 90vh;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .controls-area {
        width: 100%;
    }
    
    .screen-area {
        width: 280px;
        height: 210px;
    }
    
    .export-panel {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        margin-top: 12px;
    }
}

@media (max-width: 768px) {
    .desktop-background {
        padding: 10px;
    }
    
    .window-frame {
        width: 100%;
        height: 100%;
    }
    
    .screen-area {
        width: 240px;
        height: 180px;
    }
    
    .texture-gallery {
        justify-content: center;
    }
    
    .button-area {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .dialog-buttons {
        justify-content: center;
    }
}

/* Animation for authentic feel */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.98; }
}

.screen-area {
    animation: flicker 4s infinite ease-in-out;
}

/* Pixel perfect rendering */
* {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #C0C0C0;
    border: 2px inset #C0C0C0;
}

::-webkit-scrollbar-thumb {
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
}

::-webkit-scrollbar-corner {
    background: #C0C0C0;
}