:root {
    --bg: #121212;
    --card: #1e1e1e;
    --input: #2d2d2d;
    --border: #333;
    --accent: #007acc;
    --font: 'JetBrains Mono', monospace;
}

body {
    margin: 0;
    background: var(--bg);
    color: #ccc;
    font-family: var(--font);
    font-size: 11px;
    transition: background-color 0.2s, color 0.2s;
}

/* Main Layout Container */
.app-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: 270px;
    min-width: 270px;
    padding: 12px;
    background: #181818;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar .card {
    padding: 10px;
    margin-bottom: 8px;
}

/* Logo and Branding */
.sidebar div[style*="text-align: center"] {
    margin-bottom: 12px !important;
}

.sidebar h2 {
    font-size: 11px !important;
    margin-top: 5px !important;
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-image: radial-gradient(circle, #1a1a1a 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Grid for Architect Cards */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.card {
    background: var(--card);
    border-radius: 10px;
    padding: 15px;
    border: 1px solid var(--border);
    margin-bottom: 15px;
}

.full-width { grid-column: 1 / -1; }

/* --- FORM ELEMENTS --- */
h3 {
    margin: 0 0 8px 0;
    color: var(--accent);
    font-size: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    letter-spacing: 1px;
}

input, select, textarea {
    background: var(--input);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px;
    font-family: var(--font);
    width: 100%;
    margin-bottom: 6px;
    box-sizing: border-box;
    font-size: 11px;
}

/* Fix for the "Wonky" Checkboxes */
.tool-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.enable-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    cursor: pointer;
}

.enable-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

/* --- OUTPUT SIDEBAR --- */
.output-sidebar {
    width: 400px;
    min-width: 400px;
    padding: 20px;
    background: #181818;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

pre {
    background: #000;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid var(--accent);
    flex: 1;
    overflow: auto;
    margin-bottom: 10px;
}

code {
    color: #9cdcfe;
    white-space: pre;
    line-height: 1.5;
    font-size: 11px;
}

/* --- BUTTONS --- */
.secondary-btn {
    background: var(--input);
    color: #fff;
    border: 1px solid var(--border);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 11px;
}

.secondary-btn:hover {
    background: #444;
    border-color: var(--accent);
}

/* --- TEXTURE LAB --- */
.layer-card {
    background: #252526;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent);
}

#phoenixCanvas {
    box-shadow: 0 0 50px rgba(0,0,0,0.7);
    border: 1px solid #444;
    background: #000;
}

/* --- THEMES --- */
body.theme-purple { --accent: #a277ff; }
body.theme-red    { --accent: #ff5555; }
body.theme-orange { --accent: #ffb86c; }
body.theme-funny-gold { --accent: #ffcc00; --bg: #1a0f2e; --card: #2d1b4d; --border: #ffcc00; }

/* Scrollbars */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Mobile Responsiveness */
@media (max-width: 1000px) {
    .app-shell { flex-direction: column; overflow-y: auto; height: auto; }
    .sidebar, .output-sidebar { width: 100%; min-width: 100%; border: none; }
}
/* --- 3D BLOCK PREVIEW --- */
.cube {
    width: 160px;
    height: 160px;
    position: relative;
    transform-style: preserve-3d;
    margin: 0 auto;
    animation: rotateCube 15s infinite linear;
}

.face {
    position: absolute;
    width: 160px;
    height: 160px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    image-rendering: pixelated;
    background-color: #555;
    background-size: 160px 160px;
    background-position: 0 0;
    background-repeat: no-repeat;
}

/* Face positioning (Assuming 160px width) */
.front  { transform: translateZ(80px); }
.back   { transform: rotateY(180deg) translateZ(80px); }
.right  { transform: rotateY(90deg) translateZ(80px); }
.left   { transform: rotateY(-90deg) translateZ(80px); }
.top    { transform: rotateX(90deg) translateZ(80px); }
.bottom { transform: rotateX(-90deg) translateZ(80px); }

@keyframes rotateCube {
    from { transform: rotateX(-20deg) rotateY(0deg); }
    to   { transform: rotateX(-20deg) rotateY(360deg); }
}
/* Centering the 3D Stage */
#blockPreviewContainer {
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 350px;
    background: radial-gradient(circle, rgba(0,122,204,0.05) 0%, transparent 70%);
}

/* Fix the Toggle Bar layout */
.preview-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Ensure the Item View stays tidy */
#itemPreviewContainer {
    display: inline-block;
    transition: transform 0.3s ease;
}
/* Better multi-select styling */
select[multiple] {
    background: #121212;
    border: 1px solid var(--border);
    color: #aaa;
    padding: 5px;
    scrollbar-width: thin;
}

select[multiple] option {
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 2px;
}

select[multiple] option:checked {
    background: var(--accent) !important;
    color: white;
}