/* GPUI Web - Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Color Palette - Zinc (Tailwind/Shadcn inspired) */
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;

    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;

    --popover: 240 10% 3.9%;
    --popover-foreground: 0 0% 98%;

    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;

    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;

    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;

    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;

    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 15.9%;
    --ring: 240 4.9% 83.9%;

    --radius: 0.5rem;

    /* Spacing */
    --sidebar-width: 250px;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    /* App-like feel */
}

/* Utilities */
.flex {
    display: flex;
}

.col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.p-4 {
    padding: 1rem;
}

.h-full {
    height: 100%;
}

.w-full {
    width: 100%;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -0.025em;
}

.text-sm {
    font-size: 0.875rem;
}

.text-muted {
    color: hsl(var(--muted-foreground));
}

/* Layout Grid */
#app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    width: 100vw;
    height: 100vh;
    grid-template-areas:
        "sidebar header"
        "sidebar main";
}

/* Sidebar */
#sidebar {
    grid-area: sidebar;
    background-color: hsl(var(--card));
    border-right: 1px solid hsl(var(--border));
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

#sidebar .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: hsl(var(--foreground));
}

#sidebar nav a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

#sidebar nav a:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

#sidebar nav a.active {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    font-weight: 500;
}

/* Header */
#header {
    grid-area: header;
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background-color: hsl(var(--background) / 0.8);
    backdrop-filter: blur(8px);
    z-index: 10;
}

/* Main Content */
#main {
    grid-area: main;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

/* Component Showcase Container */
.component-section {
    margin-bottom: 3rem;
}

.component-preview {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    min-height: 200px;
    background-image: radial-gradient(hsl(var(--muted) / 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Components: Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
    font-size: 0.875rem;
    line-height: 1.25rem;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Button Variants */
.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.8);
}

.btn-outline {
    border-color: hsl(var(--border));
    background-color: transparent;
    color: hsl(var(--foreground));
}

.btn-outline:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}

.btn-ghost:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn-destructive {
    background-color: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover {
    opacity: 0.9;
}

/* Button Sizes */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
}

/* Components: Input */
.input {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--input));
    background-color: transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    transition: all 0.2s;
}

.input::placeholder {
    color: hsl(var(--muted-foreground));
}

.input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
    border-color: hsl(var(--ring));
}

.input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


/* Components: Card */
.card {
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
}

.card-description {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.card-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    background-color: hsl(var(--muted)/0.3);
    border-top: 1px solid hsl(var(--border));
    display: flex;
    align-items: center;
}

/* Components: Code Editor (Mockup) */
.editor-window {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border));
    background-color: #1e1e1e;
    /* Editor BG */
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.editor-header {
    background-color: #252526;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #333;
}

.editor-tabs {
    display: flex;
    gap: 1px;
}

.editor-tab {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: #9ca3af;
    background-color: #2d2d2d;
    border-right: 1px solid #1e1e1e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.editor-tab.active {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-top: 2px solid #3b82f6;
}

.editor-body {
    display: flex;
    padding: 1rem 0;
}

.line-numbers {
    display: flex;
    flex-direction: column;
    padding: 0 1rem;
    color: #5c6370;
    text-align: right;
    font-size: 0.875rem;
    line-height: 1.5;
    user-select: none;
    border-right: 1px solid #333;
    margin-right: 1rem;
}

.code-area {
    width: 100%;
    color: #d4d4d4;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
}

/* Syntax Highlighting (Mock) */
.token-kwd {
    color: #c678dd;
}

/* Keyword: purple */
.token-fn {
    color: #61afef;
}

/* Function: blue */
.token-str {
    color: #98c379;
}

/* String: green */
.token-cls {
    color: #e5c07b;
}

/* Class: yellow */
.token-cmt {
    color: #7f848e;
    font-style: italic;
}

/* Comment: gray */
.token-num {
    color: #d19a66;
}

/* Number: orange */