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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0b;
    color: #fafafa;
    min-height: 100vh;
    overflow: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    background: rgba(10, 10, 11, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
}

.logo h1 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.3px;
}

/* Nav Center - Shader Selector */
.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
}

.shader-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #888;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.shader-btn:hover {
    color: #ccc;
}

.shader-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Nav Right */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #888;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: #fff;
}

.nav-link i {
    width: 14px;
    height: 14px;
    stroke-width: 1.5;
}

/* Canvas */
#shader-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Shader Info */
.shader-info {
    position: fixed;
    bottom: 32px;
    left: 32px;
    z-index: 100;
}

.shader-info h2 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #fff;
    margin-bottom: 6px;
}

.shader-info p {
    font-size: 0.875rem;
    font-weight: 400;
    color: #666;
    max-width: 300px;
}

/* Controls Panel */
.controls-panel {
    position: fixed;
    top: 72px;
    right: 20px;
    bottom: 20px;
    width: 300px;
    background: rgba(14, 14, 16, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.panel-header-left i {
    width: 16px;
    height: 16px;
    color: #888;
    stroke-width: 1.5;
}

.panel-header h3 {
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
}

.pro-badge {
    font-size: 0.6rem;
    font-weight: 600;
    color: #a78bfa;
    padding: 2px 6px;
    background: rgba(167, 139, 250, 0.1);
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.panel-content::-webkit-scrollbar {
    display: none;
}

/* Presets */
.presets-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.preset-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-transform: capitalize;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Control Sections */
.control-section {
    margin-bottom: 20px;
}

.control-section-title {
    font-size: 0.65rem;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.control-row {
    margin-bottom: 14px;
}

.control-row label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 400;
    color: #888;
    margin-bottom: 8px;
}

.control-row label span {
    color: #a78bfa;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.7rem;
}

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

.control-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #a78bfa;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.control-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Color inputs */
.color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.color-preview {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.color-preview:hover {
    transform: scale(1.08);
}

.color-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: #888;
    flex: 1;
}

.color-value {
    font-size: 0.65rem;
    font-family: 'SF Mono', 'Monaco', monospace;
    color: #555;
}

input[type="color"] {
    opacity: 0;
    position: absolute;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

/* Action Buttons */
.panel-actions {
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-btn i {
    width: 14px;
    height: 14px;
    stroke-width: 1.5;
}

.btn-primary {
    background: #a78bfa;
    color: #000;
}

.btn-primary:hover {
    background: #b89dfc;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #888;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

.modal-overlay.visible {
    display: flex;
}

.modal {
    width: 90%;
    max-width: 560px;
    background: #111113;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-header h3 i {
    width: 16px;
    height: 16px;
    color: #a78bfa;
    stroke-width: 1.5;
}

.close-modal {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 6px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.close-modal i {
    width: 14px;
    height: 14px;
    stroke-width: 1.5;
}

.modal-tabs {
    display: flex;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-tab {
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
}

.modal-tab:hover {
    color: #888;
}

.modal-tab.active {
    color: #fff;
    border-bottom-color: #a78bfa;
}

.modal-content {
    padding: 20px 22px;
    max-height: 320px;
    overflow-y: auto;
}

.code-block {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 14px;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.7rem;
    line-height: 1.7;
    color: #888;
    overflow-x: auto;
    white-space: pre-wrap;
}

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.copy-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #a78bfa;
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background: #b89dfc;
}

.copy-btn i {
    width: 14px;
    height: 14px;
    stroke-width: 1.5;
}

.copy-btn.copied {
    background: #22c55e;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Command Palette Button in Header */
.cmd-k-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 200px;
}

.cmd-k-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.cmd-k-btn kbd {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: inherit;
    color: #aaa;
}

/* Command Palette Modal */
.palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: none;
    align-items: flex-start;
    /* Top aligned */
    justify-content: center;
    padding-top: 14vh;
}

.palette-overlay.visible {
    display: flex;
}

.palette-modal {
    width: 600px;
    max-width: 90%;
    background: #161618;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.palette-search {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.palette-search i {
    color: #888;
    width: 18px;
    height: 18px;
}

.palette-input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.palette-results {
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #aaa;
    transition: all 0.1s;
}

.palette-item:hover,
.palette-item.selected {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.palette-item-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.palette-item-desc {
    font-size: 0.75rem;
    color: #666;
}