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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(45deg, #1a1a2e, #16213e);
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
    margin-bottom: 10px;
}

header p {
    color: #aaa;
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

.monitor-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.monitor-frame {
    background: linear-gradient(145deg, #f5f5dc, #e0e0d0);
    border-radius: 20px;
    padding: 40px 30px 50px 30px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    position: relative;
    border: 3px solid #d3d3d3;
}

.monitor-bezel {
    background: #2f2f2f;
    border-radius: 15px;
    padding: 20px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.brand-label {
    position: absolute;
    top: -25px;
    left: 20px;
    color: #666;
    font-size: 0.8em;
    font-weight: bold;
    background: linear-gradient(145deg, #f5f5dc, #e0e0d0);
    padding: 2px 8px;
    border-radius: 4px;
}

.power-led {
    position: absolute;
    top: -25px;
    right: 20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    border: 2px solid #666;
    transition: all 0.3s ease;
}

.power-led.on {
    background: #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

#vgaCanvas {
    width: 640px;
    height: 480px;
    background: #000;
    border: 2px solid #000;
    border-radius: 8px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.monitor-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
}

.knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ddd, #999);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    position: relative;
}

.knob::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 6px;
    background: #333;
    border-radius: 1px;
}

.power-button {
    margin-top: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e0e0e0, #c0c0c0);
    border: 3px solid #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.power-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.power-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.power-button.off {
    background: linear-gradient(145deg, #999, #777);
}

.power-symbol {
    font-size: 1.5em;
    color: #333;
    font-weight: bold;
}

.power-button.off .power-symbol {
    color: #555;
}

.control-panel {
    background: linear-gradient(145deg, #2a2a3e, #1f1f2e);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

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

.panel-section h3 {
    color: #00ff88;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-shadow: 0 0 5px #00ff88;
}

.panel-section label {
    display: block;
    margin-bottom: 12px;
    color: #ccc;
    font-size: 0.9em;
}

.panel-section select,
.panel-section input[type="range"] {
    width: 100%;
    margin-top: 5px;
    padding: 5px;
    background: #1a1a2e;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
}

.panel-section input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #00ff88;
}

.panel-section button {
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: linear-gradient(145deg, #0066cc, #0052a3);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.panel-section button:hover {
    background: linear-gradient(145deg, #0077dd, #0063b3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.panel-section button:active {
    transform: translateY(0);
}

.panel-section button:disabled {
    background: linear-gradient(145deg, #666, #555);
    cursor: not-allowed;
    transform: none;
}

#degaussBtn {
    background: linear-gradient(145deg, #ff6600, #cc5200);
}

#degaussBtn:hover:not(:disabled) {
    background: linear-gradient(145deg, #ff7700, #dd5500);
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #888;
}

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

footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .control-panel {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .monitor-frame {
        padding: 20px 15px 30px 15px;
    }
    
    #vgaCanvas {
        width: 100%;
        height: auto;
        max-width: 640px;
        aspect-ratio: 4/3;
    }
    
    .panel-section {
        margin-bottom: 20px;
    }
}

/* Scanline animation effect */
@keyframes scanlines {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* CRT flicker effect */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.98; }
}

/* Degauss effect */
@keyframes degauss {
    0%, 100% { filter: none; }
    25% { filter: hue-rotate(90deg) blur(1px); }
    50% { filter: hue-rotate(180deg) blur(2px); }
    75% { filter: hue-rotate(270deg) blur(1px); }
}

.degaussing {
    animation: degauss 0.5s ease-in-out;
}

/* Power on/off effect */
.power-on {
    animation: powerOn 0.5s ease-out;
}

@keyframes powerOn {
    0% {
        transform: scaleY(0);
        filter: brightness(2);
    }
    50% {
        transform: scaleY(0.1);
        filter: brightness(1.5);
    }
    100% {
        transform: scaleY(1);
        filter: brightness(1);
    }
}