:root {
    --bg-color: #202124;
    --surface-color: #292A2D;
    --surface-hover: #3C4043;
    --primary-color: #8AB4F8;
    --text-primary: #E8EAED;
    --text-secondary: #9AA0A6;
    --border-color: #444746;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Roboto, system-ui, -apple-system, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
}

/* Icons */
.icon { width: 20px; height: 20px; fill: var(--text-secondary); }
.icon-small { width: 20px; height: 20px; fill: currentColor; }

/* Top App Bar */
.top-bar {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    z-index: 10;
}

.action-area { display: flex; gap: 3px; }

.input-group {
    display: flex;
    flex: 1;
    align-items: center;
    background-color: var(--bg-color);
    border-radius: 24px;
    padding: 0 0 0 8px;
    border: 1px solid var(--border-color);
}

.input-group input{
    background: transparent;
    flex: 1;
    border: none;
    color: var(--text-primary);
    padding: 12px 0px;
    outline: none;
    font-size: 14px;
}

.mat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
}

.mat-btn.primary { background-color: var(--primary-color); color: #202124; }
.mat-btn.secondary { 
    background-color: var(--surface-hover); 
    color: var(--text-primary); 
}
.mat-btn.secondary:hover {
    background-color: #4c5155;
}


/* Stage & Scaling */
.stage {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    overflow: auto; /* Allows panning if scaled too large */
    position: relative;
}

#scale-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: center center;
}

#iframe-container {
    background-color: #fff;
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

#simulator-frame { width: 100%; height: 100%; display: block; }

/* Bottom Controls */
.controls {
    display: flex;
    flex-direction: column;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    height: 35vh;
}

.sliders {
    padding: 0 8px 24px 8px;
    margin-botom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

/* Lubed Sliders */
.mat-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
.mat-slider:focus { outline: none; }
.mat-slider::-webkit-slider-runnable-track {
    width: 100%; height: 4px; background: var(--border-color); border-radius: 2px;
}
.mat-slider::-webkit-slider-thumb {
    height: 16px; width: 16px; border-radius: 50%;
    background: var(--primary-color);
    -webkit-appearance: none; margin-top: -6px;
}

/* Device List */
.device-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    border-radius: 8px;
    text-align: left;
}

.device-btn.active {
    background: rgba(138, 180, 248, 0.12);
    color: var(--primary-color);
}
