﻿/* Base Variables & Reset */
:root {
    --bg-dark: #0f0f15;
    --bg-panel: #1a1a24;
    --bg-element: #252533;
    --text-primary: #e0e0e0;
    --text-muted: #888899;
    --accent: #0abde3;
    --accent-hover: #089bba;
    --danger: #ff5252;
    --warning: #ffb142;
    --success: #32ff7e;
    --border: #333344;
}

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

body {
    font-family: system-ui,-apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
}

.logo {
    font-size: 20px;
    color: #fff;
}

.pro {
    color: var(--accent);
}

/* Header */
#app-header {
    height: 60px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.view-tabs {
    display: flex;
    gap: 10px;
    background: var(--bg-dark);
    padding: 4px;
    border-radius: 8px;
}

.tab {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.tab:hover {
    color: #fff;
}

.tab.active {
    background: var(--bg-element);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Main Layout */
#main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

aside {
    width: 320px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#sidebar-right {
    border-left: 1px solid var(--border);
    border-right: none;
}

/* Panels */
.panel-section {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.panel-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.input-group label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

input,
select {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Cascadia Code','Fira Code',Consolas, monospace;
    font-size: 13px;
    width: 100%;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--accent);
}

/* Buttons */
button {
    font-family: system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    transition: 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 8px 20px;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-element);
    color: #fff;
    padding: 8px 20px;
    width: 100%;
    border: 1px solid var(--border);
}

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

.tool-btn {
    background: rgba(37, 37, 51, 0.8);
    backdrop-filter: blur(5px);
    color: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border: 1px solid var(--border);
}

.tool-btn:hover {
    background: var(--bg-element);
}

/* Stats Box */
.stats-box {
    background: var(--bg-dark);
    border-radius: 6px;
    padding: 12px;
    border: 1px solid var(--border);
    font-size: 13px;
    line-height: 1.8;
}

.stats-box p {
    display: flex;
    justify-content: space-between;
}

.stats-box span {
    font-family: 'Cascadia Code','Fira Code',Consolas, monospace;
    font-weight: 600;
}

.stats-box hr {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 8px 0;
}

.warning {
    color: var(--warning);
}

.highlight {
    color: var(--accent);
}

/* BOM List */
.bom-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.bom-item:last-child {
    border-bottom: none;
}

.bom-name {
    color: var(--text-muted);
}

.bom-val {
    font-family: 'Cascadia Code','Fira Code',Consolas, monospace;
    color: #fff;
}

/* Canvas Area */
#canvas-area {
    flex: 1;
    position: relative;
    background: radial-gradient(circle at center, #1a1a24 0%, #0f0f15 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#canvas-toolbar {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

canvas {
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}