/* Retro Mac-inspired styling */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body {
    font-family: 'VT323', 'Monaco', 'Courier New', monospace;
    background: #000;
    color: #fff;
    overflow: hidden;
    user-select: none;
}

.app-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.retro-header {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-bottom: 2px solid #444;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 100;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.title {
    font-size: 24px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 14px;
    color: #ccc;
    font-style: italic;
}

.mode-toggles {
    display: flex;
    gap: 5px;
}

.color-schemes {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
}

/* Retro Button and Select Styling */
.retro-btn, .retro-select {
    font-family: inherit;
    font-size: 14px;
    padding: 6px 12px;
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 50%, #d0d0d0 100%);
    border: 2px outset #ccc;
    color: #000;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.1s;
}

.retro-btn:hover, .retro-select:hover {
    background: linear-gradient(180deg, #fff 0%, #f0f0f0 50%, #e0e0e0 100%);
}

.retro-btn:active {
    border-style: inset;
    background: linear-gradient(180deg, #d0d0d0 0%, #e0e0e0 50%, #f0f0f0 100%);
}

.retro-btn.active {
    background: linear-gradient(180deg, #007acc 0%, #0066aa 50%, #005588 100%);
    color: white;
    border-color: #0066aa;
}

.retro-btn.small {
    padding: 4px 8px;
    font-size: 12px;
}

/* Main Canvas Area */
.main-area {
    flex: 1;
    position: relative;
    background: #000;
}

#canvas {
    display: block;
    cursor: crosshair;
    background: #000;
}

.click-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    text-align: center;
    pointer-events: none;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Control Panel */
.control-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.7);
    z-index: 200;
    max-width: 250px;
}

.panel-toggle {
    width: 100%;
    padding: 8px;
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border: none;
    color: #fff;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid #444;
}

.panel-content {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s;
}

.panel-content.collapsed {
    display: none;
}

.control-section {
    margin-bottom: 20px;
}

.control-section h3 {
    color: #00ff00;
    font-size: 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.control-item {
    display: block;
    margin: 8px 0;
    color: #ccc;
    font-size: 14px;
}

.control-item input[type="range"] {
    width: 100%;
    margin-top: 5px;
}

.control-item input[type="checkbox"] {
    margin-right: 8px;
}

/* Footer */
.retro-footer {
    background: linear-gradient(0deg, #2a2a2a 0%, #1a1a1a 100%);
    border-top: 2px solid #444;
    padding: 8px 20px;
    font-size: 12px;
    z-index: 100;
    position: relative;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888;
}

.footer-buttons {
    display: flex;
    gap: 10px;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.mac-dialog {
    background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
    border: 3px outset #ccc;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    min-width: 300px;
    text-align: center;
}

.dialog-title {
    font-weight: bold;
    color: #000;
    margin-bottom: 20px;
    font-size: 18px;
}

.progress-container {
    color: #000;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #fff;
    border: 2px inset #ccc;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007acc 0%, #0099ff 100%);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-size: 12px;
    color: #666;
}

/* Screensaver Mode */
body.screensaver-mode .retro-header,
body.screensaver-mode .retro-footer,
body.screensaver-mode .control-panel {
    display: none;
}

body.screensaver-mode .main-area {
    height: 100vh;
}

body.screensaver-mode #canvas {
    cursor: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .control-panel {
        position: fixed;
        bottom: 20px;
        right: 20px;
        left: 20px;
        top: auto;
        max-width: none;
    }
    
    .panel-content {
        max-height: 200px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .title {
        font-size: 20px;
    }
    
    .click-instruction {
        font-size: 16px;
    }
}

/* Scanline effect */
body.scanlines::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 50;
}

/* Scrollbar styling for retro look */
.panel-content::-webkit-scrollbar {
    width: 12px;
}

.panel-content::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 2px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #666 0%, #444 100%);
    border: 1px solid #333;
    border-radius: 2px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #777 0%, #555 100%);
}

/* Custom range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

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

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: linear-gradient(180deg, #f0f0f0 0%, #d0d0d0 100%);
    height: 16px;
    width: 16px;
    border-radius: 2px;
    border: 2px outset #ccc;
    margin-top: -5px;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: linear-gradient(180deg, #fff 0%, #e0e0e0 100%);
}