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

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    overflow: hidden;
}

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

/* Header Styling */
.header {
    height: 60px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: relative;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
}

.star-icon {
    color: #00bfff;
    animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.5; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

.menu-bar {
    display: flex;
    gap: 20px;
}

.menu-bar span {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-bar span:hover {
    background: rgba(0, 191, 255, 0.1);
    color: #00bfff;
}

.project-title input {
    background: transparent;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 12px;
    color: #e0e0e0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(42, 42, 42, 0.8);
    padding: 8px 16px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.playback-controls button {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 18px;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playback-controls button:hover {
    background: rgba(0, 191, 255, 0.2);
    color: #00bfff;
}

#timeline {
    width: 200px;
    height: 4px;
    background: #333;
    outline: none;
    border-radius: 2px;
    -webkit-appearance: none;
}

#timeline::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00bfff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

#frameCounter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #a0a0a0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#viewToggle {
    background: rgba(42, 42, 42, 0.8);
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#viewToggle:hover {
    border-color: #00bfff;
    color: #00bfff;
}

.export-btn {
    background: linear-gradient(135deg, #00bfff, #0088cc);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.3);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 191, 255, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    position: relative;
}

.canvas-area {
    flex: 1;
    position: relative;
    background: #0a0a0a;
    border-right: 1px solid #333;
}

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

.canvas-fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.canvas-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(26, 26, 26, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.zoom-controls button {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-controls button:hover {
    background: rgba(0, 191, 255, 0.2);
    color: #00bfff;
}

#zoomLevel {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    min-width: 50px;
    text-align: center;
}

.performance-indicator {
    background: rgba(26, 26, 26, 0.9);
    padding: 6px 12px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

#fps {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #00ff00;
}

.canvas-overlay-controls {
    display: flex;
    gap: 8px;
}

.canvas-overlay-controls button {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid #333;
    color: #a0a0a0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.canvas-overlay-controls button:hover {
    border-color: #00bfff;
    color: #00bfff;
}

/* Node Graph Panel */
.node-graph-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(15px);
    border-left: 1px solid #333;
    display: none;
    flex-direction: column;
    z-index: 500;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h3 {
    font-weight: 600;
    color: #00bfff;
}

#fadeSlider {
    width: 100px;
    Height: 4px;
    background: #333;
    outline: none;
    border-radius: 2px;
    -webkit-appearance: none;
}

#fadeSlider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    background: #ff6b35;
    border-radius: 50%;
    cursor: pointer;
}

#closePanel {
    background: transparent;
    border: none;
    color: #a0a0a0;
    font-size: 20px;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#closePanel:hover {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
}

.node-search {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
}

.node-search input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e0e0e0;
    font-size: 13px;
}

.node-search input:focus {
    outline: none;
    border-color: #00bfff;
    box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.2);
}

.node-workspace {
    flex: 1;
    position: relative;
    overflow: auto;
    background: radial-gradient(circle at 50% 50%, rgba(0, 191, 255, 0.02) 0%, transparent 50%);
}

/* Node Library */
.node-library {
    position: absolute;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(15px);
    border-right: 1px solid #333;
    display: none;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    z-index: 500;
}

.node-library h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #00bfff;
}

.category {
    margin-bottom: 25px;
}

.category h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.node-item {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 4px 0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.node-item:hover {
    background: rgba(0, 191, 255, 0.1);
    border-color: #00bfff;
    color: #00bfff;
    transform: translateX(4px);
}

/* Nodes in workspace */
.node {
    position: absolute;
    background: rgba(42, 42, 42, 0.95);
    border: 2px solid #444;
    border-radius: 8px;
    min-width: 120px;
    backdrop-filter: blur(10px);
    cursor: move;
    transition: box-shadow 0.2s ease;
}

.node:hover {
    border-color: #00bfff;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

.node-header {
    background: rgba(0, 191, 255, 0.1);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: #00bfff;
    border-bottom: 1px solid #333;
    border-radius: 6px 6px 0 0;
}

.node-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.node-input, .node-output {
    font-size: 11px;
    padding: 4px 8px;
    background: #1a1a1a;
    border-radius: 4px;
    position: relative;
}

.node-input {
    text-align: left;
    color: #ff6b35;
}

.node-output {
    text-align: right;
    color: #00ff88;
    cursor: pointer;
}

.node-output:hover {
    background: rgba(0, 255, 136, 0.2);
}

/* Bottom Panel */
.bottom-panel {
    height: 200px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #333;
    display: flex;
}

.layers-panel, .properties-panel {
    flex: 1;
    padding: 20px;
    border-right: 1px solid #333;
}

.layers-panel h4, .properties-panel h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #00bfff;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.layer-item:hover {
    background: rgba(0, 191, 255, 0.05);
}

.eye-icon {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.eye-icon:hover {
    opacity: 0.7;
}

.opacity-slider {
    width: 80px;
    margin-left: auto;
    height: 4px;
    background: #333;
    outline: none;
    border-radius: 2px;
    -webkit-appearance: none;
}

.opacity-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: #00bfff;
    border-radius: 50%;
    cursor: pointer;
}

.property-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.property-group label {
    min-width: 80px;
    font-size: 12px;
    color: #a0a0a0;
}

.property-group input[type="number"], 
.property-group input[type="range"] {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 6px 8px;
    color: #e0e0e0;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.property-group input[type="color"] {
    width: 40px;
    height: 30px;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
}

#debugMode {
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid #ff6b35;
    color: #ff6b35;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

#debugMode:hover {
    background: rgba(255, 107, 53, 0.2);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .node-graph-panel {
        width: 350px;
    }
    
    .node-library {
        width: 220px;
    }
    
    .menu-bar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 10px;
    }
    
    .header-left {
        gap: 15px;
    }
    
    .project-title {
        display: none;
    }
    
    .bottom-panel {
        height: 150px;
        font-size: 12px;
    }
    
    .layers-panel, .properties-panel {
        padding: 15px;
    }
    
    .canvas-controls {
        bottom: 10px;
        right: 10px;
        scale: 0.9;
    }
}