/* ============================================
   Design Token Generator - Vercel Geist UI Style
   ============================================ */

/* Geist Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* CSS Variables - Geist Design System */
:root {
    /* Geist Gray Scale - Light */
    --gray-1: #fcfcfc;
    --gray-2: #f9f9f9;
    --gray-3: #f0f0f0;
    --gray-4: #e8e8e8;
    --gray-5: #e0e0e0;
    --gray-6: #d9d9d9;
    --gray-7: #cecece;
    --gray-8: #bbbbbb;
    --gray-9: #8d8d8d;
    --gray-10: #838383;
    --gray-11: #646464;
    --gray-12: #202020;
    
    /* Geist Blue Scale */
    --blue-1: #fbfdff;
    --blue-2: #f4faff;
    --blue-3: #e6f4fe;
    --blue-4: #d5efff;
    --blue-5: #c2e5ff;
    --blue-6: #acd8fc;
    --blue-7: #8ec8f6;
    --blue-8: #5eb1ef;
    --blue-9: #0090ff;
    --blue-10: #0588f0;
    --blue-11: #0d74ce;
    --blue-12: #113264;
    
    /* Semantic Colors */
    --background: #ffffff;
    --background-secondary: var(--gray-2);
    --foreground: var(--gray-12);
    --foreground-secondary: var(--gray-11);
    --foreground-muted: var(--gray-9);
    
    --border: var(--gray-4);
    --border-hover: var(--gray-6);
    --border-focus: var(--gray-12);
    
    --accent: #000000;
    --accent-foreground: #ffffff;
    --accent-hover: var(--gray-12);
    
    --success: #50e3c2;
    --success-dark: #0cce6b;
    --warning: #f5a623;
    --error: #ee0000;
    --error-light: #ff6166;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Geist Mono', 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    
    /* Spacing - 4px grid system */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    
    /* Border Radius - Geist uses 6px-8px */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    
    /* Shadows - Vercel style */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.06);
    
    /* Transitions */
    --transition: 200ms ease;
    --transition-fast: 150ms ease;
}

/* Dark Theme - Geist Dark */
[data-theme="dark"] {
    --gray-1: #111111;
    --gray-2: #191919;
    --gray-3: #222222;
    --gray-4: #2a2a2a;
    --gray-5: #313131;
    --gray-6: #3a3a3a;
    --gray-7: #484848;
    --gray-8: #606060;
    --gray-9: #6e6e6e;
    --gray-10: #7b7b7b;
    --gray-11: #b4b4b4;
    --gray-12: #eeeeee;
    
    --background: #000000;
    --background-secondary: var(--gray-2);
    --foreground: var(--gray-12);
    --foreground-secondary: var(--gray-11);
    --foreground-muted: var(--gray-9);
    
    --border: var(--gray-4);
    --border-hover: var(--gray-6);
    --border-focus: var(--gray-12);
    
    --accent: #ffffff;
    --accent-foreground: #000000;
    --accent-hover: var(--gray-11);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    min-height: 100vh;
}

/* ============================================
   Layout
   ============================================ */

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar {
    display: none;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 72px;
}

/* Top Logo Header */
.top-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: var(--space-6) var(--space-6);
    background: var(--background);
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo-wrapper svg {
    height: 24px;
    width: auto;
}

.content-section {
    display: none;
    flex: 1;
    padding: var(--space-8) var(--space-6);
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Section Header - Vercel Style */
.section-header {
    margin-bottom: var(--space-8);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 14px;
    color: var(--foreground-muted);
    margin-bottom: var(--space-4);
}

.breadcrumb svg {
    opacity: 0.5;
}

.section-header h1 {
    font-family: var(--font-sans);
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--foreground);
    margin-bottom: var(--space-2);
}

.section-desc {
    font-size: 14px;
    color: var(--foreground-secondary);
    line-height: 1.6;
}

/* Content Body */
.content-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    align-items: stretch;
}

/* ============================================
   Cards - Vercel Style
   ============================================ */

.token-table,
.semantic-table,
.scale-options,
.config-section,
.generated-scale {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 50px 140px;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--background-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--foreground-muted);
}

.table-section {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.table-section:last-child {
    border-bottom: none;
}

.table-section h3 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 14px;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: var(--space-3);
}

.table-section h3 .toggle-label {
    margin-right: var(--space-1);
}

.optional-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--foreground-muted);
    background: var(--background-secondary);
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 50px 140px;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-2) 0;
}

.token-name {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--foreground-secondary);
}

/* ============================================
   Form Elements - Geist Style
   ============================================ */

.color-picker {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.color-picker:hover {
    border-color: var(--border-hover);
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.hex-input {
    padding: var(--space-2) var(--space-3);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--foreground);
    transition: all var(--transition-fast);
}

.hex-input:hover {
    border-color: var(--border-hover);
}

.hex-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px var(--border-focus);
}

.color-swatch {
    width: 100%;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Toggle Switch - Vercel Style */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    font-weight: 400;
    color: var(--foreground-secondary);
    cursor: pointer;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 32px;
    height: 18px;
    background: var(--gray-6);
    border-radius: 999px;
    position: relative;
    transition: all var(--transition-fast);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--foreground);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 16px;
}

/* ============================================
   Option Cards - Geist Style
   ============================================ */

.scale-options,
.config-section {
    padding: var(--space-6);
}

.scale-options h3,
.config-section h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.scale-options p,
.config-section p {
    font-size: 13px;
    color: var(--foreground-muted);
    margin-bottom: var(--space-4);
}

.option-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
}

.option-card {
    display: block;
    padding: var(--space-4);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.option-card:hover {
    border-color: var(--border-hover);
}

.option-card:has(input:checked),
.option-card.active {
    border-color: var(--foreground);
    background: var(--background);
}

.option-card input {
    display: none;
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-content strong {
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
}

.option-content span {
    font-size: 12px;
    color: var(--foreground-muted);
}

.option-icon {
    font-size: 20px;
    margin-bottom: var(--space-2);
}

/* Neutral Presets */
.neutral-color-picker {
    margin-bottom: var(--space-4);
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3);
    background: var(--background-secondary);
    border-radius: var(--radius);
}

.color-input-row label {
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground-secondary);
    min-width: 100px;
}

.color-input-row .color-swatch {
    width: 60px;
    height: 40px;
}

.preset-buttons {
    display: flex;
    gap: var(--space-2);
}

.preset-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--foreground-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-btn:hover {
    border-color: var(--border-hover);
}

.preset-btn.active {
    border-color: var(--foreground);
    color: var(--foreground);
}

.preset-swatch {
    width: 48px;
    height: 16px;
    border-radius: 4px;
}

/* ============================================
   Generated Scale - Vercel Style
   ============================================ */

.generated-scale {
    padding: var(--space-6);
}

.generated-scale h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground-muted);
    margin-bottom: var(--space-4);
}

.scale-preview-container {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
}

.scale-preview-container:last-child {
    margin-bottom: 0;
}

.scale-preview-container.full {
    flex-direction: column;
    align-items: stretch;
}

.scale-label {
    width: 72px;
    font-size: 12px;
    font-weight: 500;
    color: var(--foreground-muted);
}

.scale-swatches {
    display: flex;
    flex: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.scale-swatches.large {
    height: 56px;
}

.scale-swatch {
    flex: 1;
    height: 36px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    transition: transform var(--transition-fast);
    cursor: pointer;
}

.scale-swatches.large .scale-swatch {
    height: 56px;
}

.scale-swatch:hover {
    transform: scaleY(1.05);
    z-index: 1;
}

.scale-swatch span {
    font-size: 9px;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    color: white;
}

/* ============================================
   Semantic Colors
   ============================================ */

.semantic-table .table-header {
    grid-template-columns: 100px 50px 100px 1fr;
}

.semantic-row {
    grid-template-columns: 100px 50px 100px 1fr;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
}

.semantic-row:last-child {
    border-bottom: none;
}

.state-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    font-weight: 500;
}

.state-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.state-icon svg {
    width: 14px;
    height: 14px;
}

.state-label.success .state-icon { background: #dcfce7; color: #16a34a; }
.state-label.warning .state-icon { background: #fef3c7; color: #d97706; }
.state-label.error .state-icon { background: #fee2e2; color: #dc2626; }
.state-label.info .state-icon { background: #dbeafe; color: #2563eb; }

.mini-scale {
    display: flex;
    height: 28px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.mini-swatch {
    flex: 1;
    height: 100%;
}

/* ============================================
   Preview Panel
   ============================================ */

.preview-tabs {
    display: flex;
    gap: 0;
    padding: 4px;
    background: var(--background-secondary);
    border-radius: var(--radius);
    margin-bottom: 0;
    width: 100%;
}

.preview-tabs .tab-btn {
    flex: 1;
    text-align: center;
}

.tab-btn {
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--foreground);
}

.tab-btn.active {
    background: var(--background);
    color: var(--foreground);
    box-shadow: var(--shadow-sm);
}

.preview-panel {
    display: none;
    width: 100%;
}

.preview-panel.active {
    display: block;
    width: 100%;
}

.token-category {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    overflow: hidden;
    width: 100%;
}

.token-category h3 {
    padding: var(--space-3) var(--space-4);
    background: var(--background-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--foreground-secondary);
    border-bottom: 1px solid var(--border);
}

.token-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-4);
}

.token-chip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--background-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.token-chip-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.token-chip-name {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--foreground-secondary);
}

.token-chip-value {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--foreground-muted);
}

/* Semantic Tables */
.semantic-tables {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.semantic-table-section {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.semantic-table-section h3 {
    padding: var(--space-3) var(--space-4);
    font-size: 13px;
    font-weight: 500;
    background: var(--background-secondary);
    border-bottom: 1px solid var(--border);
}

.semantic-token-table {
    display: flex;
    flex-direction: column;
}

.semantic-token-row {
    display: grid;
    grid-template-columns: 32px 1fr 140px;
    gap: var(--space-3);
    padding: var(--space-3) 16px var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    align-items: center;
    font-size: 13px;
}

.semantic-token-row:last-child {
    border-bottom: none;
}

.semantic-token-name-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    position: relative;
}

.semantic-token-name-wrapper.has-tooltip {
    cursor: help;
}

.semantic-token-name {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Token Tooltip - appears on hover over name */
.tooltip-text {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    padding: var(--space-2) var(--space-3);
    background: var(--gray-12);
    color: var(--gray-1);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1000;
    width: 220px;
    text-align: left;
    pointer-events: none;
}

.tooltip-text::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--gray-12);
}

.semantic-token-name-wrapper:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

.semantic-token-value {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.semantic-token-color {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.semantic-token-ref {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--foreground-muted);
    white-space: nowrap;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
}

.semantic-token-hex {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--foreground-muted);
    text-align: right;
}

/* ============================================
   Core Panel - Uber Style (New)
   ============================================ */

.core-tokens-info {
    margin-bottom: var(--space-6);
}

.core-desc {
    color: var(--foreground-secondary);
    font-size: 14px;
    line-height: 1.6;
    padding: var(--space-4);
    background: var(--background-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.core-token-grid {
    display: flex;
    flex-direction: column;
}

.core-token-group {
    margin-bottom: var(--space-4);
}

.core-token-group-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--foreground-muted);
    padding: var(--space-2) var(--space-4);
    background: var(--gray-3);
}

.core-token-row {
    display: grid;
    grid-template-columns: 40px 1fr 100px;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.core-token-row:last-child {
    border-bottom: none;
}

.core-token-swatch {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.core-token-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.core-token-name {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
}

.core-token-desc {
    font-size: 12px;
    color: var(--foreground-muted);
}

.core-token-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--foreground-muted);
    text-align: right;
}

/* State label colors - Uber naming */
.state-label.positive {
    color: #22C55E;
}

.state-label.positive .state-icon {
    background: #DCFCE7;
    color: #16A34A;
}

.state-label.negative {
    color: #EF4444;
}

.state-label.negative .state-icon {
    background: #FEE2E2;
    color: #DC2626;
}

/* ============================================
   Export Section - Vercel Style
   ============================================ */

.export-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.export-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-6);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.export-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.export-icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.export-icon.figma { background: #1E1E1E; }
.export-icon.css { background: #264DE4; color: white; font-weight: 700; font-size: 12px; }
.export-icon.tokens { background: #5436DA; }
.export-icon.tailwind { background: #0F172A; }

.export-card h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.export-card p {
    font-size: 13px;
    color: var(--foreground-muted);
    margin-bottom: var(--space-4);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    background: var(--foreground);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--background);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-download:hover {
    opacity: 0.9;
}

/* Code Preview - Vercel Style */
.code-preview-section {
    background: var(--gray-1);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--background-secondary);
    border-bottom: 1px solid var(--border);
}

.code-header h3 {
    font-size: 13px;
    font-weight: 500;
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--foreground-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    border-color: var(--foreground);
    color: var(--foreground);
}

.code-block {
    padding: var(--space-4);
    margin: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--foreground-secondary);
    background: var(--background);
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
}

/* ============================================
   Footer Navigation - Vercel Style
   ============================================ */

.content-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    background: var(--background);
    border-top: 1px solid var(--border);
    z-index: 100;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    height: 36px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-nav:hover:not(:disabled) {
    border-color: var(--foreground);
}

.btn-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-next {
    background: var(--foreground);
    border-color: var(--foreground);
    color: var(--background);
}

.btn-next:hover:not(:disabled) {
    opacity: 0.9;
}

.step-indicator {
    font-size: 13px;
    color: var(--foreground-muted);
    font-family: var(--font-mono);
}

.step-indicator #current-step {
    color: var(--foreground);
}

/* ============================================
   Toast - Vercel Style
   ============================================ */

.toast {
    position: fixed;
    bottom: 88px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: var(--space-3) var(--space-6);
    background: var(--foreground);
    color: var(--background);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
    .content-section {
        padding: var(--space-6) var(--space-4);
    }
    
    .section-header h1 {
        font-size: 24px;
    }
    
    .option-cards {
        grid-template-columns: 1fr;
    }
    
    .table-header,
    .table-row,
    .semantic-row {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    
    .export-grid {
        grid-template-columns: 1fr;
    }
    
    .content-footer {
        padding: var(--space-3) var(--space-4);
    }
}

/* ============================================
   Spacing Tokens
   ============================================ */

.spacing-preview {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--background-secondary);
    border-radius: var(--radius);
    overflow-x: auto;
}

.spacing-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.spacing-bar-visual {
    background: var(--foreground);
    border-radius: 4px;
    min-width: 24px;
}

.spacing-bar-label {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--foreground-muted);
}

.spacing-row {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
}

.spacing-row:last-child {
    border-bottom: none;
}

.spacing-visual {
    height: 8px;
    background: var(--foreground);
    border-radius: 4px;
}

/* ============================================
   Typography Tokens
   ============================================ */

.inline-input {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.number-input {
    width: 80px;
    padding: var(--space-2) var(--space-3);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--foreground);
    text-align: center;
}

.number-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.input-suffix {
    font-size: 13px;
    color: var(--foreground-muted);
}

.typography-row {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
}

.typography-row:last-child {
    border-bottom: none;
}

.typography-preview {
    font-family: var(--font-sans);
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-weight-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
}

.font-weight-item {
    padding: var(--space-3);
    background: var(--background-secondary);
    border-radius: var(--radius);
    text-align: center;
}

.font-weight-sample {
    font-size: 24px;
    margin-bottom: var(--space-2);
}

.font-weight-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--foreground);
}

.font-weight-value {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--foreground-muted);
}

/* ============================================
   Accessibility Checker
   ============================================ */

.a11y-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.a11y-stat {
    padding: var(--space-4);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.a11y-stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--foreground);
}

.a11y-stat-label {
    font-size: 12px;
    color: var(--foreground-muted);
    margin-top: var(--space-1);
}

.a11y-stat.pass .a11y-stat-value { color: #22c55e; }
.a11y-stat.warning .a11y-stat-value { color: #f59e0b; }
.a11y-stat.fail .a11y-stat-value { color: #ef4444; }

.a11y-section {
    margin-bottom: var(--space-6);
}

.a11y-section h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.a11y-section p {
    font-size: 13px;
    color: var(--foreground-muted);
    margin-bottom: var(--space-4);
}

.a11y-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-3);
}

.a11y-card {
    padding: var(--space-4);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.a11y-card-preview {
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-3);
}

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

.a11y-card-colors {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.a11y-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

.a11y-ratio {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--foreground-secondary);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pass {
    background: #dcfce7;
    color: #16a34a;
}

.badge-aa {
    background: #d1fae5;
    color: #059669;
}

.badge-aa-large {
    background: #fef3c7;
    color: #d97706;
}

.badge-fail {
    background: #fee2e2;
    color: #dc2626;
}

.a11y-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--background-secondary);
    border-radius: var(--radius);
    margin-top: var(--space-6);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 12px;
    color: var(--foreground-secondary);
}

/* ============================================
   Utilities
   ============================================ */

.hidden {
    display: none !important;
}
