:root {
    --bg-light: #1a1a1a;
    --bg-dark: #0a0a0a;
    --editor-light: rgba(255, 255, 255, 0.1);
    --editor-dark: rgba(20, 20, 20, 0.9);
    --text-light: #f0f0f0;
    --text-dark: #e2e2e2;
    --primary: #b22222; 
    --primary-dark: #8b1a1a;
    --secondary: #ff4500;
    --accent: #ff6347; 
    --error: #ff0000;
    --glass-blur: 15px;
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
}

body {
    margin: 0;
    font-family: 'Fira Code', monospace;
    background: url('https://wallpaperaccess.com/full/317501.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-light);
    transition: background-image 1s ease-in-out, color 0.5s ease;
    line-height: 1.6;
}

body.dark-mode {
    background: url('https://wallpaperaccess.com/full/317501.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-dark);
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    backdrop-filter: brightness(0.7);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: var(--glass-border);
    z-index: 10;
    box-shadow: 0 0 15px var(--primary);
}

.dark-mode header {
    background: rgba(10, 10, 10, 0.8);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    font-family: 'Courier New', Courier, monospace;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pro-badge {
    background: var(--secondary);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    box-shadow: 0 0 8px var(--secondary);
}

.dark-mode .pro-badge {
    background: var(--accent);
}

#3d-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 0 15px var(--primary);
}

.glass-button {
    background: rgba(0, 0, 0, 0.3);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 10px var(--primary);
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
}

.glass-button:hover {
    background: rgba(255, 0, 0, 0.5);
    color: white;
    box-shadow: 0 0 20px var(--accent);
}

.dark-mode .glass-button {
    background: rgba(20, 0, 0, 0.5);
    color: var(--accent);
}

.dark-mode .glass-button:hover {
    background: rgba(255, 69, 0, 0.7);
    color: white;
    box-shadow: 0 0 25px var(--accent);
}

.glass-panel {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 0 25px 0 rgba(255, 0, 0, 0.4);
    color: var(--text-light);
    font-family: 'Courier New', Courier, monospace;
}

.dark-mode .glass-panel {
    background: rgba(10, 0, 0, 0.7);
    color: var(--text-dark);
    box-shadow: 0 0 30px 0 rgba(255, 69, 0, 0.6);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 1rem;
    gap: 1rem;
}

.sidebar {
    width: 280px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 280px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px var(--primary);
    border-radius: 16px;
}

.file-explorer h2 {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 8px var(--accent);
}

.file {
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    color: var(--text-light);
    font-weight: 600;
    font-family: 'Courier New', Courier, monospace;
}

.file:hover {
    background: rgba(255, 0, 0, 0.3);
    color: white;
    box-shadow: 0 0 15px var(--accent);
}

.dark-mode .file:hover {
    background: rgba(255, 69, 0, 0.4);
}

.file.active {
    background: rgba(255, 0, 0, 0.4);
    color: var(--accent);
    font-weight: 700;
    box-shadow: 0 0 20px var(--accent);
}

.file-icon {
    opacity: 0.9;
    font-size: 1.3rem;
}

#3d-cube-container {
    flex: 1;
    min-height: 250px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 30px var(--primary);
}

.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.code-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(10, 10, 10, 0.85);
    border-radius: 16px;
    box-shadow: 0 0 30px var(--primary);
}

.editor-header {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.2rem;
    background: rgba(139, 26, 26, 0.9);
    color: #f0f0f0;
    border-radius: 16px 16px 0 0;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    text-shadow: 0 0 10px var(--accent);
}

.window-controls {
    display: flex;
    gap: 0.6rem;
    margin-right: 1rem;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 0 8px var(--accent);
}

.dot:hover {
    transform: scale(1.2);
}

.red {
    background-color: var(--error);
}

.yellow {
    background-color: var(--accent);
}

.green {
    background-color: var(--secondary);
}

.file-name {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    opacity: 0.95;
    text-shadow: 0 0 8px var(--accent);
}

#code-input {
    flex: 1;
    padding: 1.8rem;
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    line-height: 1.8;
    border: none;
    resize: none;
    background: rgba(20, 20, 20, 0.95);
    color: #f0f0f0;
    outline: none;
    border-radius: 0 0 16px 16px;
    box-shadow: inset 0 0 15px var(--primary);
}

#code-output {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 1.8rem;
    pointer-events: none;
    overflow: auto;
    background: transparent;
    color: #f0f0f0;
    font-family: 'Fira Code', monospace;
    font-size: 16px;
}

.code-editor {
    position: relative;
}

.terminal {
    display: flex;
    flex-direction: column;
    height: 30%;
    min-height: 200px;
    background: rgba(20, 0, 0, 0.85);
    border-radius: 16px;
    box-shadow: 0 0 30px var(--primary);
    color: #f0f0f0;
    font-family: 'Courier New', Courier, monospace;
}

.terminal-header {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.2rem;
    background: rgba(139, 26, 26, 0.9);
    color: #f0f0f0;
    border-radius: 16px 16px 0 0;
    font-weight: 700;
    text-shadow: 0 0 10px var(--accent);
}

#terminal-output {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    background: rgba(20, 20, 20, 0.95);
    color: #f0f0f0;
    border-radius: 0 0 16px 16px;
    box-shadow: inset 0 0 15px var(--primary);
}

.terminal-input {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.2rem;
    background: rgba(139, 26, 26, 0.9);
    border-radius: 0 0 16px 16px;
    gap: 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #f0f0f0;
}

.prompt {
    color: var(--secondary);
    font-weight: bold;
}

#command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f0f0f0;
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    outline: none;
    padding: 0.5rem 0;
}

#command-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

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

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

/* Responsive adjustments */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: auto;
        flex-direction: row;
        gap: 1rem;
    }
    
    .file-explorer {
        flex: 1;
    }
    
    #3d-cube-container {
        min-height: 150px;
        width: 150px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        flex-direction: column;
    }
    
    #3d-cube-container {
        width: auto;
    }
}
