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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
    color: #e0e0e0;
    overflow-x: hidden;
}

.header {
    background: rgba(26, 26, 58, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 245, 255, 0.2);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #00f5ff, #8a2be2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(0, 245, 255, 0.5);
}

.search-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    background: rgba(26, 26, 58, 0.6);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    backdrop-filter: blur(5px);
}

.search-input:focus {
    outline: none;
    border-color: #00f5ff;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.ai-button {
    padding: 0.5rem 1rem;
    background: linear-gradient(45deg, #8a2be2, #00f5ff);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(138, 43, 226, 0.4);
}

.main-container {
    display: flex;
    height: calc(100vh - 120px);
}

.sidebar {
    width: 300px;
    background: rgba(26, 26, 58, 0.4);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 245, 255, 0.2);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .categories {
    display: none;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.toggle-btn {
    background: none;
    border: none;
    color: #00f5ff;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.toggle-btn:hover {
    transform: scale(1.2);
}

.category {
    border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.category .category-header {
    cursor: pointer;
    padding: 0.75rem 1rem;
    transition: background 0.3s ease;
}

.category .category-header:hover {
    background: rgba(0, 245, 255, 0.1);
}

.category-title {
    font-weight: 600;
    color: #00f5ff;
}

.category-toggle {
    color: #8a2be2;
    transition: transform 0.3s ease;
}

.category-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-content.collapsed {
    max-height: 0;
}

.shader-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.shader-item:hover {
    background: rgba(0, 245, 255, 0.1);
    border-left-color: #00f5ff;
    transform: translateX(5px);
}

.shader-name {
    font-size: 0.9rem;
}

.difficulty {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty.beginner {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.difficulty.intermediate {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.difficulty.advanced {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: rgba(26, 26, 58, 0.4);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 245, 255, 0.2);
}

.control-select, .control-btn {
    padding: 0.5rem 1rem;
    background: rgba(26, 26, 58, 0.6);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 6px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-select:hover, .control-btn:hover {
    border-color: #00f5ff;
    box-shadow: 0 0 5px rgba(0, 245, 255, 0.3);
}

.performance-monitor {
    margin-left: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    color: #00f5ff;
}

.viewport-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.scene-container {
    flex: 1;
    background: radial-gradient(circle at center, #1a1a3a 0%, #0a0a1a 100%);
    position: relative;
}

.code-panel {
    height: 300px;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 245, 255, 0.2);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.code-panel.collapsed {
    height: 40px;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(26, 26, 58, 0.6);
    border-bottom: 1px solid rgba(0, 245, 255, 0.2);
}

.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: #8a8a8a;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.3s ease;
}

.tab.active {
    background: rgba(0, 245, 255, 0.1);
    color: #00f5ff;
    border-bottom: 2px solid #00f5ff;
}

.tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex: 1;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

.code-editor {
    flex: 1;
    background: rgba(10, 10, 26, 0.8);
    border: none;
    color: #e0e0e0;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 1rem;
    resize: none;
    outline: none;
}

.uniform-controls {
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.uniform-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(26, 26, 58, 0.3);
    border-radius: 6px;
}

.uniform-control label {
    min-width: 80px;
    font-weight: 600;
    color: #00f5ff;
    font-size: 0.9rem;
}

.uniform-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(138, 43, 226, 0.3);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.uniform-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #00f5ff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.uniform-control input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.uniform-control span {
    min-width: 60px;
    text-align: center;
    font-family: monospace;
    color: #8a8a8a;
}

.ai-panel {
    position: fixed;
    top: 120px;
    right: -400px;
    width: 380px;
    height: calc(100vh - 200px);
    background: rgba(26, 26, 58, 0.9);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 12px 0 0 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    z-index: 50;
    overflow-y: auto;
}

.ai-panel.visible {
    right: 0;
}

.ai-panel h3 {
    color: #00f5ff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.ai-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-controls textarea {
    width: 100%;
    height: 120px;
    background: rgba(10, 10, 26, 0.6);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    color: #e0e0e0;
    font-size: 0.9rem;
    resize: vertical;
    outline: none;
}

.ai-controls textarea:focus {
    border-color: #00f5ff;
    box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.ai-options {
    display: flex;
    gap: 0.5rem;
}

.ai-options select {
    flex: 1;
    padding: 0.5rem;
    background: rgba(26, 26, 58, 0.6);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 6px;
    color: #e0e0e0;
    outline: none;
}

.generate-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(45deg, #8a2be2, #00f5ff);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(138, 43, 226, 0.4);
}

.ai-status {
    margin-top: 1rem;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    border-radius: 6px;
    min-height: 30px;
}

.footer {
    background: rgba(26, 26, 58, 0.4);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 245, 255, 0.2);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.9rem;
}

.footer a {
    color: #00f5ff;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 200px;
        order: 2;
    }
    
    .content {
        order: 1;
        height: calc(100vh - 320px);
    }
    
    .ai-panel {
        position: fixed;
        top: 0;
        right: -100vw;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .code-panel {
        height: 200px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 26, 58, 0.3);
}

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

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

/* Loading animations */
@keyframes glow {
    0%, 100% { text-shadow: 0 0 20px rgba(0, 245, 255, 0.5); }
    50% { text-shadow: 0 0 30px rgba(0, 245, 255, 0.8), 0 0 40px rgba(138, 43, 226, 0.3); }
}

.title {
    animation: glow 3s ease-in-out infinite;
}

/* Shader compilation indicator */
.compiling {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3) !important;
}

.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3) !important;
}

.success {
    border-color: #22c55e !important;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3) !important;
}