:root {
  --font-size: 16px;
  --background: #ffffff;
  --foreground: #030213; /* oklch(0.145 0 0) approx */
  --card: #ffffff;
  --card-foreground: #030213;
  --popover: #ffffff;
  --popover-foreground: #030213;
  --primary: #030213;
  --primary-foreground: #ffffff;
  --secondary: #f2f2f4; /* oklch(0.95 0.0058 264.53) approx */
  --secondary-foreground: #030213;
  --muted: #ececf0;
  --muted-foreground: #717182;
  --accent: #e9ebef;
  --accent-foreground: #030213;
  --destructive: #d4183d;
  --destructive-foreground: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --input: transparent;
  --input-background: #f3f3f5;
  --switch-background: #cbced4;
  --font-weight-medium: 500;
  --font-weight-normal: 400;
  --ring: #b4b4b4; /* oklch(0.708 0 0) approx */
  --radius: 0.625rem;
}

.dark {
  --background: #030213;
  --foreground: #ffffff;
  --card: #030213;
  --card-foreground: #ffffff;
  --popover: #030213;
  --popover-foreground: #ffffff;
  --primary: #ffffff;
  --primary-foreground: #030213;
  --secondary: #2b2b2b;
  --secondary-foreground: #ffffff;
  --muted: #2b2b2b;
  --muted-foreground: #b4b4b4;
  --accent: #2b2b2b;
  --accent-foreground: #ffffff;
  --destructive: #991b1b;
  --destructive-foreground: #ffffff;
  --border: #2b2b2b;
  --input: #2b2b2b;
  --ring: #6b6b6b;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: 'Inter', sans-serif;
}

/* Widget Builder Demo Styles */
.code-editor-container {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.code-editor-panel {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    background: #0f172a;
    min-height: 400px;
}

.preview-panel {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    min-height: 500px;
}

.code-editor-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
}

.code-editor-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
}

.code-editor {
    flex: 1;
    overflow: auto;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-editor pre {
    margin: 0;
    padding: 1.5rem;
}

.code-editor code {
    display: block;
}

.code-comment { color: #64748b; font-style: italic; }
.code-tag { color: #38bdf8; }
.code-attr { color: #a78bfa; }
.code-string { color: #34d399; }

.code-editable {
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 4px;
    border-radius: 3px;
    display: inline-block;
    color: #fbbf24;
    cursor: text;
    outline: none;
    min-width: 10px;
}

.code-editable:hover {
    background: rgba(251, 191, 36, 0.25);
}

.code-editable:focus {
    background: rgba(251, 191, 36, 0.35);
    border-bottom: 1px solid #fbbf24;
}

.preview-panel {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    min-height: 500px;
}

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

.preview-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
}

.preview-container {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
}

#preview-widget {
    width: 100%;
    max-width: 100%;
}

