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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

#app {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Toolbar */
#toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(42, 26, 74, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
}

#toolbar button {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

#toolbar button:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
}

/* Canvas */
#canvas-container {
    flex: 1;
    position: relative;
    margin-top: 50px;
}

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

/* Control Panel */
#control-panel {
    position: fixed;
    right: 0;
    top: 50px;
    bottom: 0;
    width: 320px;
    background: rgba(42, 26, 74, 0.98);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(0, 255, 255, 0.3);
    z-index: 99;
    display: flex;
    transition: transform 0.3s;
}

#control-panel.collapsed {
    transform: translateX(280px);
}

#panel-toggle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(42, 26, 74, 0.98);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 10px;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
    font-size: 20px;
}

.panel-content {
    width: 100%;
    padding: 20px;
    overflow-y: auto;
}

.panel-content h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #00ffff;
    text-align: center;
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

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

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #b8b8ff;
}

.control-group input[type="range"] {
    width: 100%;
    height: 4px;
    background: rgba(0, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
}

.control-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.control-group input[type="color"] {
    width: 100%;
    height: 35px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

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

.hidden {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    background: rgba(42, 26, 74, 0.98);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #00ffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
}

.modal-content h2 {
    color: #00ffff;
    margin-bottom: 20px;
}

.modal-content h3 {
    color: #00ffff;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

.modal-content ul {
    list-style: none;
    padding-left: 0;
}

.modal-content li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.modal-content li:before {
    content: '▸';
    color: #00ffff;
    position: absolute;
    left: 0;
}

.modal-content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Preset Modal */
#preset-list {
    margin-bottom: 20px;
}

.preset-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 5px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preset-item span {
    color: #fff;
}

.preset-item button {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.preset-item button:hover {
    background: rgba(0, 255, 255, 0.2);
}

.preset-item .delete-btn {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.3);
}

.preset-actions {
    display: flex;
    gap: 10px;
}

.preset-actions input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
}

.preset-actions button {
    background: rgba(0, 255, 255, 0.2);
    border: 1px solid #00ffff;
    color: #00ffff;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(42, 26, 74, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    text-align: center;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    z-index: 98;
}

footer p {
    font-size: 12px;
    color: #b8b8ff;
}

footer a {
    color: #00ffff;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    #control-panel {
        width: 100%;
        transform: translateY(100%);
        top: auto;
        bottom: 0;
        border-left: none;
        border-top: 1px solid rgba(0, 255, 255, 0.3);
    }
    
    #control-panel.collapsed {
        transform: translateY(calc(100% - 100px));
    }
    
    #panel-toggle {
        left: 50%;
        top: -40px;
        transform: translateX(-50%) rotate(90deg);
        border-radius: 5px 5px 0 0;
    }
    
    #toolbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }
    
    #toolbar button {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    #canvas-container {
        margin-top: 70px;
    }
}

/* Scrollbar */
.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}