@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a0b2e 50%, #16213e 100%);
    color: #ffffff;
    overflow-x: hidden;
}

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

.header {
    background: linear-gradient(90deg, #4C1F7A 0%, #B83DBA 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00FFFF;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.1) 2px,
        rgba(0, 255, 255, 0.1) 4px
    );
    pointer-events: none;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 
        0 0 10px #00FFFF,
        2px 0 0 #ff0000,
        -2px 0 0 #00ff00;
    animation: chromatic-pulse 3s ease-in-out infinite;
}

@keyframes chromatic-pulse {
    0%, 100% { 
        text-shadow: 0 0 10px #00FFFF, 2px 0 0 #ff0000, -2px 0 0 #00ff00; 
    }
    50% { 
        text-shadow: 0 0 20px #B83DBA, 3px 0 0 #ff0000, -3px 0 0 #00ff00; 
    }
}

.nav-tabs {
    display: flex;
    gap: 1rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #00FFFF;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-btn:hover,
.tab-btn.active {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.main-content {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem;
}

.sidebar-left,
.sidebar-right {
    width: 280px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.sidebar-left h3,
.sidebar-right h3 {
    color: #00FFFF;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-shadow: 0 0 10px currentColor;
}

.preset-grid {
    display: grid;
    gap: 0.5rem;
}

.preset-btn {
    background: linear-gradient(45deg, #4C1F7A, #B83DBA);
    border: 1px solid #00FFFF;
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.preset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.preset-btn:hover::before {
    left: 100%;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-zone {
    width: 100%;
    max-width: 800px;
    height: 400px;
    border: 3px dashed #00FFFF;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    text-align: center;
}

.upload-zone:hover,
.upload-zone.drag-hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    animation: glitch-border 0.5s ease;
}

@keyframes glitch-border {
    0%, 100% { border-color: #00FFFF; }
    25% { border-color: #ff0080; }
    50% { border-color: #00ff80; }
    75% { border-color: #8000ff; }
}

#main-canvas {
    border: 2px solid #00FFFF;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    display: none;
    max-width: 100%;
    height: auto;
}

.canvas-controls {
    display: flex;
    gap: 1rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #00FFFF;
    font-size: 0.9rem;
    text-shadow: 0 0 5px currentColor;
}

.slider {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #1a0b2e, #4C1F7A);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00FFFF, #B83DBA);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

.bottom-toolbar {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.tool-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #00FFFF;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.tool-btn.primary {
    background: linear-gradient(45deg, #B83DBA, #00FFFF);
    border-color: #ffffff;
}

.tool-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 255, 255, 0.3);
}

.tool-btn:active {
    transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar-left,
    .sidebar-right {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-title {
        font-size: 1.8rem;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .bottom-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .preset-grid {
        grid-template-columns: 1fr;
    }
    
    .canvas-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

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

/* Glow animations */
@keyframes glow {
    0%, 100% { 
        filter: drop-shadow(0 0 5px currentColor);
    }
    50% { 
        filter: drop-shadow(0 0 20px currentColor);
    }
}

.control-group label {
    animation: glow 2s ease-in-out infinite;
}