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

body {
    font-family: 'Geneva', 'Monaco', monospace;
    background: #000 url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect width="4" height="4" fill="%23000"/><circle cx="1" cy="1" r="0.5" fill="%23333"/><circle cx="3" cy="3" r="0.5" fill="%23111"/></svg>') repeat;
    color: #000;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#control-panel {
    background: #C0C0C0;
    border: 2px outset #C0C0C0;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.5);
    width: 600px;
    min-height: 500px;
    font-size: 12px;
}

.window-title {
    background: linear-gradient(to bottom, #DFDFDF 0%, #C0C0C0 50%, #A0A0A0 100%);
    border-bottom: 1px solid #808080;
    padding: 4px 8px;
    font-weight: bold;
    text-align: center;
    border: 1px inset #C0C0C0;
}

.panel-content {
    display: flex;
    height: 460px;
}

.left-sidebar {
    width: 150px;
    background: #F0F0F0;
    border-right: 1px inset #C0C0C0;
    padding: 8px;
}

.screensaver-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.screensaver-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 2px;
}

.screensaver-item:hover {
    background: #E0E0E0;
    border: 1px dotted #808080;
}

.screensaver-item.active {
    background: #0000FF;
    color: #FFF;
    border: 1px solid #000080;
}

.thumbnail {
    width: 20px;
    height: 15px;
    border: 1px inset #C0C0C0;
    background: #000;
}

.main-area {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-window {
    border: 2px inset #C0C0C0;
    background: #000;
    position: relative;
}

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

#preview-label {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 11px;
    color: #000;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mac-button {
    background: linear-gradient(to bottom, #F0F0F0 0%, #D0D0D0 50%, #C0C0C0 100%);
    border: 1px outset #C0C0C0;
    padding: 4px 12px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    border-radius: 2px;
}

.mac-button:hover {
    background: linear-gradient(to bottom, #F8F8F8 0%, #E0E0E0 50%, #D0D0D0 100%);
}

.mac-button:active {
    border: 1px inset #C0C0C0;
    background: linear-gradient(to bottom, #B0B0B0 0%, #D0D0D0 50%, #E0E0E0 100%);
}

.mac-select {
    background: #FFF;
    border: 1px inset #C0C0C0;
    padding: 2px 4px;
    font-family: inherit;
    font-size: 11px;
}

.settings {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.settings label {
    font-size: 11px;
    font-weight: bold;
}

#fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fullscreen-mode.hidden {
    display: none;
}

#fullscreen-canvas {
    display: block;
}

#exit-fullscreen {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #FFF;
    background: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1001;
}

#branding {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #FFF;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    z-index: 10;
}

/* Authentic CRT scanlines effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.02) 51%,
        transparent 52%
    );
    background-size: 100% 3px;
    pointer-events: none;
    z-index: 999;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #control-panel {
        width: 95vw;
        max-width: none;
        font-size: 11px;
    }
    
    .panel-content {
        flex-direction: column;
        height: auto;
    }
    
    .left-sidebar {
        width: 100%;
        height: 120px;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px inset #C0C0C0;
    }
    
    .screensaver-list {
        flex-direction: row;
        gap: 8px;
        padding-bottom: 8px;
    }
    
    .screensaver-item {
        flex-direction: column;
        min-width: 60px;
        text-align: center;
    }
    
    .screensaver-item span {
        font-size: 9px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60px;
    }
    
    #canvas {
        width: 100%;
        max-width: 300px;
        height: auto;
    }
    
    .controls {
        justify-content: center;
    }
}