/**
 * SpecBuilder SDK v2.0 - Stylesheet
 * Dark Mode Only | High Contrast | Professional UI
 */

/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES - Design Tokens
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* Colors - Core */
    --bg-primary: #09090b;
    --bg-secondary: #0f0f11;
    --bg-tertiary: #151518;
    --bg-card: #18181b;
    --bg-card-hover: #1f1f23;
    --bg-input: #0c0c0e;
    --bg-elevated: #1c1c20;
    
    /* Borders */
    --border-color: #27272a;
    --border-subtle: #1f1f23;
    --border-hover: #3f3f46;
    --border-active: #3b82f6;
    
    /* Text */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;
    
    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-blue-soft: rgba(59, 130, 246, 0.12);
    --accent-green: #22c55e;
    --accent-green-soft: rgba(34, 197, 94, 0.12);
    --accent-yellow: #eab308;
    --accent-red: #ef4444;
    --accent-purple: #a855f7;
    --accent-purple-soft: rgba(168, 85, 247, 0.12);
    --accent-cyan: #06b6d4;
    --accent-orange: #f97316;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-warm: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    --gradient-hero: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 50%, rgba(6, 182, 212, 0.05) 100%);
    
    /* Syntax Highlighting */
    --syntax-keyword: #c084fc;
    --syntax-string: #4ade80;
    --syntax-number: #fb923c;
    --syntax-comment: #6b7280;
    --syntax-function: #60a5fa;
    --syntax-variable: #f472b6;
    --syntax-property: #22d3ee;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Sizing */
    --sidebar-width: 280px;
    --drawer-width: 600px;
    --card-min-width: 180px;
    --header-height: 64px;
    
    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 24px var(--accent-blue-glow);
    --shadow-glow-lg: 0 0 48px var(--accent-blue-glow);
    
    /* Transitions */
    --transition-fast: 100ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Typography */
    --font-sans: 'Inter', 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 28px;
    --font-size-3xl: 36px;
    --font-size-4xl: 48px;
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   APP CONTAINER - Main Layout
   ═══════════════════════════════════════════════════════════════ */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR - Left Fixed Navigation
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.brand-logo {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glow);
}

.logo-symbol {
    font-size: 24px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-text {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.brand-tag {
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
}

/* Sidebar Search */
.sidebar-search {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

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

.sidebar-search {
    position: relative;
}

.search-icon {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-subtle);
}

/* Navigation Steps */
.nav-steps {
    flex: 1;
    padding: var(--space-sm);
    overflow-y: auto;
}

/* Navigation Group Labels */
.nav-group-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
    margin-top: var(--space-sm);
    margin-bottom: 2px;
    border-top: 1px solid var(--border-subtle);
}

.nav-group-label:first-child {
    margin-top: 0;
    border-top: none;
}

.nav-step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: 2px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.nav-step:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-subtle);
}

.nav-step.active {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
}

.nav-step.completed {
    opacity: 0.85;
}

.nav-step.completed .nav-step-icon {
    background: var(--accent-green-soft);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.nav-step-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.nav-step.active .nav-step-icon {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-step-content {
    flex: 1;
    min-width: 0;
}

.nav-step-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.nav-step.active .nav-step-name {
    color: var(--accent-blue);
}

.nav-step-desc {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-step-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background: var(--accent-green);
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-bounce);
}

.nav-step.completed .nav-step-check {
    opacity: 1;
    transform: scale(1);
}

/* Progress Bar */
.sidebar-progress {
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

.progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-text {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    text-align: center;
    display: block;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-reset:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-generate {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-glow);
    overflow: hidden;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-lg);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

.btn-icon {
    font-size: 16px;
    position: relative;
    z-index: 1;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: 150;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CANVAS - Scrollable Content Area
   ═══════════════════════════════════════════════════════════════ */
.main-canvas {
    margin-left: var(--sidebar-width);
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-xl);
    padding-bottom: 140px;
    background: var(--bg-primary);
}

/* Welcome Hero */
.welcome-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3xl);
    margin-bottom: var(--space-2xl);
    background: var(--gradient-hero);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.welcome-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-blue-soft) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-purple-soft);
    border: 1px solid var(--accent-purple);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--accent-purple);
    margin-bottom: var(--space-md);
}

.hero-title {
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: -1px;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
}

.hero-stats .stat-item {
    display: flex;
    flex-direction: column;
}

.hero-stats .stat-value {
    font-family: var(--font-display);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.hero-stats .stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.hero-visual {
    position: relative;
    width: 300px;
    height: 200px;
}

.floating-cards {
    position: relative;
    width: 100%;
    height: 100%;
}

.float-card {
    position: absolute;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
}

.fc-1 { top: 0; left: 20px; animation-delay: 0s; }
.fc-2 { top: 40px; right: 0; animation-delay: 0.5s; }
.fc-3 { bottom: 40px; left: 0; animation-delay: 1s; }
.fc-4 { bottom: 0; right: 20px; animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Sections */
.config-section {
    margin-bottom: var(--space-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.section-badge {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    font-weight: 700;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    color: white;
    flex-shrink: 0;
}

.section-title-group {
    flex: 1;
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.3px;
}

.section-desc {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.section-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-collapse {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-collapse:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
}

.section-content {
    padding: var(--space-lg);
}

.section-content.collapsed {
    display: none;
}

/* Subsections */
.subsection {
    margin-bottom: var(--space-xl);
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.subsection-icon {
    font-size: 14px;
}

.subsection-hint {
    margin-left: auto;
    font-size: var(--font-size-xs);
    font-weight: 400;
    text-transform: none;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   CARD GRID - Selection Cards
   ═══════════════════════════════════════════════════════════════ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
    gap: var(--space-md);
}

.card-grid-compact {
    --card-min-width: 150px;
    gap: var(--space-sm);
}

/* Selection Card */
.selection-card {
    position: relative;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    overflow: hidden;
}

.selection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background var(--transition-fast);
}

.selection-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.selection-card.selected {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow), var(--shadow-md);
}

.selection-card.selected::before {
    background: var(--gradient-primary);
}

.card-check {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-blue);
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-bounce);
}

.selection-card.selected .card-check {
    opacity: 1;
    transform: scale(1);
}

.card-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.selection-card:hover .card-icon,
.selection-card.selected .card-icon {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.card-name {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.card-type {
    display: inline-block;
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xs);
    color: var(--accent-cyan);
    margin-bottom: var(--space-sm);
}

.card-desc {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* Compact Card Variant */
.card-grid-compact .selection-card {
    padding: var(--space-md);
}

.card-grid-compact .card-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    margin-bottom: var(--space-sm);
}

.card-grid-compact .card-name {
    font-size: var(--font-size-sm);
}

/* ═══════════════════════════════════════════════════════════════
   CHIP GRID - Multi-select Chips
   ═══════════════════════════════════════════════════════════════ */
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.chip.selected {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.chip-check {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.chip.selected .chip-check {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   LIBRARY FILTERS & CHIPS (JS/CSS Libraries)
   ═══════════════════════════════════════════════════════════════ */
.subsection-desc {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
    margin-top: calc(var(--space-sm) * -1);
}

.library-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.filter-btn {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-card);
}

.filter-btn.active {
    background: var(--accent-blue);
    color: var(--bg-primary);
    border-color: var(--accent-blue);
    font-weight: 500;
}

.chip-grid-libs {
    gap: var(--space-xs);
}

.chip-grid-libs .chip {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
}

.chip-grid-libs .chip .chip-type {
    display: inline-block;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xs);
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-left: var(--space-xs);
}

.chip-grid-libs .chip.selected .chip-type {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
}

.chip-grid-libs .chip.popular::before {
    content: '★';
    color: var(--accent-gold);
    margin-right: 4px;
    font-size: 10px;
}

.chip-grid-libs .chip[data-hidden="true"] {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════
   FEATURE CATEGORIES
   ═══════════════════════════════════════════════════════════════ */
.feature-category {
    margin-bottom: var(--space-lg);
}

.feature-category-header {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-blue);
}

.feature-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.feature-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.feature-chip:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.feature-chip.selected {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.feature-chip-check {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.feature-chip.selected .feature-chip-check {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   COLOR PALETTE SECTION
   ═══════════════════════════════════════════════════════════════ */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.palette-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    overflow: hidden;
}

.palette-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.palette-card.selected {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow);
}

.palette-card.selected::after {
    content: '✓';
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-blue);
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.palette-colors {
    display: flex;
    height: 60px;
}

.palette-color {
    flex: 1;
    transition: transform var(--transition-fast);
}

.palette-card:hover .palette-color {
    transform: scaleY(1.1);
}

.palette-info {
    padding: var(--space-md);
}

.palette-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.palette-type {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

/* Random Palette Generator */
.random-palette-box {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.btn-random-palette {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-accent);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-random-palette:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.generated-palette {
    display: flex;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.generated-palette .palette-color {
    flex: 1;
    transition: all var(--transition-base);
    cursor: pointer;
}

.generated-palette .palette-color:hover {
    flex: 1.5;
}

.btn-use-palette {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-md);
    color: var(--accent-green);
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-use-palette:hover {
    background: var(--accent-green-soft);
}

/* Custom Palette Builder */
.custom-palette-builder {
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.color-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.color-input-group {
    flex: 1;
    min-width: 140px;
}

.color-input-group label {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-picker-wrapper {
    display: flex;
    gap: var(--space-xs);
}

.color-picker {
    width: 44px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

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

.color-picker::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-xs);
}

.color-hex {
    flex: 1;
    padding: var(--space-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.color-hex:focus {
    border-color: var(--accent-blue);
}

.custom-palette-preview {
    display: flex;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.preview-swatch {
    flex: 1;
    transition: all var(--transition-base);
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS CHECKLIST
   ═══════════════════════════════════════════════════════════════ */
.sections-checklist {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.section-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.section-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.section-item.selected {
    border-color: var(--accent-blue);
    background: var(--accent-blue-soft);
}

.section-item.required {
    border-left: 3px solid var(--accent-orange);
}

.section-checkbox {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xs);
    color: white;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.section-item.selected .section-checkbox {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.section-info {
    flex: 1;
}

.section-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.section-item-desc {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.section-required-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--accent-orange);
    border-radius: var(--radius-xs);
    color: white;
    font-weight: 600;
}

.section-drag-handle {
    color: var(--text-muted);
    cursor: grab;
}

/* ═══════════════════════════════════════════════════════════════
   PREVIEW BOX - Live Vibe Check
   ═══════════════════════════════════════════════════════════════ */
.preview-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.preview-controls {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.slider-group {
    flex: 1;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.slider-value {
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--accent-blue);
    padding: 2px 8px;
    background: var(--accent-blue-soft);
    border-radius: var(--radius-sm);
}

.slider {
    width: 100%;
    height: 6px;
    appearance: none;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-glow);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-blue);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.preview-demo {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.preview-button {
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-blue);
    color: white;
    font-weight: 600;
    font-size: var(--font-size-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.preview-card {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 200px;
    transition: all var(--transition-base);
}

.preview-card-header {
    font-weight: 600;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.preview-card-body {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.preview-input {
    flex: 1;
    min-width: 200px;
}

.preview-input input {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    outline: none;
    transition: all var(--transition-fast);
}

.preview-input input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

/* ═══════════════════════════════════════════════════════════════
   SELECTION SUMMARY - Floating Bar
   ═══════════════════════════════════════════════════════════════ */
.selection-summary {
    position: fixed;
    bottom: var(--space-lg);
    left: calc(var(--sidebar-width) + var(--space-lg));
    right: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-xl);
    z-index: 50;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-base);
    pointer-events: none;
}

.selection-summary.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.summary-content {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.summary-left {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.summary-count {
    font-family: var(--font-display);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--accent-blue);
}

.summary-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.summary-tags {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    overflow: hidden;
    max-height: 28px;
}

.summary-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--accent-blue-soft);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
    color: var(--accent-blue);
    white-space: nowrap;
}

.summary-tag-remove {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.summary-tag-remove:hover {
    opacity: 1;
}

.summary-right {
    flex-shrink: 0;
}

.btn-quick-generate {
    padding: var(--space-sm) var(--space-lg);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-quick-generate:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* ═══════════════════════════════════════════════════════════════
   PROMPT DRAWER - Slide-over Panel
   ═══════════════════════════════════════════════════════════════ */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.prompt-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--drawer-width);
    max-width: 95vw;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.prompt-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.drawer-title-group {
    flex: 1;
}

.drawer-title {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.drawer-subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.drawer-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-copy {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    background: #2563eb;
}

.btn-copy.copied {
    background: var(--accent-green);
}

.btn-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-close:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Drawer Tabs */
.drawer-tabs {
    display: flex;
    padding: var(--space-sm);
    gap: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.drawer-tab {
    flex: 1;
    padding: var(--space-sm);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.drawer-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.drawer-tab.active {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.prompt-editor {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.prompt-code {
    margin: 0;
    padding: var(--space-lg);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.prompt-code code {
    display: block;
}

/* Syntax Highlighting */
.syntax-section {
    color: var(--syntax-keyword);
    font-weight: 700;
    font-size: var(--font-size-md);
}

.syntax-key {
    color: var(--syntax-property);
}

.syntax-value {
    color: var(--syntax-string);
}

.syntax-comment {
    color: var(--syntax-comment);
    font-style: italic;
}

.syntax-highlight {
    color: var(--syntax-function);
}

.drawer-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.prompt-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
}

.prompt-stats .stat-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
}

.prompt-stats .stat-icon {
    font-size: 14px;
}

.prompt-stats .stat-label {
    color: var(--text-tertiary);
}

.prompt-stats .stat-value {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   TEXT INPUTS & TEXTAREAS
   ═══════════════════════════════════════════════════════════════ */
.text-input-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.input-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

.text-area-large {
    width: 100%;
    min-height: 280px;
    padding: var(--space-lg);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: all var(--transition-fast);
}

.text-area-large:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.text-area-large::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.input-hint {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

/* Vibe Statement */
.text-area-vibe {
    width: 100%;
    padding: var(--space-lg);
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: 500;
    font-style: italic;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: all var(--transition-fast);
}

.text-area-vibe:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-purple-soft);
}

.text-area-vibe::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.vibe-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.vibe-example-label {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    font-weight: 500;
}

.vibe-example-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.vibe-example-btn:hover {
    background: var(--accent-purple-soft);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* ═══════════════════════════════════════════════════════════════
   FONT SELECTOR
   ═══════════════════════════════════════════════════════════════ */
.font-selector-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.font-selector-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.font-selector-row:last-of-type {
    margin-bottom: 0;
}

.font-selector-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.font-label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.font-select-wrapper {
    position: relative;
}

.font-select {
    width: 100%;
    padding: var(--space-md);
    padding-right: var(--space-xl);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--font-size-md);
    cursor: pointer;
    outline: none;
    appearance: none;
    transition: all var(--transition-fast);
}

.font-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.font-select-wrapper::after {
    content: '▾';
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.font-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-sm);
}

.font-select optgroup {
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

.font-preview {
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-height: 60px;
    display: flex;
    align-items: center;
    color: var(--text-primary);
    transition: font-family var(--transition-base);
}

.font-preview-mono {
    font-family: var(--font-mono);
    background: var(--bg-primary);
}

.font-pairing-suggestions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-lg);
}

.pairing-label {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    font-weight: 500;
}

.pairing-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pairing-btn:hover {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

@media (max-width: 900px) {
    .font-selector-row {
        grid-template-columns: 1fr;
    }
}

.btn-random-fonts {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: var(--gradient-accent);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-sans);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: auto;
}

.btn-random-fonts:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* ═══════════════════════════════════════════════════════════════
   TOGGLE SWITCH
   ═══════════════════════════════════════════════════════════════ */
.toggle-container {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: var(--text-tertiary);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(26px);
    background: var(--accent-blue);
    box-shadow: var(--shadow-glow);
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-label {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════
   PAGES CHECKLIST
   ═══════════════════════════════════════════════════════════════ */
.inner-pages-container,
.popups-container {
    margin-top: var(--space-lg);
    animation: fadeInUp 0.3s ease;
}

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

.page-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.page-item.selected {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
}

.page-checkbox {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xs);
    font-size: 11px;
    color: white;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.page-item.selected .page-checkbox {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.page-name {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    flex: 1;
}

.page-item.selected .page-name {
    color: var(--accent-blue);
}

/* Routing Info Box */
.routing-info {
    margin-top: var(--space-lg);
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--accent-blue-soft);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-md);
}

.info-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.info-content strong {
    color: var(--accent-blue);
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.config-section {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.config-section:nth-child(1) { animation-delay: 0.05s; }
.config-section:nth-child(2) { animation-delay: 0.1s; }
.config-section:nth-child(3) { animation-delay: 0.15s; }
.config-section:nth-child(4) { animation-delay: 0.2s; }
.config-section:nth-child(5) { animation-delay: 0.25s; }
.config-section:nth-child(6) { animation-delay: 0.3s; }
.config-section:nth-child(7) { animation-delay: 0.35s; }
.config-section:nth-child(8) { animation-delay: 0.4s; }
.config-section:nth-child(9) { animation-delay: 0.45s; }
.config-section:nth-child(10) { animation-delay: 0.5s; }
.config-section:nth-child(11) { animation-delay: 0.55s; }
.config-section:nth-child(12) { animation-delay: 0.6s; }
.config-section:nth-child(13) { animation-delay: 0.65s; }
.config-section:nth-child(14) { animation-delay: 0.7s; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1400px) {
    .welcome-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-visual {
        display: none;
    }
}

@media (max-width: 1200px) {
    :root {
        --sidebar-width: 260px;
        --drawer-width: 520px;
    }
    
    .preview-controls {
        flex-direction: column;
        gap: var(--space-md);
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 0px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-canvas {
        margin-left: 0;
        padding: var(--space-lg);
        padding-top: 80px;
    }
    
    .selection-summary {
        left: var(--space-md);
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
    }
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .color-input-row {
        flex-direction: column;
    }
    
    .preview-demo {
        flex-direction: column;
    }
    
    .drawer-tabs {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
