/* Enhanced styles for retro-futuristic aesthetic */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #0a0a0a;
    font-family: 'Rajdhani', sans-serif;
}

/* LED glow effects - enhanced */
.led-glow-red {
    box-shadow: 
        0 0 10px #ff3333, 
        0 0 20px #ff3333, 
        0 0 30px #ff3333,
        inset 0 0 8px #ff6666;
}

.led-glow-green {
    box-shadow: 
        0 0 10px #33ff66, 
        0 0 20px #33ff66, 
        0 0 30px #33ff66,
        inset 0 0 8px #66ff99;
}

.led-glow-blue {
    box-shadow: 
        0 0 10px #3366ff, 
        0 0 20px #3366ff, 
        0 0 30px #3366ff,
        inset 0 0 8px #6699ff;
}

.led-glow-amber {
    box-shadow: 
        0 0 10px #ffaa00, 
        0 0 20px #ffaa00, 
        0 0 30px #ffaa00,
        inset 0 0 8px #ffcc44;
}

/* Display styles */
.segment-display {
    font-family: 'VT323', monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

.lcd-display {
    font-family: 'Share Tech Mono', monospace;
    background: linear-gradient(180deg, #001a0d 0%, #000d06 100%);
    color: #00ff41;
    border: 2px solid #003311;
    border-radius: 4px;
}

.terminal-text {
    font-family: 'VT323', monospace;
    text-shadow: 0 0 5px currentColor;
}

.crt-display {
    background: linear-gradient(180deg, #001a0d 0%, #000d06 100%);
    border: 2px solid #003311;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.crt-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1;
}

/* Component styling */
.component-shadow {
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 -1px 2px rgba(255, 255, 255, 0.1);
}

.canvas-component {
    position: absolute;
    user-select: none;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #444;
    border-radius: 8px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.2s ease;
}

.canvas-component.selected {
    border-color: #00ffff;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.component-drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 28px;
    cursor: move;
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border-bottom: 1px solid #555;
    border-radius: 6px 6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.component-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
}

.component-content {
    position: absolute;
    top: 30px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: #0a0a0a;
    border-radius: 4px;
    overflow: hidden;
}

.component-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff3333;
    color: white;
    border: 2px solid #aa0000;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.component-delete-btn:hover {
    background: #ff5555;
    transform: scale(1.1);
}

/* Port styling - enhanced */
.port {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #555;
    background: #222;
    cursor: crosshair;
    transition: all 0.2s ease;
    z-index: 5;
}

.port:hover,
.port.port-highlight {
    background: #00ff88;
    border-color: #00ff88;
    box-shadow: 0 0 12px #00ff88;
    transform: scale(1.3);
}

.input-port {
    border-color: #4488ff;
}

.output-port {
    border-color: #ff8844;
}

/* Wire rendering - Bezier curves */
.wire-path {
    filter: drop-shadow(0 0 3px currentColor);
    transition: stroke-width 0.2s ease, filter 0.2s ease;
}

.wire-signal {
    filter: drop-shadow(0 0 6px currentColor);
}

/* Screw decorations */
.screw {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #bbb, #555, #333);
    border: 1px solid #222;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.screw::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    width: 60%;
    height: 2px;
    background: #333;
}

/* Grid pattern */
.grid-pattern {
    background-color: #0f0f0f;
    background-image: 
        radial-gradient(circle, #1a1a1a 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Top toolbar */
.top-toolbar {
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    height: 52px;
    font-family: 'Orbitron', sans-serif;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.toolbar-btn:hover {
    background: #3a3a3a;
    border-color: #666;
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: translateY(0);
}

.power-button-mini {
    padding: 6px 12px;
    background: linear-gradient(135deg, #44ff88, #00aa44);
    border: 2px solid #00aa44;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(68, 255, 136, 0.5);
}

.power-button-mini.off {
    background: #333;
    border-color: #555;
    box-shadow: none;
    color: #666;
}

/* Component palette */
.component-palette {
    background: #0a0a0a;
}

.component-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    margin: 8px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #333;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s ease;
}

.component-card:hover {
    border-color: #ffaa00;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.3);
}

.component-card:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.component-icon-large {
    font-size: 48px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Programming panel */
.programming-panel {
    background: #0a0a0a;
}

.block-toolbox {
    background: #0f0f0f;
    max-height: 300px;
    overflow-y: auto;
}

.block-btn {
    padding: 6px 12px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.block-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.block-container {
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: move;
    transition: all 0.2s ease;
}

.block-container:hover {
    transform: scale(1.02);
}

.block-container.executing {
    animation: execute-pulse 0.5s ease-in-out;
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.8);
}

@keyframes execute-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Canvas controls */
.canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 26, 26, 0.9);
    border: 2px solid #444;
    border-radius: 8px;
    padding: 8px;
    backdrop-filter: blur(10px);
}

.control-btn {
    width: 32px;
    height: 32px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.control-btn:hover {
    background: #3a3a3a;
    transform: scale(1.1);
}

/* Slider custom styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-track {
    background: #444;
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffaa00, #ff6600);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
    border: 2px solid #ff6600;
}

input[type="range"]::-moz-range-track {
    background: #444;
    height: 6px;
    border-radius: 3px;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffaa00, #ff6600);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
    border: 2px solid #ff6600;
}

/* Manufacturer plate */
.manufacturer-plate {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #888 0%, #aaa 50%, #888 100%);
    color: #000;
    border-top: 2px solid #666;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Utility classes */
.bg-gray-850 {
    background-color: #1a1a1a;
}

.bg-gray-950 {
    background-color: #0a0a0a;
}