body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #bebebe;
    color: #f0f0f0;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background-color: #1a1a1a;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 10;
}

h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #4CAF50;
    letter-spacing: -0.5px;
}

#controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #252525;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #333;
}

.toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #aaa;
    user-select: none;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(14px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

#home-button {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px;
    transition: all 0.2s ease;
    z-index: 50;
    display: none; /* Hidden by default, shown in non-overview scenes */
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

#home-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#home-button:active {
    transform: scale(0.95);
}

button {
    background-color: #333;
    color: white;
    border: 1px solid #444;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

button:hover {
    background-color: #444;
    border-color: #555;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

#stats {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #888;
    background: #252525;
    padding: 4px 12px;
    border-radius: 4px;
}

#stats span {
    color: #4CAF50;
}

#multimeter-display {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #2a2a2a;
    border: 3px solid #f44336;
    border-radius: 12px;
    padding: 10px;
    width: 200px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    display: none;
    z-index: 100;
}

.meter-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#meter-mode {
    background: #111;
    color: #ffcc00;
    border: 1px solid #444;
    padding: 5px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
}

.display-screen {
    background: #000;
    border: 2px solid #333;
    border-radius: 6px;
    padding: 15px 10px;
    text-align: center;
    min-height: 80px;
}

#multimeter-error {
    color: #ff5252;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 5px;
    min-height: 14px;
}

#multimeter-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.2rem;
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.4);
}

#multimeter-unit {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

/* Settings Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #1a1a1a;
    margin: 10% auto;
    padding: 24px;
    border: 1px solid #333;
    width: 320px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #4CAF50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #fff;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #eee;
}

.setting-actions {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
}

.action-btn {
    background-color: #4CAF50;
    width: 100%;
    padding: 10px;
    border: none;
    font-size: 1rem;
}

.action-btn:hover {
    background-color: #45a049;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border: 1px solid #444;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ccc;
    transition: .4s;
}

input:checked + .slider {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(18px);
    background-color: #fff;
}

.slider.round {
    border-radius: 22px;
}

.slider.round:before {
    border-radius: 50%;
}

#home-button {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

#home-button:hover {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    transform: scale(1.05);
}

#home-button:active {
    transform: scale(0.95);
}

main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

#canvas-container {
    flex: 1;
    position: relative;
    background-color: #b6b6b6;
}

#sim-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#inspector.hidden {
    display: none;
}

#inspector {
    width: 320px;
    background-color: #161616;
    border-left: 1px solid #333;
    padding: 20px;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}

#inspector h2 {
    margin-top: 0;
    font-size: 1.25rem;
    color: #fff;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.property-group {
    background: #222;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #333;
}

.property-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #4CAF50;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.property-label {
    color: #888;
}

.toggle-btn {
    padding: 2px 8px;
    font-size: 0.75rem;
    margin-left: 10px;
}

.fault-btn {
    width: 100%;
    margin-bottom: 8px;
    background-color: #422;
    border-color: #633;
    color: #ff9999;
}

.fault-btn:hover {
    background-color: #622;
    border-color: #844;
}

footer {
    background-color: #1a1a1a;
    padding: 8px 24px;
    border-top: 1px solid #333;
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

