/* CRTscape Creator - Enhanced 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: 950px;
    height: 700px;
    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;
}

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

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

.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;
    overflow: hidden;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
}

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

.main-content {
    display: flex;
    gap: 20px;
    height: 100%;
}

/* 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;
}

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

.retro-textarea {
    resize: vertical;
    min-height: 60px;
}

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

.texture-thumb {
    width: 32px;
    height: 32px;
    border: 2px outset #C0C0C0;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.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[data-texture="upload"] {
    background: #E0E0E0;
    color: #666;
}

.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, .era-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;
}

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

.left-buttons, .center-buttons, .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;
    white-space: nowrap;
}

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

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

/* Share Content */
.share-content {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.share-content h3 {
    margin-bottom: 20px;
    color: #000;
    border-bottom: 1px solid #808080;
    padding-bottom: 8px;
}

.share-section {
    margin-bottom: 24px;
}

.share-section h4 {
    margin-bottom: 12px;
    color: #000;
    font-size: 11px;
}

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

.community-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-results {
    margin-top: 16px;
    padding: 8px;
    background: #FFFFFF;
    border: 2px inset #C0C0C0;
    min-height: 60px;
    font-size: 10px;
}

.share-result {
    background: #F0F0F0;
    padding: 8px;
    border: 1px solid #C0C0C0;
    word-break: break-all;
}

/* Community Content */
.community-content {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.community-content h3 {
    margin-bottom: 20px;
    color: #000;
    border-bottom: 1px solid #808080;
    padding-bottom: 8px;
}

.community-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.community-filters select {
    flex: 0 0 150px;
}

.community-filters input {
    flex: 1;
}

.community-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.gallery-item {
    background: #FFFFFF;
    border: 2px outset #C0C0C0;
    padding: 8px;
}

.gallery-preview {
    position: relative;
    height: 60px;
    background: #000;
    border: 1px inset #C0C0C0;
    margin-bottom: 8px;
    overflow: hidden;
}

.mini-maze {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #333 0px,
        #333 4px,
        #555 4px,
        #555 8px
    );
    opacity: 0.8;
}

.trending-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #FF4500;
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 8px;
}

.gallery-info h4 {
    margin: 0 0 4px 0;
    font-size: 11px;
    color: #000;
}

.gallery-info p {
    margin: 0 0 8px 0;
    font-size: 9px;
    color: #666;
}

.gallery-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 9px;
    color: #666;
}

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

/* Appearance Content */
.appearance-content {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.appearance-content h3 {
    margin-bottom: 20px;
    color: #000;
    border-bottom: 1px solid #808080;
    padding-bottom: 8px;
}

/* 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;
}

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

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #FFFF99;
    border: 2px outset #C0C0C0;
    padding: 8px 16px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    z-index: 1001;
    font-size: 11px;
    max-width: 300px;
    word-wrap: break-word;
}

.notification-toast.hidden {
    display: none;
}

/* 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;
    }
    
    .tab-strip {
        overflow-x: scroll;
    }
    
    .button-area {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .left-buttons, .center-buttons, .dialog-buttons {
        justify-content: center;
    }
}

@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;
    }
    
    .share-buttons {
        justify-content: center;
    }
    
    .community-gallery {
        grid-template-columns: 1fr;
    }
    
    .community-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/* 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;
}