:root {
    --bg: #050505;
    --card: #111;
    --green: #00FF41;
    --border: #262626;
    --gap: 30px;
}

body {
    margin: 0;
    background: var(--bg);
    color: white;
    font-family: 'Inter', sans-serif;
    /* Use min-height so the page can expand past the fold */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Static, Slim Header */
.navbar {
    height: 60px;
    background: #000;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gap);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Main Workspace */
.dashboard-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: var(--gap);
    padding: var(--gap);
    flex-grow: 1;
    /* Removed overflow: hidden to allow browser scrollbar */
}

.controls-sidebar {
    background: var(--card);
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Align-self start prevents the sidebar from stretching 
       awkwardly if the right side is longer */
    align-self: start;
    position: sticky;
    top: 90px;
    /* Sticks sidebar while scrolling preview area */
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-content label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
}

textarea,
select,
input[type="range"] {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid var(--border);
    color: white;
    padding: 10px;
    border-radius: 6px;
    outline: none;
}

.preview-area {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Start from top to allow growth */
    padding: 40px;
    gap: var(--gap);
    min-height: 600px;
}

.canvas-wrapper {
    width: 100%;
    max-width: 800px;
    border: 1px solid var(--green);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    background: #000;
}

.canvas-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

.api-output {
    width: 100%;
    max-width: 800px;
    background: #000;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

code {
    color: var(--green);
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
    line-height: 1.4;
    background: #080808;
    padding: 10px;
    border-radius: 4px;
}

.action-btn {
    background: var(--green);
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.action-btn:hover {
    opacity: 0.9;
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: #fff;
}

/* Mobile Responsiveness - Critical for Production */
@media (max-width: 900px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .controls-sidebar {
        position: static;
    }
}