/* PAL Signal Simulator Styles */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

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

body {
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #00ff00;
    min-height: 100vh;
    overflow-x: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid #00ff00;
    margin-bottom: 30px;
    position: relative;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #88ff88;
    margin-bottom: 20px;
}

.status-lights {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.light {
    padding: 5px 15px;
    border: 2px solid #333;
    border-radius: 20px;
    background: #111;
    color: #666;
    font-size: 0.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.light.active {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 15px #00ff00;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    align-items: start;
}

/* Control Panel Styles */
.control-panel {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border: 2px solid #333;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 255, 0, 0.1);
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
}

.control-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-section h3 {
    color: #ffff00;
    font-size: 1rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}

.control-row label {
    min-width: 80px;
    font-size: 0.8rem;
    color: #cccccc;
}

/* Input Styles */
input[type="range"] {
    flex: 1;
    height: 4px;
    background: #333;
    outline: none;
    border-radius: 2px;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #00ff00;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px #00ff00;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00ff00;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 5px #00ff00;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #00ff00;
}

select {
    background: #222;
    color: #00ff00;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 5px;
    font-family: inherit;
    font-size: 0.8rem;
    width: 100%;
}

select option {
    background: #222;
    color: #00ff00;
}

/* Display Value Styles */
span[id$="-display"] {
    min-width: 50px;
    font-size: 0.7rem;
    color: #ffff00;
    text-align: right;
}

/* Phase Indicator */
.phase-indicator {
    background: #00ff00;
    color: #000;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

/* VU Meter */
.vu-meter {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.vu-bar {
    height: 100%;
    background: #00ff00;
    width: 85%;
    transition: all 0.2s ease;
    border-radius: 4px;
}

/* Display Area */
.display-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Waveform Display */
.waveform-display {
    background: #000;
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

.waveform-label {
    background: #222;
    padding: 8px 15px;
    font-size: 0.8rem;
    color: #ffff00;
    border-top: 1px solid #444;
}

/* Main Display */
.main-display {
    position: relative;
    background: #000;
    border: 3px solid #333;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
}

#main-canvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

/* Scanlines Effect */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
}

/* Technical Info Panel */
.tech-info {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.8rem;
    line-height: 1.6;
}

.tech-info h4 {
    color: #ffff00;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tech-info div {
    margin-bottom: 5px;
    color: #cccccc;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
    color: #666;
    font-size: 0.8rem;
}

.footer a {
    color: #00ff00;
    text-decoration: none;
}

.footer a:hover {
    text-shadow: 0 0 5px #00ff00;
}

.easter-egg {
    margin-top: 10px;
    font-size: 0.7rem;
    opacity: 0.7;
    transition: color 0.3s ease;
}

/* Canvas Styles */
canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#waveform-canvas {
    display: block;
    width: 100%;
    background: #000;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 280px 1fr;
        gap: 20px;
    }
    
    .title {
        font-size: 2rem;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .control-panel {
        order: 2;
    }
    
    .display-area {
        order: 1;
    }
    
    .title {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    .control-row {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .control-row label {
        min-width: auto;
    }
    
    .status-lights {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
}

/* Animations */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.light.active {
    animation: flicker 2s infinite;
}

/* CRT Glow Effects */
.main-display::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
        rgba(0, 255, 0, 0.1) 0%, 
        transparent 50%, 
        rgba(0, 255, 0, 0.1) 100%);
    border-radius: 12px;
    z-index: -1;
}