:root {
    /* Ocean Depths Palette */
    --bg-base: #0A1628;
    --bg-surface: rgba(16, 36, 62, 0.6);
    --bg-surface-solid: #10243E;
    --bg-hover: rgba(59, 130, 246, 0.1);

    --border-light: rgba(116, 185, 255, 0.15);
    --border-focus: #0984E3;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --primary: #0984E3;
    --primary-hover: #076aba;
    --secondary: #74B9FF;
    --accent: #00CEC9;

    --error: #ef4444;
    --success: #10b981;

    --font-ui: 'Inter', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-base);
    background-image: radial-gradient(circle at 15% 50%, rgba(9, 132, 227, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 206, 201, 0.05), transparent 25%);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
}

/* Typography Utilities */
.text-sm {
    font-size: 0.85rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--accent);
}

.code-font {
    font-family: var(--font-code);
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header */
.app-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-light);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.logo strong {
    font-weight: 700;
    color: var(--secondary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(9, 132, 227, 0.4);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--secondary);
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--secondary);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.2s;
}

.btn-close:hover {
    color: #FFF;
}

/* Workspace Layout */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Panes */
.pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    position: relative;
}

.pane-builder {
    border-right: 1px solid var(--border-light);
    flex: 1.2;
    background: rgba(10, 22, 40, 0.4);
}

.pane-preview {
    flex: 1;
    background: #070e1a;
}

/* Darker for code */

.pane-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.pane-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.pane-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.scrollable::-webkit-scrollbar {
    width: 6px;
}

.scrollable::-webkit-scrollbar-thumb {
    background: rgba(116, 185, 255, 0.2);
    border-radius: 3px;
}

/* Forms */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group>label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input {
    width: 100%;
    background: var(--bg-surface-solid);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.15);
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2374B9FF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Nested Forms */
.nested-field {
    border-left: 2px solid var(--border-light);
    padding-left: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.nested-field::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), transparent);
    opacity: 0.5;
}

.nested-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 1200px) {
    .field-grid {
        grid-template-columns: 1fr 1fr;
    }

    .col-full {
        grid-column: 1 / -1;
    }
}

.array-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-light);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    position: relative;
}

.btn-remove-item {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--error);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0.7;
    transition: 0.2s;
}

.btn-remove-item:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
}

/* Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60%;
    text-align: center;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto;
}

.empty-state p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Output Code */
.output-container {
    padding: 0;
    margin: 0;
    height: 100%;
}

.output-container pre {
    margin: 0;
    height: 100%;
    padding: 2rem;
    overflow: auto;
    font-family: var(--font-code);
    font-size: 0.9rem;
    line-height: 1.6;
    color: #a5d6ff;
}

.output-container pre::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.output-container pre::-webkit-scrollbar-thumb {
    background: rgba(116, 185, 255, 0.15);
    border-radius: 3px;
}

/* Basic Syntax Highlighting Colors */
.syntax-string {
    color: #7ee787;
}

.syntax-number {
    color: #79c0ff;
}

.syntax-boolean {
    color: #ff7b72;
}

.syntax-null {
    color: #ff7b72;
}

.syntax-key {
    color: #74B9FF;
    font-weight: 500;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

@media (max-width: 900px) {
    .workspace {
        flex-direction: column;
        overflow-y: auto;
    }

    .pane {
        flex: none;
        height: auto;
        min-height: 60vh;
    }

    .pane-builder {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
}