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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
    color: #e0e0e0;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Toolbar */
#toolbar {
    height: 50px;
    background: rgba(26, 26, 46, 0.95);
    border-bottom: 2px solid #00d4ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    backdrop-filter: blur(10px);
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 10px;
}

.toolbar-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toolbar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.toolbar-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

/* Main Content */
#mainContent {
    flex: 1;
    display: flex;
    height: calc(100vh - 80px);
}

#viewport {
    flex: 1;
    position: relative;
    background: #0f0f0f;
}

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

#viewport-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
}

#gameMode {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
}

.game-hud {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #00d4ff;
    color: #00d4ff;
    text-align: center;
    font-family: 'Courier New', monospace;
}

/* Developer Panel */
.panel {
    width: 350px;
    background: rgba(26, 26, 46, 0.95);
    border-left: 2px solid #00d4ff;
    backdrop-filter: blur(10px);
    overflow-y: auto;
}

.panel-header {
    padding: 15px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid #00d4ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    color: #00d4ff;
    font-size: 16px;
}

.collapse-btn {
    background: none;
    border: 1px solid #00d4ff;
    color: #00d4ff;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

.panel-content {
    padding: 15px;
}

.section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.section h4 {
    color: #00d4ff;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Asset Library */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.asset-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.asset-item:hover {
    transform: scale(1.05);
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Scene Hierarchy */
.hierarchy {
    max-height: 150px;
    overflow-y: auto;
}

.hierarchy-item {
    padding: 8px;
    margin: 2px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.hierarchy-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hierarchy-item.selected {
    background: rgba(0, 212, 255, 0.3);
    border: 1px solid #00d4ff;
}

.hierarchy-icon {
    font-size: 14px;
}

.hierarchy-name {
    font-size: 12px;
    flex: 1;
}

/* Properties Panel */
.property-section h5 {
    color: #00d4ff;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.property-group {
    margin: 10px 0;
}

.property-group label {
    display: block;
    font-size: 12px;
    color: #b0b0b0;
    margin-bottom: 5px;
}

.vector-input {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.vector-input input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: #e0e0e0;
    padding: 5px;
    border-radius: 4px;
    font-size: 11px;
}

.vector-input input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

.property-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.property-btn {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.property-btn:hover {
    transform: translateY(-1px);
}

.no-selection {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Physics Controls */
.physics-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 12px;
}

.physics-controls input[type="checkbox"] {
    accent-color: #00d4ff;
}

.slider-control {
    margin: 10px 0;
}

.slider-control input[type="range"] {
    width: 100%;
    accent-color: #00d4ff;
}

/* Particle Controls */
.particle-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.particle-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.particle-btn:hover {
    transform: scale(1.05);
}

/* Status Bar */
#statusBar {
    height: 30px;
    background: rgba(26, 26, 46, 0.95);
    border-top: 1px solid #00d4ff;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 15px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    backdrop-filter: blur(10px);
}

.easter-egg {
    color: #ff6b6b;
    font-weight: bold;
}

/* Scripting Console */
.console {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 350px;
    height: 250px;
    background: rgba(26, 26, 46, 0.98);
    border-top: 2px solid #00d4ff;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.console.collapsed {
    transform: translateY(220px);
}

.console-header {
    padding: 10px 15px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid #00d4ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.console-header h4 {
    color: #00d4ff;
    font-size: 14px;
}

.console-header button {
    background: none;
    border: 1px solid #00d4ff;
    color: #00d4ff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.console-content {
    padding: 15px;
    height: calc(100% - 50px);
    display: flex;
    flex-direction: column;
}

.script-examples {
    margin-bottom: 10px;
}

.script-examples select {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: #e0e0e0;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
}

#scriptInput {
    flex: 1;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: #e0e0e0;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: none;
    margin-bottom: 10px;
}

#scriptInput:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.console-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.console-buttons button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.console-buttons button:hover {
    transform: translateY(-1px);
}

.script-output {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    padding: 10px;
    max-height: 60px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.script-output .log {
    color: #e0e0e0;
}

.script-output .error {
    color: #ff6b6b;
}

.script-output .warning {
    color: #ffd93d;
}

.script-output .success {
    color: #4ecdc4;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    margin: 5% auto;
    padding: 0;
    border: 2px solid #00d4ff;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.modal-header {
    padding: 20px;
    background: rgba(0, 212, 255, 0.1);
    border-bottom: 1px solid #00d4ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #00d4ff;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #00d4ff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
}

/* Voxel Editor */
.voxel-editor {
    text-align: center;
}

.voxel-toolbar {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.voxel-toolbar input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid #00d4ff;
    border-radius: 8px;
    cursor: pointer;
}

.voxel-toolbar button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.voxel-toolbar button.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
}

#voxelGrid {
    display: grid;
    grid-template-columns: repeat(8, 30px);
    grid-template-rows: repeat(8, 30px);
    gap: 2px;
    justify-content: center;
    margin: 20px auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.voxel {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.voxel:hover {
    border-color: #00d4ff;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

.voxel-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.voxel-actions input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 212, 255, 0.5);
    color: #e0e0e0;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    min-width: 150px;
}

.voxel-actions button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.voxel-actions button:hover {
    transform: translateY(-2px);
}

/* Tutorial */
.tutorial-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tutorial-step.active {
    display: block;
}

.tutorial-step h4 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 18px;
}

.tutorial-step p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #e0e0e0;
}

.tutorial-step ul, .tutorial-step ol {
    margin: 15px 0;
    padding-left: 25px;
}

.tutorial-step li {
    margin: 8px 0;
    line-height: 1.5;
    color: #b0b0b0;
}

.tutorial-step strong {
    color: #00d4ff;
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 212, 255, 0.3);
}

.tutorial-nav button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.tutorial-nav button:disabled {
    background: rgba(102, 126, 234, 0.3);
    cursor: not-allowed;
    transform: none;
}

.tutorial-nav button:not(:disabled):hover {
    transform: translateY(-2px);
}

#tutorialProgress {
    color: #00d4ff;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

/* Footer */
#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    border-top: 1px solid #00d4ff;
    padding: 8px 15px;
    text-align: center;
    font-size: 11px;
    color: #b0b0b0;
    backdrop-filter: blur(10px);
    z-index: 100;
}

#footer a {
    color: #00d4ff;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.8); }
}

/* Responsive */
@media (max-width: 768px) {
    .panel {
        width: 100%;
        position: fixed;
        top: 50px;
        bottom: 30px;
        left: 0;
        right: 0;
        z-index: 100;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .panel.open {
        transform: translateX(0);
    }
    
    .console {
        right: 0;
    }
    
    .toolbar-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.8);
}