@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

body {
    margin: 0;
    overflow: hidden;
    background-color: #f8fafc;
    font-family: 'Inter', sans-serif;
}

#canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    outline: none;
    background-color: #f8fafc;
    touch-action: none;
}

#canvas-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    touch-action: none;
}

#labels-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.panel-bg {
    background-color: #0f172a;
    border-right: 1px solid #334155;
}

.ui-btn {
    background: #1e293b;
    border: 1px solid #475569;
    color: #f8fafc;
    border-radius: 6px;
    padding: 4px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ui-btn:hover {
    background: #334155;
    border-color: #64748b;
}

.ui-btn.active {
    background: #3b82f6;
    border-color: #60a5fa;
    color: white;
}

.ui-input {
    background: #1e293b;
    border: 1px solid #475569;
    color: #f8fafc;
    padding: 4px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    width: 100%;
    border-radius: 4px;
    transition: all 0.2s;
}

.ui-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.ui-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #0f172a;
}

.ui-btn-small {
    background: #1e293b;
    border: 1px solid #475569;
    color: #f8fafc;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
    user-select: none;
    transition: all 0.2s;
}

.ui-btn-small:hover {
    background: #334155;
    border-color: #64748b;
}

.gear-list-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    color: #94a3b8;
    border-radius: 4px;
    margin-bottom: 6px;
    border-left: 4px solid transparent;
    transition: all 0.2s;
    background-color: #1e293b;
}

.gear-list-item:hover {
    background-color: #334155;
    color: #f8fafc;
}

.gear-list-item.selected {
    background-color: #1e3a8a;
    color: #ffffff;
    border-left: 4px solid #3b82f6;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #334155;
    padding-bottom: 6px;
}

.property-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    transition: opacity 0.2s;
}

.property-label {
    flex: 1.2;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.property-control {
    flex: 1;
    display: flex;
    gap: 6px;
    align-items: center;
}

.gear-label {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5e1;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #0f172a;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    pointer-events: auto;
    cursor: default;
    transition: transform 0.1s, z-index 0.1s;
}

.gear-label:hover {
    z-index: 20 !important;
    transform: translate(-50%, -50%) scale(1.15) !important;
    cursor: pointer;
}

input[type="checkbox"] {
    appearance: none;
    background-color: #1e293b;
    margin: 0;
    font: inherit;
    color: white;
    width: 1.2em;
    height: 1.2em;
    border: 1px solid #475569;
    border-radius: 4px;
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="checkbox"]:hover {
    border-color: #64748b;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: #3b82f6;
    border-radius: 2px;
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:checked {
    border-color: #3b82f6;
}