/* ============================================
   FileHoot — Styles
   Black & White / Grayscale Design for Large Screens
   ============================================ */

/* CSS Custom Properties - Grayscale Design */
:root {
    /* Colors - Pure Black & White with Grays */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #141414;
    --bg-elevated: #1a1a1a;
    --bg-hover: #222222;
    --bg-glass: rgba(10, 10, 10, 0.9);
    --bg-glass-strong: rgba(10, 10, 10, 0.95);
    
    /* Text - High contrast grayscale */
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-tertiary: #808080;
    --text-muted: #666666;
    --text-inverse: #000000;
    
    /* Accent - Pure white for emphasis */
    --accent-primary: #ffffff;
    --accent-secondary: #e5e5e5;
    --accent-gradient: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    --accent-glow: rgba(255, 255, 255, 0.15);
    
    /* Status colors - Grayscale variants */
    --success: #ffffff;
    --success-bg: rgba(255, 255, 255, 0.1);
    --warning: #b3b3b3;
    --warning-bg: rgba(179, 179, 179, 0.1);
    --error: #999999;
    --error-bg: rgba(153, 153, 153, 0.1);
    --info: #cccccc;
    --info-bg: rgba(204, 204, 204, 0.1);
    
    /* Syntax Colors - Grayscale for readability */
    --syntax-key: #ffffff;
    --syntax-string: #b3b3b3;
    --syntax-number: #e5e5e5;
    --syntax-boolean: #cccccc;
    --syntax-null: #666666;
    --syntax-bracket: #999999;
    --syntax-comment: #555555;
    
    /* Borders - Visible grays */
    --border-light: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.15);
    --border-strong: rgba(255, 255, 255, 0.25);
    --border-accent: rgba(255, 255, 255, 0.3);
    
    /* Shadows - Subtle */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 0 20px rgba(255, 255, 255, 0.1);
    --shadow-glow-strong: 0 0 30px rgba(255, 255, 255, 0.15);
    
    /* Spacing - Generous for large screens */
    --space-xs: 6px;
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 28px;
    --space-xl: 40px;
    --space-2xl: 56px;
    --space-3xl: 80px;
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    
    /* Layout - Balanced proportions */
    --header-height: 56px;
    --panel-left-width: 280px;
    --panel-right-width: 300px;
    --panel-bottom-height: 100px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light Theme - Inverted Grayscale */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f0f0f0;
    --bg-elevated: #ffffff;
    --bg-hover: #e8e8e8;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --bg-glass-strong: rgba(255, 255, 255, 0.95);
    
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-tertiary: #666666;
    --text-muted: #999999;
    --text-inverse: #ffffff;
    
    --accent-primary: #000000;
    --accent-secondary: #333333;
    --accent-gradient: linear-gradient(135deg, #000000 0%, #333333 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.03) 100%);
    --accent-glow: rgba(0, 0, 0, 0.1);
    
    --border-light: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.12);
    --border-strong: rgba(0, 0, 0, 0.2);
    --border-accent: rgba(0, 0, 0, 0.25);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(0, 0, 0, 0.08);
    --shadow-glow-strong: 0 0 30px rgba(0, 0, 0, 0.12);
    
    /* Syntax for light theme */
    --syntax-key: #000000;
    --syntax-string: #444444;
    --syntax-number: #222222;
    --syntax-boolean: #333333;
    --syntax-null: #888888;
    --syntax-bracket: #555555;
    --syntax-comment: #aaaaaa;
}

/* ============================================
   Reset & Base - OpenCode.ai Style
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
    letter-spacing: -0.01em;
    
    /* OpenCode-style subtle gradient background */
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Focus styles - Green accent */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

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

/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-base);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* ============================================
   Header
   ============================================ */
.app-header {
    height: var(--header-height);
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-medium);
    position: relative;
    z-index: 50;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 6px;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--bg-primary);
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text .tagline {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.header-privacy-msg {
    position: absolute;
    left: 50%;
    transform: translateX(calc(-50% - 80px));
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
    border: 2px solid #22c55e;
    border-radius: var(--radius-lg);
    color: #22c55e;
    letter-spacing: 0.05em;
    transition: var(--transition-base);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
    animation: privacyPulse 3s ease-in-out infinite;
    max-width: calc(100vw - 660px);
}

.header-privacy-msg:hover {
    border-color: #16a34a;
    background: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
    transform: translateX(calc(-50% - 80px)) scale(1.02);
}

.header-privacy-msg svg {
    color: #22c55e;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Header Actions (right side - fixed position) */
.header-actions {
    position: fixed;
    top: var(--space-sm);
    right: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    z-index: 100;
}

.header-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    transition: var(--transition-base);
    text-decoration: none;
    cursor: pointer;
}

.header-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Prominent Help Button */
.help-guide-btn {
    width: auto !important;
    padding: 0 var(--space-md) !important;
    gap: var(--space-xs);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.help-guide-btn:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.help-guide-btn svg {
    stroke: white !important;
    color: white !important;
}

.help-btn-text {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: white !important;
}

/* Pulse attention animation - runs 3 times then stops */
.pulse-attention {
    animation: pulse-glow 2s ease-in-out 3;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 2px 20px rgba(99, 102, 241, 0.8), 0 0 30px rgba(139, 92, 246, 0.4);
    }
}

/* Why FileHoot.ai Button */
.demo-video-btn {
    width: auto !important;
    padding: 0 var(--space-md) !important;
    gap: var(--space-xs);
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
    transition: all 0.2s ease;
}

.demo-video-btn:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.5);
    transform: translateY(-1px);
}

.demo-video-btn svg {
    fill: white;
    stroke: white;
}

.demo-btn-text {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: white !important;
    white-space: nowrap;
}

.header-action-btn:hover .email-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Bug Report Button */
.bug-report-btn {
    position: relative;
}

.bug-report-btn .bug-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--text-tertiary);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.bug-report-btn.has-errors .bug-count {
    opacity: 1;
    transform: scale(1);
    background: #ef4444;
}

.bug-report-btn.has-errors {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.5);
    animation: bugPulse 2s ease-in-out infinite;
}

.bug-report-btn.has-errors:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

@keyframes bugPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
}

.email-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    transform: translateY(-4px);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-medium);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.email-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 10px;
    border: 6px solid transparent;
    border-bottom-color: var(--border-medium);
}

.email-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 11px;
    border: 5px solid transparent;
    border-bottom-color: var(--bg-primary);
}

.email-tooltip.copied {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

.email-tooltip.copied::after {
    border-bottom-color: #22c55e;
}

.email-tooltip.copied::before {
    border-bottom-color: #22c55e;
}

.privacy-main {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}

.privacy-sub {
    font-size: 0.6rem;
    font-weight: 500;
    opacity: 0.85;
    border-left: 1px solid rgba(34, 197, 94, 0.4);
    padding-left: 10px;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

@keyframes privacyPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
    }
}

.header-nav {
    display: flex;
    gap: var(--space-sm);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-base);
}

.nav-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

/* ============================================
   Main Layout
   ============================================ */
.app-main {
    display: grid;
    grid-template-columns: var(--panel-left-width) 1fr var(--panel-right-width);
    height: calc(100vh - var(--header-height) - var(--panel-bottom-height));
    overflow: hidden;
}

/* ============================================
   Panels - Grayscale Style
   ============================================ */
.panel {
    background: var(--bg-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-medium);
}

.panel:last-child {
    border-right: none;
    border-left: 1px solid var(--border-medium);
}

.panel-header {
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid var(--border-medium);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.panel-header h2 {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Left Panel */
.panel-left {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.panel-left .panel-header {
    flex-shrink: 0;
}

.panel-left .format-override {
    flex-shrink: 0;
}

/* File info should be compact */
.panel-left .file-info {
    flex-shrink: 0;
    margin: var(--space-xs) var(--space-sm);
    padding: var(--space-sm);
}

/* Text input area should flex to fill available space */
.panel-left .text-input-section {
    min-height: 120px;
    flex: 1;
}

.panel-left .warnings-container {
    flex-shrink: 0;
}

/* Center Panel */
.panel-center {
    background: var(--bg-secondary);
    overflow: hidden;
    min-width: 0; /* Allow grid to shrink properly */
}

/* Center panel header - three-section layout */
.panel-center .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    overflow: hidden;
}

.panel-center .view-tabs {
    flex: 0 0 auto;
}

.panel-center .view-controls {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

/* Right Panel - Collapsible */
.panel-right {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
    height: 100%;
    position: relative;
    transition: width var(--transition-base), min-width var(--transition-base);
}

.panel-right.collapsed {
    width: 40px !important;
    min-width: 40px !important;
}

.panel-right.collapsed .chat-panel-header,
.panel-right.collapsed .chat-container {
    opacity: 0;
    visibility: hidden;
}

.panel-right.collapsed .panel-collapse-toggle .collapse-icon {
    display: none;
}

.panel-right.collapsed .panel-collapse-toggle .expand-icon {
    display: block;
}

/* Panel collapse toggle */
.panel-collapse-toggle {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-50%);
    width: 24px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-base);
    z-index: 20;
}

.panel-collapse-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* Chat panel header */
.chat-panel-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-medium);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

/* ============================================
   OWL MASCOT - Mani
   ============================================ */

/* Owl Mascot Container */
.owl-mascot {
    width: 42px;
    height: 48px;
    flex-shrink: 0;
    position: relative;
    animation: owlFloat 3s ease-in-out infinite;
}

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

/* Owl Ears (Tufts) */
.owl-ears {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    display: flex;
    justify-content: space-between;
}

.owl-ear {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #5b4636;
}

.owl-ear.left { transform: rotate(-15deg); }
.owl-ear.right { transform: rotate(15deg); }

/* Owl Face */
.owl-face {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 38px;
    background: linear-gradient(145deg, #8b6914 0%, #5b4636 100%);
    border-radius: 50% 50% 45% 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 6px;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.2),
        0 2px 8px rgba(0,0,0,0.3);
}

/* Owl Eyes Container */
.owl-eyes {
    display: flex;
    gap: 4px;
}

/* Individual Eye */
.owl-eye {
    width: 14px;
    height: 14px;
    background: linear-gradient(145deg, #fff8e7 0%, #ffd54f 100%);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 1px 2px rgba(0,0,0,0.1),
        0 1px 2px rgba(0,0,0,0.2);
}

/* Pupil */
.owl-pupil {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #1a1a2e;
    border-radius: 50%;
    animation: pupilLook 8s ease-in-out infinite;
}

.owl-pupil::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
}

@keyframes pupilLook {
    0%, 100% { transform: translate(-50%, -50%); }
    25% { transform: translate(-30%, -50%); }
    50% { transform: translate(-50%, -50%); }
    75% { transform: translate(-70%, -50%); }
}

/* Eyelids - Shutter Style Blink */
.owl-eyelid {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(145deg, #8b6914 0%, #5b4636 100%);
    transition: transform 0.15s ease-in-out;
}

.owl-eyelid.top {
    top: 0;
    transform: translateY(-100%);
    border-radius: 50% 50% 0 0;
}

.owl-eyelid.bottom {
    bottom: 0;
    transform: translateY(100%);
    border-radius: 0 0 50% 50%;
}

/* Shutter Blink Animation */
.owl-mascot:hover .owl-eyelid.top,
.owl-mascot.blinking .owl-eyelid.top {
    transform: translateY(0);
}

.owl-mascot:hover .owl-eyelid.bottom,
.owl-mascot.blinking .owl-eyelid.bottom {
    transform: translateY(0);
}

/* Auto blink animation */
@keyframes shutterBlink {
    0%, 90%, 100% { transform: translateY(-100%); }
    95% { transform: translateY(0); }
}

@keyframes shutterBlinkBottom {
    0%, 90%, 100% { transform: translateY(100%); }
    95% { transform: translateY(0); }
}

.owl-eyelid.top {
    animation: shutterBlink 4s ease-in-out infinite;
}

.owl-eyelid.bottom {
    animation: shutterBlinkBottom 4s ease-in-out infinite;
}

/* Stagger second eye blink */
.owl-eye.right .owl-eyelid.top {
    animation-delay: 0.1s;
}
.owl-eye.right .owl-eyelid.bottom {
    animation-delay: 0.1s;
}

/* Owl Beak */
.owl-beak {
    width: 0;
    height: 0;
    margin-top: 3px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid #ff9800;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

/* ============================================
   OWL LOGO (Header)
   ============================================ */

.owl-logo {
    width: 48px;
    height: 52px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.owl-logo-ears {
    display: flex;
    justify-content: space-between;
    width: 40px;
    position: absolute;
    top: 0;
}

.owl-logo-ear {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 14px solid #5b4636;
}

.owl-logo-ear.left { transform: rotate(-15deg); }
.owl-logo-ear.right { transform: rotate(15deg); }

.owl-logo-face {
    position: absolute;
    top: 10px;
    width: 44px;
    height: 42px;
    background: linear-gradient(145deg, #8b6914 0%, #5b4636 100%);
    border-radius: 50% 50% 45% 45%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.2),
        0 4px 12px rgba(91, 70, 54, 0.4);
}

.owl-logo-eyes {
    display: flex;
    gap: 6px;
}

.owl-logo-eye {
    width: 14px;
    height: 14px;
    background: linear-gradient(145deg, #fff8e7 0%, #ffd54f 100%);
    border-radius: 50%;
    position: relative;
    box-shadow: 
        inset 0 1px 2px rgba(0,0,0,0.1),
        0 1px 3px rgba(0,0,0,0.2);
    animation: logoEyeGlow 2s ease-in-out infinite alternate;
}

@keyframes logoEyeGlow {
    0% { box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 0 4px rgba(139, 105, 20, 0.3); }
    100% { box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 0 8px rgba(139, 105, 20, 0.6); }
}

.owl-logo-pupil {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #1a1a2e;
    border-radius: 50%;
}

.owl-logo-pupil::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
}

.owl-logo-beak {
    width: 0;
    height: 0;
    margin-top: 4px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid #fbbf24;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Dark mode adjustments for owl */
[data-theme="dark"] .owl-face {
    background: linear-gradient(145deg, #a08060 0%, #6b5240 100%);
}

[data-theme="dark"] .owl-ear {
    border-bottom-color: #6b5240;
}

[data-theme="dark"] .owl-eyelid {
    background: linear-gradient(145deg, #a08060 0%, #6b5240 100%);
}

.mascot-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mascot-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mascot-status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Chat container takes full space */
.panel-right .chat-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Bottom Panel */
.panel-bottom {
    height: var(--panel-bottom-height);
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border-top: 1px solid var(--border-medium);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

/* ============================================
   Format Badge
   ============================================ */
.format-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--accent-gradient-soft);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

.format-badge .format-name {
    font-weight: 600;
    color: var(--accent-primary);
}

.format-badge .confidence-score {
    color: var(--text-tertiary);
}

/* ============================================
   AI Feature Callout (Marketing Banner) - Compact
   ============================================ */
.ai-feature-callout {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin: var(--space-xs) var(--space-sm);
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(139, 105, 20, 0.12) 0%, rgba(91, 70, 54, 0.12) 100%);
    border: 1px solid rgba(139, 105, 20, 0.25);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.ai-callout-icon {
    font-size: 1rem;
    line-height: 1;
}

.ai-callout-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ai-callout-text strong {
    color: var(--text-accent);
    font-size: 0.7rem;
    font-weight: 600;
}

.ai-callout-text span {
    color: var(--text-secondary);
    font-size: 0.6rem;
    line-height: 1.2;
}

/* AI Status Indicator in Callout */
.ai-callout-status {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.55rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: help;
}

.ai-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ai-status-dot.loading {
    background: #f59e0b;
    animation: statusPulse 1.5s ease-in-out infinite;
}

.ai-status-dot.ready {
    background: #22c55e;
    box-shadow: 0 0 4px #22c55e;
}

.ai-status-dot.error {
    background: #ef4444;
}

.ai-status-dot.unavailable {
    background: #6b7280;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.ai-status-label {
    color: var(--text-secondary);
}

/* AI Callout states */
.ai-feature-callout.ai-ready {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(139, 105, 20, 0.08) 100%);
}

.ai-feature-callout.ai-error {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(107, 114, 128, 0.08) 100%);
}

.ai-feature-callout.ai-unavailable {
    border-color: rgba(107, 114, 128, 0.4);
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.08) 0%, rgba(107, 114, 128, 0.05) 100%);
}

.ai-feature-callout.ai-unavailable .ai-callout-icon {
    filter: grayscale(1);
    opacity: 0.6;
}

.ai-feature-callout.ai-unavailable .ai-callout-text strong {
    color: var(--text-tertiary);
}

/* Header AI Badge (unused - AI messaging now in left panel) */

/* Drop Zone Subtext */
.drop-subtext {
    margin-top: 4px;
    font-size: 0.65rem;
    color: var(--text-accent);
    font-weight: 500;
}

/* ============================================
   Drop Zone - Compact
   ============================================ */
.drop-zone {
    margin: var(--space-xs) var(--space-sm);
    padding: var(--space-sm) var(--space-xs);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition-base);
    text-align: center;
    flex-shrink: 0;
}

.drop-zone:hover {
    border-color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.drop-zone.drag-over {
    border-color: var(--text-primary);
    border-style: solid;
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-glow);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.drop-icon {
    color: var(--text-tertiary);
    transition: var(--transition-base);
}

.drop-icon svg {
    width: 20px;
    height: 20px;
}

.drop-zone:hover .drop-icon {
    color: var(--text-primary);
}

.drop-text {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

.drop-zone:hover .drop-text {
    color: var(--text-primary);
}

.drop-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
    justify-content: center;
}

.format-chip {
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    font-size: 0.55rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: var(--transition-fast);
}

.drop-zone:hover .format-chip {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* Demo Button in Drop Zone */
.demo-btn {
    margin-top: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .demo-btn {
    color: #2563eb;
}

/* ============================================
   Text Input Section
   ============================================ */
.text-input-section {
    padding: 0 var(--space-sm) var(--space-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.section-header h3 {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.text-input {
    width: 100%;
    flex: 1;
    min-height: 120px;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-primary);
    resize: none;
    transition: var(--transition-base);
    overflow-y: auto;
}

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

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

/* ============================================
   Format Override
   ============================================ */
.format-override {
    padding: 4px var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.format-override label {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.format-select {
    flex: 1;
    padding: 3px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-base);
}

.format-select:hover {
    border-color: var(--border-medium);
}

.format-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================
   File Info
   ============================================ */
.file-info {
    margin: var(--space-xs) var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    padding: 2px 0;
}

.info-label {
    color: var(--text-tertiary);
}

.info-value {
    font-weight: 500;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ============================================
   Warnings
   ============================================ */
.warnings-container {
    padding: 0 var(--space-lg) var(--space-lg);
}

.warning-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--warning);
}

/* ============================================
   View Tabs
   ============================================ */
.view-tabs {
    display: flex;
    gap: 2px;
}

.view-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-base);
    min-width: 40px;
}

/* Tab labels - compact */
.view-tab .tab-label {
    font-size: 0.5625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.view-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.view-tab.active {
    color: var(--accent-primary);
    background: var(--accent-gradient-soft);
}

/* ============================================
   View Controls
   ============================================ */
.view-controls {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    flex-shrink: 1;
    min-width: 0;
    position: relative;
    z-index: 5;
}

/* Search wrapper with label - centered in header */
.search-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    flex: 0 1 auto;
}

/* Control buttons with labels */
.btn-labeled {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-base);
    min-width: 36px;
    flex-shrink: 0;
}

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

.btn-labeled.btn-fullscreen {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
}

.btn-labeled.btn-fullscreen:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Control labels - compact text below icons */
.control-label {
    font-size: 0.5625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Fullscreen mode button styling */
body.fullscreen-mode .btn-fullscreen {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

body.fullscreen-mode .btn-fullscreen:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

body.fullscreen-mode .btn-fullscreen .control-label {
    color: var(--text-secondary);
}

body.fullscreen-mode .btn-fullscreen .expand-label {
    display: none !important;
}

body.fullscreen-mode .btn-fullscreen .compress-label {
    display: block !important;
}

/* Search Container - fixed width for consistency */
.search-container {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 4px 8px;
    width: 260px;  /* Fixed width - doesn't change */
}

.search-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.search-box svg {
    color: var(--text-tertiary);
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.search-box input {
    flex: 1 1 auto;
    min-width: 40px;
    width: 100%;
    padding: 2px 0;
    background: transparent;
    border: none;
    font-size: 0.8125rem;
    color: var(--text-primary);
    text-overflow: ellipsis;
    overflow: hidden;
}

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

/* Search Navigation - Always visible */
/* Search Navigation - ALWAYS visible, never hidden */
.search-nav {
    display: flex !important;
    align-items: center;
    gap: 2px;
    padding-left: 8px;
    margin-left: 4px;
    border-left: 1px solid var(--border-light);
    flex-shrink: 0;
    flex-grow: 0;
}

.search-nav[hidden] {
    display: flex !important;  /* Override any hidden attribute */
}

.search-nav .search-count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: center;
}

/* Navigation buttons */
.btn-nav {
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    transition: var(--transition-fast);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.btn-nav:active {
    transform: scale(0.95);
}

.btn-sm {
    padding: 4px;
}

/* Search Highlights - only for actual search matches */
.search-match {
    background: rgba(255, 200, 50, 0.4);
    border-radius: 2px;
    color: inherit;
    padding: 0 2px;
}

.search-match.search-current {
    background: rgba(255, 200, 50, 0.7);
    outline: 2px solid rgba(255, 200, 50, 0.9);
}

/* Tree node highlight (on selection, not search) */
.tree-node-content.selected {
    background: var(--bg-hover);
}

/* ============================================
   Fullscreen Mode
   ============================================ */
body.fullscreen-mode .app-header,
body.fullscreen-mode .panel-left,
body.fullscreen-mode .panel-right,
body.fullscreen-mode .panel-bottom {
    display: none !important;
}

body.fullscreen-mode .app-main {
    grid-template-columns: 1fr !important;
    height: 100vh;
}

body.fullscreen-mode .panel-center {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--bg-primary);
}

body.fullscreen-mode .panel-center .panel-header {
    padding: var(--space-md) var(--space-lg);
    justify-content: center;
    gap: var(--space-xl);
}

/* In fullscreen, make search container wider */
body.fullscreen-mode .search-container {
    width: 400px;
}

/* Fullscreen button icon toggle */
body.fullscreen-mode #fullscreenBtn .expand-icon {
    display: none !important;
}

body.fullscreen-mode #fullscreenBtn .compress-icon {
    display: block !important;
}

/* Main layout adjustment when right panel is collapsed */
.app-main.right-collapsed {
    grid-template-columns: var(--panel-left-width) 1fr 40px;
}

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-tertiary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item:not(:last-child)::after {
    content: '›';
    margin-left: var(--space-xs);
    color: var(--text-tertiary);
}

.breadcrumb-item:last-child {
    color: var(--accent-primary);
    font-weight: 500;
}

/* ============================================
   Visualization Canvas
   ============================================ */
.visualization-canvas {
    flex: 1;
    overflow: hidden; /* Let child view-containers handle their own scrolling */
    padding: var(--space-lg);
}

.view-container {
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain; /* Prevent scroll chaining to parent */
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-tertiary);
    animation: fadeIn 0.5s ease;
}

.empty-illustration {
    margin-bottom: var(--space-lg);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.empty-state p {
    font-size: 0.875rem;
}

/* ============================================
   Tree View
   ============================================ */
.tree-view {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.8;
}

.tree-node {
    position: relative;
}

.tree-node-content {
    display: flex;
    align-items: center;
    padding: 2px 0;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.tree-node-content:hover {
    background: var(--bg-tertiary);
}

/* Remove old highlight class - use search-match instead */

.tree-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-toggle svg {
    width: 12px;
    height: 12px;
}

.tree-indent {
    width: 20px;
    flex-shrink: 0;
}

.tree-key {
    color: var(--syntax-key);
    font-weight: 500;
}

.tree-colon {
    color: var(--syntax-bracket);
    margin: 0 4px;
}

.tree-value {
    word-break: break-all;
}

.tree-value.string { color: var(--syntax-string); }
.tree-value.number { color: var(--syntax-number); }
.tree-value.boolean { color: var(--syntax-boolean); }
.tree-value.null { color: var(--syntax-null); font-style: italic; }

/* Editable elements */
.tree-key[data-editable="true"],
.tree-value[data-editable="true"],
.editable-value,
.editable-key {
    cursor: text !important;
    border-radius: 3px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: all 0.15s ease;
    position: relative;
    display: inline-block;
}

.tree-key[data-editable="true"]:hover,
.tree-value[data-editable="true"]:hover,
.editable-value:hover,
.editable-key:hover {
    background-color: rgba(255, 255, 255, 0.1);
    outline: 1px dashed rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

.tree-key[data-editable="true"]:hover::after,
.tree-value[data-editable="true"]:hover::after,
.editable-value:hover::after {
    content: ' ✎';
    font-size: 10px;
    opacity: 0.6;
    color: var(--text-secondary);
}

/* Table cell editable */
td[data-editable="true"] {
    cursor: text !important;
    transition: all 0.15s ease;
}

td[data-editable="true"]:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    outline: 1px dashed rgba(255, 255, 255, 0.3);
}

/* Validation errors */
.tree-key.validation-error,
.tree-value.validation-error {
    background-color: var(--error-bg) !important;
    border: 1px solid var(--error);
    color: var(--error);
    animation: validation-pulse 1s ease-in-out infinite;
}

@keyframes validation-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Edit inputs */
.tree-edit-input,
.table-edit-input {
    background: var(--bg-elevated);
    border: 1px solid var(--accent-primary);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: inherit;
    min-width: 100px;
    outline: none;
}

.tree-edit-input.validation-error,
.table-edit-input.validation-error {
    border-color: var(--error);
    background-color: var(--error-bg);
    color: var(--error);
}

.tree-edit-key {
    font-weight: 500;
}

/* Table cell editing */
td[data-editable="true"] {
    cursor: pointer;
    position: relative;
}

td[data-editable="true"]:hover {
    background-color: var(--bg-hover);
}

td.validation-error {
    background-color: var(--error-bg) !important;
    border: 1px solid var(--error) !important;
    color: var(--error) !important;
    animation: validation-pulse 1s ease-in-out infinite;
}

.table-edit-input {
    width: 100%;
    min-width: 80px;
}

.tree-bracket {
    color: var(--syntax-bracket);
}

.tree-children {
    padding-left: 20px;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.tree-children.collapsed {
    max-height: 0;
    display: none;
}

.tree-count {
    margin-left: var(--space-xs);
    padding: 1px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.tree-type-badge {
    margin-left: var(--space-xs);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.7;
}

.tree-type-badge.array { background: var(--info-bg); color: var(--info); }
.tree-type-badge.object { background: var(--accent-gradient-soft); color: var(--accent-primary); }

/* Add to Chat button in tree view */
.tree-add-to-chat-btn {
    margin-left: var(--space-xs);
    padding: 2px 4px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tree-node-content:hover .tree-add-to-chat-btn {
    opacity: 0.6;
}

.tree-add-to-chat-btn:hover {
    opacity: 1 !important;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.tree-add-to-chat-btn:hover svg {
    stroke: white !important;
}

.tree-add-to-chat-btn svg {
    stroke: var(--text-secondary);
}

/* Dark mode fix for XPath button */
[data-theme="dark"] .tree-add-to-chat-btn {
    border-color: var(--border-medium);
}

[data-theme="dark"] .tree-add-to-chat-btn svg {
    stroke: #a1a1aa;
}

[data-theme="dark"] .tree-add-to-chat-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
}

[data-theme="dark"] .tree-add-to-chat-btn:hover svg {
    stroke: #ffffff !important;
}

/* XPath Copied Notification */
.xpath-copied-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    animation: xpath-slide-in 0.3s ease-out;
}

@keyframes xpath-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.xpath-notification-fade {
    animation: xpath-fade-out 0.3s ease-out forwards;
}

@keyframes xpath-fade-out {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.xpath-notification-content {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    background: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

.xpath-notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.xpath-notification-text {
    flex: 1;
    min-width: 0;
}

.xpath-notification-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-primary);
    margin-bottom: var(--space-xs);
}

.xpath-notification-path {
    display: block;
    background: var(--bg-tertiary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-bottom: var(--space-sm);
    word-break: break-all;
    color: var(--text-primary);
}

.xpath-notification-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.xpath-notification-examples {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.6;
}

.xpath-notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.xpath-notification-close:hover {
    color: var(--text-primary);
}

/* ============================================
   Table View
   ============================================ */
.table-view {
    display: flex;
    flex-direction: column;
}

.table-wrapper {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

#dataTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

#dataTable th {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border-medium);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition-fast);
}

#dataTable th:hover {
    background: var(--bg-secondary);
}

#dataTable th .sort-icon {
    margin-left: var(--space-xs);
    opacity: 0.5;
}

#dataTable th.sorted .sort-icon {
    opacity: 1;
    color: var(--accent-primary);
}

#dataTable td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

#dataTable tr:hover td {
    background: var(--bg-tertiary);
}

#dataTable .col-type {
    font-size: 0.625rem;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: var(--space-xs);
    text-transform: uppercase;
}

#dataTable .col-type.string { background: var(--success-bg); color: var(--success); }
#dataTable .col-type.number { background: var(--warning-bg); color: var(--warning); }
#dataTable .col-type.boolean { background: var(--error-bg); color: var(--error); }

.table-stats {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============================================
   Graph View - Supports Light/Dark Theme
   ============================================ */
.graph-view {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#graphCanvas {
    flex: 1;
    width: 100%;
    min-height: 400px;
    position: relative;
    /* Background is set dynamically by JS based on theme */
}

/* Graph Controls - Bottom toolbar */
.graph-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

.graph-controls-left {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: 4px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
}

.graph-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1001;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.graph-control-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.graph-control-btn:active {
    transform: scale(0.95);
}

.graph-control-btn svg {
    width: 18px;
    height: 18px;
}


/* vis-network canvas - theme-aware via JS */
.graph-view .vis-network {
    background: transparent !important;
}

.graph-view .vis-network canvas {
    background: transparent !important;
}

/* Graph node styling */
.graph-view .vis-node {
    border-radius: 8px !important;
}

.graph-view .vis-node.vis-selected {
    box-shadow: 0 0 0 3px var(--accent-primary) !important;
}

.graph-view .vis-node .vis-label {
    font-family: 'JetBrains Mono', 'Consolas', monospace !important;
    padding: 12px 14px !important;
    line-height: 1.7 !important;
    white-space: pre-wrap !important;
}

/* Graph edge styling */
.graph-view .vis-edge {
    opacity: 1;
}

.graph-view .vis-edge.vis-selected {
    opacity: 1;
}

.graph-view .vis-edge .vis-label {
    padding: 3px 8px !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    border-radius: 3px !important;
    text-shadow: none !important;
    z-index: 100 !important;
}

/* Ensure edge labels are visible */
.graph-view text {
    paint-order: stroke fill;
}

/* Edge label background for better contrast */
.graph-view .vis-network text {
    font-family: 'Inter', -apple-system, sans-serif !important;
}

/* Prevent labels from being clipped by nodes */
.graph-view .vis-network .vis-edge-label {
    pointer-events: none;
}

/* Graph controls - hide default vis buttons */
.graph-view .vis-controls,
.graph-view .vis-button {
    display: none !important;
}

.graph-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
}

/* ============================================
   Raw View
   ============================================ */
.raw-view {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.raw-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px var(--space-sm);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    min-height: 32px;
}

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

.repair-raw-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 6px 12px !important;
    width: auto !important;
    height: auto !important;
    background: linear-gradient(135deg, #8b6914 0%, #5b4636 100%) !important;
    border: none !important;
    border-radius: var(--radius-sm);
    color: white !important;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.repair-raw-btn:hover {
    background: linear-gradient(135deg, #a07b18 0%, #6d5843 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.4);
}

.repair-raw-btn svg {
    width: 14px;
    height: 14px;
    stroke: white;
}

.repair-raw-btn span {
    color: white;
}

.raw-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-raw-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-raw-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.copy-raw-btn.copied {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.copy-raw-btn svg {
    width: 14px;
    height: 14px;
}

.prettify-raw-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prettify-raw-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.prettify-raw-btn.prettified {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.prettify-raw-btn svg {
    width: 14px;
    height: 14px;
}

.prettify-text {
    font-size: 0.75rem;
}

.copy-text {
    display: inline-block;
    min-width: 40px;
}

.raw-content {
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    overflow: auto;
}

/* ============================================
   Diff View
   ============================================ */
.diff-view {
    display: flex;
    flex-direction: column;
}

.diff-header {
    display: flex;
    border-bottom: 1px solid var(--border-light);
}

.diff-label {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.diff-original {
    background: var(--error-bg);
    color: var(--error);
}

.diff-converted {
    background: var(--success-bg);
    color: var(--success);
}

.diff-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    overflow: auto;
}

.diff-pane {
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.8;
    overflow: auto;
}

.diff-pane:first-child {
    border-right: 1px solid var(--border-light);
}

.diff-line {
    padding: 1px 4px;
    border-radius: 2px;
}

.diff-line.added {
    background: rgba(34, 197, 94, 0.15);
    border-left: 3px solid #22c55e;
    color: #22c55e;
    padding-left: 8px;
    margin-left: -3px;
}

.diff-line.removed {
    background: rgba(239, 68, 68, 0.15);
    border-left: 3px solid #ef4444;
    color: #ef4444;
    padding-left: 8px;
    margin-left: -3px;
}

.diff-line.changed {
    background: var(--warning-bg);
}

/* ============================================
   Error View
   ============================================ */
.error-view {
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-card {
    max-width: 500px;
    padding: var(--space-xl);
    background: var(--bg-glass-strong);
    border: 1px solid var(--error);
    border-radius: var(--radius-lg);
    text-align: center;
    animation: shake 0.5s ease;
}

.error-icon {
    color: var(--error);
    margin-bottom: var(--space-md);
}

.error-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--error);
    margin-bottom: var(--space-sm);
}

.error-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.error-location {
    display: inline-block;
    padding: var(--space-xs) var(--space-sm);
    background: var(--error-bg);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--error);
    margin-bottom: var(--space-md);
}

.error-context {
    text-align: left;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.8;
    color: var(--text-secondary);
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

.error-context .error-line {
    background: var(--error-bg);
    color: var(--error);
    display: block;
    padding: 0 4px;
    margin: 0 -4px;
}

.error-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

/* ============================================
   Mascot States (for mini mascot)
   ============================================ */
.mascot.thinking .mascot-face-mini {
    animation: float 3s ease-in-out infinite, thinking 1s ease-in-out infinite;
}

.mascot.thinking .mascot-eye-mini {
    animation: none;
    height: 2px;
    border-radius: 2px;
}

.mascot.success .mascot-face-mini {
    animation: bounce 0.5s ease;
}

.mascot.warning .mascot-face-mini {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

/* ============================================
   Chat Interface
   ============================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    padding: 0 var(--space-md);
    overflow: hidden;
    min-height: 0;
    background: var(--bg-primary);
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    min-height: 0;
}

.chat-message {
    display: flex;
    gap: var(--space-sm);
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-content {
    max-width: 90%;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message-content code {
    word-break: break-all;
    white-space: pre-wrap;
    background: var(--bg-secondary);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7rem;
}

.chat-message.assistant .message-content {
    background: var(--bg-tertiary);
    border-top-left-radius: var(--radius-sm);
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, #5b4636 0%, #3d2e24 100%);
    color: #fff8e7;
    border-top-right-radius: var(--radius-sm);
}

/* Light mode: darker user message bubble */
[data-theme="light"] .chat-message.user .message-content {
    background: linear-gradient(135deg, #8b6914 0%, #5b4636 100%);
    color: white;
}

/* Chat message copy button */
.chat-message.assistant {
    position: relative;
}

.chat-copy-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    padding: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-message.assistant:hover .chat-copy-btn {
    opacity: 1;
}

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

.chat-copy-btn.copied {
    color: #22c55e;
    border-color: #22c55e;
}

.chat-copy-btn svg {
    width: 14px;
    height: 14px;
}

.message-content p {
    margin: var(--space-xs) 0;
}

.message-content p:first-child {
    margin-top: 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content code {
    padding: 1px 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-xs) 0;
    flex-shrink: 0;
}

.suggestion-chip {
    padding: 4px var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: var(--accent-gradient-soft);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.suggestion-chip.ai-chip {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-secondary);
}

.suggestion-chip.ai-chip:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.chat-input-container {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-primary);
    transition: var(--transition-base);
    min-width: 0;
}

.chat-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.send-btn {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
}

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

.help-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: var(--transition-base);
}

.help-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Insights are now shown in chat messages */

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

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

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
    font-weight: 600;
    border: 1px solid var(--text-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
}

/* AI Repair Button - Eye-catching gradient */
.btn-ai-repair {
    background: linear-gradient(135deg, #8b6914 0%, #5b4636 100%);
    color: white;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 8px rgba(139, 105, 20, 0.4);
    animation: aiButtonPulse 2s ease-in-out infinite;
}

.btn-ai-repair:hover:not(:disabled) {
    background: linear-gradient(135deg, #a07b18 0%, #6d5843 100%);
    box-shadow: 0 4px 16px rgba(139, 105, 20, 0.6);
    transform: translateY(-1px);
}

@keyframes aiButtonPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(139, 105, 20, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(139, 105, 20, 0.7); }
}

/* AI Repair Highlight for icon buttons */
.ai-repair-highlight {
    background: linear-gradient(135deg, rgba(139, 105, 20, 0.2) 0%, rgba(91, 70, 54, 0.2) 100%) !important;
    border-color: rgba(139, 105, 20, 0.5) !important;
    color: #8b6914 !important;
}

.ai-repair-highlight:hover {
    background: linear-gradient(135deg, rgba(139, 105, 20, 0.3) 0%, rgba(91, 70, 54, 0.3) 100%) !important;
    border-color: rgba(139, 105, 20, 0.7) !important;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

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

/* Validate Button - Prominent with radiant glow */
#validateBtn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    font-weight: 600;
    position: relative;
    box-shadow: 
        0 0 20px rgba(59, 130, 246, 0.4),
        0 0 40px rgba(59, 130, 246, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.15);
    animation: validateGlow 2s ease-in-out infinite;
}

#validateBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 
        0 0 30px rgba(59, 130, 246, 0.6),
        0 0 60px rgba(59, 130, 246, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

#validateBtn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    box-shadow: none;
    animation: none;
}

@keyframes validateGlow {
    0%, 100% {
        box-shadow: 
            0 0 15px rgba(59, 130, 246, 0.3),
            0 0 30px rgba(59, 130, 246, 0.15),
            0 2px 8px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 
            0 0 25px rgba(59, 130, 246, 0.5),
            0 0 50px rgba(59, 130, 246, 0.25),
            0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-base);
}

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

/* ============================================
   Conversion Section
   ============================================ */
.conversion-section {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.conversion-section label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.divider-vertical {
    width: 1px;
    height: 24px;
    background: var(--border-medium);
    margin: 0 var(--space-xs);
}

.action-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0; /* Don't shrink header */
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    color: var(--text-tertiary);
}

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

/* Video Modal */
.modal.modal-video {
    max-width: 900px;
    width: 94%;
    background: #000;
    border: 1px solid var(--border-medium);
}

.modal.modal-video .modal-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-md) var(--space-lg);
}

.modal.modal-video .modal-header h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
}

.modal.modal-video .modal-header h2 svg {
    color: #ef4444;
    flex-shrink: 0;
}

.video-modal-body {
    padding: 0 !important;
    overflow: hidden;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-container video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Modal size variants */
.modal.modal-lg {
    max-width: 700px;
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    flex-shrink: 0; /* Don't shrink footer */
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: var(--transition-base);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* AI Repair Button States */
.btn-ai-ready {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    animation: aiReadyPulse 2s ease-in-out infinite;
}

.btn-ai-ready:hover:not(:disabled) {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.6);
    transform: translateY(-1px);
}

@keyframes aiReadyPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(34, 197, 94, 0.7); }
}

.btn-ai-loading {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
    border: none !important;
    cursor: wait;
}

.btn-ai-disabled {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-light) !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Repair Modal Specifics */
.repair-issue,
.repair-suggestion,
.repair-diff {
    margin-bottom: var(--space-lg);
}

.repair-issue h4,
.repair-suggestion h4,
.repair-diff h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.repair-issue p,
.repair-suggestion p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.issues-header {
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.issues-header strong {
    color: var(--accent-primary);
}

.repair-issues-list {
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.repair-issues-list .issue-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-sm);
    margin-bottom: var(--space-xs);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid #ff6b6b;
    gap: var(--space-sm);
    transition: background 0.2s ease;
}

.repair-issues-list .issue-item:hover {
    background: var(--bg-hover);
}

.repair-issues-list .issue-item:last-child {
    margin-bottom: 0;
}

.repair-issues-list .issue-main {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}

.repair-issues-list .issue-number {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
}

.repair-issues-list .issue-details {
    flex: 1;
    min-width: 0;
}

.repair-issues-list .issue-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.repair-issues-list .issue-message {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.repair-issues-list .issue-position {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

.repair-issues-list .issue-description {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.repair-issues-list .issue-actions {
    flex-shrink: 0;
}

/* Show Issue Button */
.btn-show-issue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-show-issue:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.btn-show-issue svg {
    width: 12px;
    height: 12px;
}

/* Raw View with Line Numbers */
.raw-lines {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.raw-line {
    display: flex;
    padding: 2px 0;
    transition: background 0.2s ease;
}

.raw-line:hover {
    background: var(--bg-hover);
}

.raw-line .line-number {
    flex-shrink: 0;
    width: 40px;
    padding-right: 12px;
    text-align: right;
    color: var(--text-muted);
    user-select: none;
    border-right: 1px solid var(--border-light);
    margin-right: 12px;
}

.raw-line .line-content {
    flex: 1;
    white-space: pre;
    overflow-x: auto;
}

/* Issue Highlight in Raw View */
.raw-line.issue-highlight {
    background: rgba(255, 200, 0, 0.15);
    border-left: 3px solid #ffcc00;
    margin-left: -3px;
}

.raw-line.issue-highlight .line-number {
    color: #ffcc00;
    font-weight: bold;
}

.raw-line.pulse {
    animation: pulse-highlight 1s ease-in-out 2;
}

@keyframes pulse-highlight {
    0%, 100% { background: rgba(255, 200, 0, 0.15); }
    50% { background: rgba(255, 200, 0, 0.35); }
}

/* Raw Content Wrapper with Line Numbers */
.raw-content-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 300px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.raw-line-numbers {
    flex-shrink: 0;
    width: 50px;
    padding: var(--space-md) var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    text-align: right;
    user-select: none;
    overflow: hidden;
}

.raw-line-numbers .line-number {
    display: block;
    padding: 0;
    min-height: 1.6em;
}

.raw-line-numbers .line-number.highlight {
    color: var(--accent-primary);
    font-weight: bold;
    background: rgba(255, 255, 255, 0.05);
}

/* Editable Raw Content */
textarea.raw-content {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 300px;
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: 0;
    resize: vertical;
    overflow: auto;
    white-space: pre;
    tab-size: 2;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

textarea.raw-content:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px var(--accent-primary);
}

textarea.raw-content::placeholder {
    color: var(--text-muted);
}

/* Sync scrollbar styling */
textarea.raw-content::-webkit-scrollbar {
    width: 8px;
}

textarea.raw-content::-webkit-scrollbar-track {
    background: transparent;
}

textarea.raw-content::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

textarea.raw-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Raw Edit Actions */
.raw-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-xs);
    padding: 4px var(--space-sm);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.diff-preview {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.8;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Diff prefix styling */
.diff-prefix {
    font-weight: bold;
    margin-right: 8px;
    user-select: none;
}

.diff-line.added .diff-prefix {
    color: #22c55e;
}

.diff-line.removed .diff-prefix {
    color: #ef4444;
}

/* Diff unified view */
.diff-unified {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
}

.diff-unified .diff-line {
    padding: 2px 8px;
    border-radius: 2px;
    margin: 1px 0;
}

.diff-unified .line-num {
    display: inline-block;
    min-width: 30px;
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px solid var(--border-light);
    color: var(--text-muted);
    text-align: right;
    user-select: none;
}

/* AI Repair Progress */
.ai-repair-progress {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
    width: 0%;
    border-radius: var(--radius-sm);
}

.progress-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

/* AI Status Indicator */
.ai-status {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-right: auto;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: pulse 2s ease-in-out infinite;
}

.ai-status.ready .ai-status-dot {
    background: #22c55e;
    animation: none;
}

.ai-status.loading .ai-status-dot {
    background: #f59e0b;
}

.ai-status.error .ai-status-dot {
    background: #ef4444;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.ai-status-text {
    white-space: nowrap;
}

/* ============================================
   Model Upgrade Modal
   ============================================ */
.modal-sm {
    max-width: 480px;
}

.model-upgrade-info {
    text-align: center;
}

.upgrade-icon {
    margin-bottom: var(--space-md);
    color: var(--accent-primary);
}

.upgrade-icon svg {
    width: 48px;
    height: 48px;
}

.upgrade-reason {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

.model-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.model-current,
.model-upgrade {
    flex: 1;
    text-align: center;
}

.model-current h4,
.model-upgrade h4 {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.model-current p,
.model-upgrade p {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.model-spec {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.model-arrow {
    font-size: 1.2rem;
    color: var(--accent-primary);
    font-weight: bold;
}

.model-upgrade {
    background: rgba(var(--accent-primary-rgb), 0.1);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--accent-primary);
}

.download-estimate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.download-estimate svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.upgrade-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   Model Download Progress Modal
   ============================================ */
.download-progress-info {
    text-align: center;
    padding: var(--space-md) 0;
}

.download-model-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.download-progress-bar {
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-light);
}

.download-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, #22c55e 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
}

.download-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.2) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.download-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.download-percent {
    font-weight: 600;
    color: var(--accent-primary);
}

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

.download-status {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.download-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   Toast
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-md));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    z-index: 1001;
    max-width: 90vw;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.8125rem;
    animation: toastSlideDown 0.3s ease;
    min-width: 200px;
    max-width: 400px;
}

.toast svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.toast .toast-message {
    flex: 1;
}

.toast .toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 4px;
    margin: -4px;
    margin-left: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast .toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.toast.success {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.toast.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-weight: 600;
}

.toast.warning {
    border-color: #eab308;
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
}

.toast.info {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.toast.hiding {
    animation: toastSlideUp 0.3s ease forwards;
}

@keyframes toastSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glow {
    from { opacity: 0.2; transform: scale(1); }
    to { opacity: 0.4; transform: scale(1.1); }
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes thinking {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ============================================
   Large Screen Optimizations
   ============================================ */
@media (min-width: 1440px) {
    :root {
        --panel-left-width: 320px;
        --panel-right-width: 340px;
        --header-height: 60px;
        --panel-bottom-height: 90px;
    }
    
    .panel-bottom {
        flex-direction: row;
        gap: var(--space-xl);
    }
}

@media (min-width: 1920px) {
    :root {
        --panel-left-width: 360px;
        --panel-right-width: 380px;
        --header-height: 64px;
        --panel-bottom-height: 80px;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
}

@media (min-width: 2560px) {
    :root {
        --panel-left-width: 400px;
        --panel-right-width: 420px;
        --header-height: 68px;
        --panel-bottom-height: 80px;
    }
}

/* ============================================
   Responsive - Smaller Screens
   ============================================ */
@media (max-width: 1200px) {
    :root {
        --panel-left-width: 260px;
        --panel-right-width: 280px;
    }
    
    /* Slightly smaller search on medium screens */
    .search-container {
        width: 220px;
    }
    
    /* Smaller labels on medium screens */
    .control-label,
    .view-tab .tab-label {
        font-size: 0.5rem;
    }
}

@media (max-width: 1024px) {
    .app-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .panel-left,
    .panel-right {
        display: none;
    }
    
    .panel-left.active,
    .panel-right.active {
        display: flex;
        position: fixed;
        top: var(--header-height);
        bottom: var(--panel-bottom-height);
        width: 320px;
        z-index: 100;
        box-shadow: var(--shadow-xl);
    }
    
    .panel-left.active {
        left: 0;
    }
    
    .panel-right.active {
        right: 0;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --panel-bottom-height: auto;
    }
    
    .app-header {
        padding: 0 var(--space-md);
    }
    
    .logo-text .tagline {
        display: none;
    }
    
    .header-nav {
        display: none;
    }
    
    .modal.modal-video {
        width: 98%;
        max-width: none;
    }

    .header-privacy-msg {
        position: static;
        transform: none;
        padding: 6px 12px;
        margin: 0 var(--space-sm);
    }
    
    .privacy-main {
        font-size: 0.65rem;
    }
    
    .header-actions {
        gap: var(--space-xs);
    }
    
    .header-action-btn {
        width: 32px;
        height: 32px;
    }
    
    .header-action-btn svg {
        width: 16px;
        height: 16px;
    }

    .demo-btn-text,
    .help-btn-text {
        display: none;
    }

    .demo-video-btn,
    .help-guide-btn {
        width: 32px !important;
        padding: 0 !important;
    }
    
    .privacy-sub {
        display: none;
    }
    
    .panel-bottom {
        flex-direction: column;
        padding: var(--space-md);
        gap: var(--space-md);
    }
    
    .conversion-section,
    .action-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .search-box input {
        width: 120px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        background: white;
    }
    
    .app-header,
    .panel-left,
    .panel-right,
    .panel-bottom,
    .header-actions {
        display: none !important;
    }
    
    .app-main {
        display: block;
    }
    
    .panel-center {
        height: auto;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none !important;
}

[hidden] {
    display: none !important;
}

/* ============================================
   SEO FOOTER
   Crawlable content, minimal visual footprint
   ============================================ */

.seo-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-lg) var(--space-xl);
    margin-top: var(--space-xl);
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.seo-footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.seo-footer h2,
.seo-footer h3 {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: var(--space-md) 0 var(--space-xs);
}

.seo-footer h2:first-child {
    margin-top: 0;
}

.seo-footer p {
    margin: var(--space-xs) 0;
}

.seo-footer ul {
    list-style: none;
    padding: 0;
    margin: var(--space-xs) 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-md);
}

.seo-footer li {
    display: inline;
}

.seo-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.seo-footer a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.seo-section {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-secondary);
}

.seo-section:last-of-type {
    border-bottom: none;
}

.seo-nav {
    display: flex;
    gap: var(--space-md);
    margin: var(--space-md) 0;
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--border-secondary);
    border-bottom: 1px solid var(--border-secondary);
}

.copyright {
    text-align: center;
    margin-top: var(--space-md);
    opacity: 0.8;
}

.copyright small {
    display: block;
    margin-top: var(--space-xs);
    opacity: 0.7;
}

/* Collapsed footer for minimal UI (expand on hover/focus) */
@media (min-width: 768px) {
    .seo-footer {
        max-height: 60px;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .seo-footer:hover,
    .seo-footer:focus-within {
        max-height: 600px;
    }
    
    .seo-footer::after {
        content: '▼ More info';
        display: block;
        text-align: center;
        padding: var(--space-xs);
        font-size: 0.7rem;
        opacity: 0.5;
        transition: opacity 0.2s;
    }
    
    .seo-footer:hover::after,
    .seo-footer:focus-within::after {
        content: '▲ Less';
    }
}

/* Print styles for SEO content */
@media print {
    .seo-footer {
        max-height: none;
        page-break-before: always;
    }
}

/* ============================================
   Help Modal Styles
   ============================================ */
.help-modal-body {
    font-size: 0.8rem;
    padding: var(--space-lg);
    overflow-y: auto;
    overflow-x: hidden;
}

.help-section {
    margin-bottom: var(--space-lg);
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--accent-primary);
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.help-code-block {
    display: block;
    background: var(--bg-tertiary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    margin-bottom: var(--space-sm);
    color: var(--accent-secondary);
    word-break: break-all;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.help-table td {
    padding: var(--space-xs) var(--space-sm);
    border-bottom: 1px solid var(--border-light);
}

.help-table td:first-child {
    width: 55%;
}

.help-table td:first-child code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    word-break: break-all;
}

.help-table td:last-child {
    color: var(--text-secondary);
}

.help-examples {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.help-example {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    border-left: 3px solid var(--accent-primary);
}

.help-example-query {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    word-break: break-all;
}

.help-example-result {
    font-size: 0.7rem;
    color: var(--success);
}

/* Modal XL size */
.modal.modal-xl {
    max-width: 850px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* For large screens, make modal fit content without scroll */
@media (min-height: 800px) {
    .modal.modal-xl {
        max-height: 75vh;
    }
}

.modal.modal-xl .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Important for flex scroll */
    padding: var(--space-md);
}

/* Help Tabs */
.help-tabs {
    display: flex;
    gap: 4px;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    flex-shrink: 0; /* Don't shrink tabs */
    scrollbar-width: thin;
}

.help-tabs::-webkit-scrollbar {
    height: 4px;
}

.help-tabs::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 2px;
}

.help-tab {
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-base);
}

.help-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.help-tab.active {
    color: white !important;
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
}

/* Ensure dark mode tabs are visible */
[data-theme="dark"] .help-tab.active {
    color: white !important;
    background: #6366f1 !important;
    border-color: #6366f1 !important;
}

.help-tab-content {
    display: none;
}

.help-tab-content.active {
    display: block;
}

/* Help Hero */
.help-hero {
    text-align: center;
    padding: var(--space-md);
    background: var(--accent-gradient-soft);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.help-mascot-img {
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-xs);
}

.help-mascot-img-small {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.help-hero h3 {
    margin-bottom: var(--space-xs);
    font-size: 1.1rem;
}

.help-hero p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

/* Features Grid */
.help-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.help-feature-card {
    background: var(--bg-tertiary);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    text-align: center;
}

.help-feature-icon {
    margin-bottom: var(--space-xs);
}

.help-feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
}

.help-feature-card h4 {
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.help-feature-card p {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.3;
}

/* Quick Start */
.help-quickstart {
    background: var(--bg-tertiary);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
}

.help-quickstart h4 {
    margin-bottom: var(--space-sm);
    text-align: center;
    font-size: 0.85rem;
}

.help-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.help-step {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.help-step-num {
    width: 18px;
    height: 18px;
    background: #6366f1 !important;
    color: #ffffff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
}

.help-step-text {
    font-size: 0.7rem;
}

.help-step-arrow {
    color: var(--accent-primary);
}

.help-step-arrow svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent-primary);
}

/* View Showcase */
.help-view-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.help-view-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.help-view-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.help-view-icon {
    font-size: 1rem;
}

.help-view-name {
    font-weight: 600;
    font-size: 0.8rem;
}

.help-view-mockup {
    padding: var(--space-sm);
    min-height: 100px;
    font-size: 0.7rem;
}

.help-view-desc {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.65rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    margin: 0;
}

/* Mock Tree */
.mock-tree-item {
    padding: 2px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mock-tree-item.indent {
    padding-left: 20px;
}

.mock-toggle {
    color: var(--text-tertiary);
    font-size: 0.6rem;
}

.mock-key {
    color: var(--accent-secondary);
}

.mock-string {
    color: var(--success);
}

.mock-number {
    color: var(--info);
}

.mock-bracket {
    color: var(--text-tertiary);
}

.mock-badge {
    font-size: 0.55rem;
    background: var(--bg-secondary);
    padding: 1px 4px;
    border-radius: 3px;
    color: var(--text-tertiary);
}

.mock-chat-btn {
    font-size: 0.6rem;
    opacity: 0.5;
    margin-left: auto;
}

.mock-chat-btn.highlight {
    opacity: 1;
    background: var(--accent-primary);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Mock Table */
.mock-table {
    width: 100%;
    font-size: 0.65rem;
    border-collapse: collapse;
}

.mock-table th, .mock-table td {
    padding: 4px 8px;
    border: 1px solid var(--border-light);
    text-align: left;
}

.mock-table th {
    background: var(--bg-secondary);
}

/* Graph Mockup */
.graph-mockup {
    display: flex;
    align-items: center;
    justify-content: center;
}

.graph-mockup svg {
    width: 100%;
    height: 80px;
}

/* Raw Mockup */
.raw-mockup {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.mock-raw-line {
    display: flex;
    gap: 8px;
}

.line-num {
    color: var(--text-tertiary);
    user-select: none;
    min-width: 20px;
    text-align: right;
}

/* Repair Types */
.help-repair-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.help-repair-type {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.help-repair-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.help-repair-icon {
    font-size: 1.5rem;
}

.help-repair-header h4 {
    flex: 1;
    margin: 0;
}

.help-badge {
    font-size: 0.6rem;
    padding: 2px 8px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 10px;
}

.help-badge.ai {
    background: var(--accent-gradient-soft);
    color: var(--accent-primary);
}

.help-repair-mockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.mock-error-box, .mock-success-box, .mock-ai-box {
    width: 100%;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.7rem;
}

.mock-error-box {
    background: var(--error-bg);
    border: 1px solid var(--error);
}

.mock-error-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.mock-error-item {
    color: var(--text-secondary);
    font-size: 0.65rem;
}

.mock-success-box {
    background: var(--success-bg);
    border: 1px solid var(--success);
    text-align: center;
}

.mock-success-title {
    color: var(--success);
    font-weight: 600;
}

.mock-ai-box {
    background: var(--accent-gradient-soft);
    text-align: center;
}

.mock-ai-thinking {
    margin-bottom: var(--space-xs);
}

.mock-ai-progress {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.mock-ai-progress::after {
    content: '';
    display: block;
    width: 50%;
    height: 100%;
    background: var(--accent-primary);
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(200%); }
}

.mock-arrow {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.help-repair-list {
    margin: 0;
    padding-left: var(--space-lg);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.help-repair-list li {
    margin-bottom: var(--space-xs);
}

/* Vertical Steps */
.help-steps-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.help-step-v {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.help-step-v-num {
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.help-step-v-content {
    flex: 1;
}

.help-step-v-content strong {
    display: block;
    margin-bottom: var(--space-xs);
}

.help-step-v-content p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.mock-button {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    margin-top: var(--space-xs);
}

/* Convert Diagram */
.help-convert-diagram {
    position: relative;
    padding: var(--space-xl);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    min-height: 200px;
}

.convert-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.convert-hub {
    background: var(--accent-gradient);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
}

.convert-formats {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.convert-format {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
}

.convert-format.json { border-color: #f59e0b; }
.convert-format.yaml { border-color: #10b981; }
.convert-format.toml { border-color: #8b5cf6; }
.convert-format.csv { border-color: #3b82f6; }

.format-icon {
    font-size: 1.2rem;
    font-weight: 600;
}

.convert-arrows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.help-convert-example {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.convert-before, .convert-after {
    flex: 1;
    min-width: 200px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.convert-label {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    font-size: 0.7rem;
    font-weight: 600;
}

.convert-code {
    padding: var(--space-sm);
    margin: 0;
    font-size: 0.7rem;
    font-family: var(--font-mono);
}

.convert-arrow-h {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

/* XPath Flow */
.help-xpath-flow {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

.xpath-flow-step {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
    text-align: center;
}

.xpath-flow-step .xpath-flow-num {
    width: 22px;
    height: 22px;
    background: #6366f1 !important;
    color: #ffffff !important;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.7rem;
    margin-bottom: var(--space-xs);
    font-size: 0.8rem;
    margin-bottom: var(--space-xs);
}

.xpath-flow-title {
    font-weight: 500;
    font-size: 0.7rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.xpath-flow-mockup {
    background: var(--bg-tertiary);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
}

.xpath-flow-arrow {
    color: var(--accent-primary);
    align-self: center;
    padding-top: 20px;
}

.xpath-flow-arrow svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent-primary);
}

.mock-notification {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
}

.mock-notification code {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.6rem;
    word-break: break-all;
}

.mock-chat-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    padding: var(--space-sm);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Query Grid */
.help-query-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.help-query-card {
    background: var(--bg-tertiary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
}

.query-type {
    font-weight: 600;
    font-size: 0.7rem;
    margin-bottom: var(--space-xs);
    color: #6366f1;
}

.help-query-card code {
    display: block;
    font-size: 0.65rem;
    padding: var(--space-xs);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
}

/* Hoot Section */
/* Removed duplicate - see main .help-hoot-intro below */

.owl-demo {
    width: 80px;
    height: 80px;
    position: relative;
}

.owl-demo .owl-ears {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
}

.owl-demo .ear {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 15px solid #8b6914;
}

.owl-demo .owl-face {
    width: 60px;
    height: 50px;
    background: linear-gradient(180deg, #c4a35a 0%, #8b6914 100%);
    border-radius: 50% 50% 45% 45%;
    margin: 0 auto;
    position: relative;
}

.owl-demo .owl-eyes {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 10px;
}

.owl-demo .eye {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.owl-demo .pupil {
    width: 8px;
    height: 8px;
    background: #1a1a1a;
    border-radius: 50%;
}

.owl-demo .owl-beak {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 10px solid #ff9800;
    margin: 5px auto 0;
}

.hoot-intro-text {
    flex: 1;
    min-width: 250px;
}

.hoot-intro-text ul {
    margin: var(--space-sm) 0 0;
    padding-left: var(--space-lg);
    font-size: 0.8rem;
}

.hoot-intro-text li {
    margin-bottom: var(--space-xs);
}

/* Hoot Capabilities */
.hoot-capability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.hoot-capability {
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.capability-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: var(--space-xs);
}

.hoot-capability strong {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.8rem;
}

.hoot-capability p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

/* Upgrade Prompt Mock */
.help-hoot-upgrade {
    margin-top: var(--space-lg);
}

.mock-upgrade-prompt {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 400px;
}

.upgrade-header {
    background: var(--accent-gradient-soft);
    padding: var(--space-sm) var(--space-md);
    font-weight: 600;
}

.upgrade-body {
    padding: var(--space-md);
}

.upgrade-body p {
    font-size: 0.8rem;
    margin-bottom: var(--space-md);
}

.upgrade-buttons {
    display: flex;
    gap: var(--space-sm);
}

.mock-btn {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.mock-btn.primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
}

/* Bug Report */
.help-bug-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.bug-step {
    display: flex;
    gap: var(--space-md);
}

.bug-step-num {
    width: 40px;
    height: 40px;
    background: var(--error-bg);
    color: var(--error);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.bug-step-content h4 {
    margin: 0 0 var(--space-xs);
}

.bug-step-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.mock-bug-button {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--error-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-top: var(--space-sm);
}

.help-contact {
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.help-contact h4 {
    margin: 0 0 var(--space-sm);
}

.help-contact p {
    margin: var(--space-xs) 0;
    font-size: 0.8rem;
}

.help-contact a {
    color: var(--accent-primary);
}

.help-tip {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
}

.help-how-to {
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
}

.help-how-to h4 {
    margin: 0 0 var(--space-md);
}

.mock-dropdown {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    margin-top: var(--space-xs);
}

.mock-dropdown select {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
}

/* ============================================
   Professional Help Modal Styles
   ============================================ */

/* Section Headers with SVG icons */
.help-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.help-section-header svg {
    stroke: var(--accent-primary);
    flex-shrink: 0;
}

.help-section-header h3 {
    margin: 0;
    font-size: 1rem;
}

/* Ensure all help modal SVG icons are visible */
.help-modal-body svg {
    stroke: currentColor;
}

.help-view-header svg,
.help-repair-header svg,
/* XPath flow numbers - consolidated */
.xpath-flow-num {
    width: 24px;
    height: 24px;
    background: #6366f1 !important;
    color: #ffffff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

/* Mini Owl Mascot for Help Pages */
.help-hero-mascot .owl-mascot,
.help-hoot-mascot .owl-mascot {
    transform: scale(0.8);
    transform-origin: top center;
}

.help-hero-mascot,
.help-hoot-mascot {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

/* Feature Icons */
.help-feature-icon svg {
    color: var(--accent-primary);
}

/* Actual Button Display */
.help-actual-btn {
    margin-top: var(--space-md);
}

.help-actual-btn button {
    pointer-events: none;
    opacity: 0.9;
}

/* Repair Description */
.help-repair-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* Simple Convert Layout */
.help-convert-simple {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.convert-format-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
}

.convert-format-card {
    background: var(--accent-primary);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    text-align: center;
}

.convert-format-card code {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.convert-arrows-icon {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0 2px;
}

.convert-arrow-h {
    color: var(--accent-primary);
    display: flex;
    align-items: center;
}

.convert-arrow-h svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-primary);
}

/* Professional conversion styles */
.convert-description {
    text-align: center;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.convert-format-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.format-name {
    background: #6366f1;
    color: #ffffff !important;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

.format-arrow {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.help-convert-example {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.convert-before,
.convert-after {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    min-width: 120px;
}

.convert-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.convert-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
    margin: 0;
    white-space: pre;
}

.convert-arrow-text {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.help-tip-text {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-md);
    margin-bottom: 0;
}

/* XPath Flow */
.mock-tree-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.mock-xpath-btn {
    opacity: 1 !important;
    background: #6366f1 !important;
    border-color: #6366f1 !important;
}

.mock-xpath-btn svg {
    stroke: #ffffff !important;
}

.xpath-code-display {
    display: block;
    background: var(--bg-primary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    word-break: break-all;
    border: 1px solid var(--border-light);
}

.mock-chat-input-box {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Hoot Section */
.help-hoot-intro {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.help-hoot-text h4 {
    margin: 0 0 var(--space-sm);
    color: var(--text-primary);
}

.help-hoot-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Safety Features */
.help-safety-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.safety-feature {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--success);
}

.safety-feature svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: var(--success) !important;
}

/* Light mode fix for safety feature icons */
[data-theme="light"] .safety-feature svg {
    stroke: #16a34a !important;
}

.safety-feature strong {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 2px;
}

.safety-feature p {
    margin: 0;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* Example Questions */
.help-hoot-examples h4 {
    margin-bottom: var(--space-sm);
}

.example-questions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.example-questions code {
    background: var(--bg-tertiary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
}

/* Bug Report Simple */
.help-bug-simple {
    max-width: 500px;
}

.bug-report-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

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

.bug-step-icon {
    flex-shrink: 0;
    color: var(--text-secondary);
}

.bug-step-icon svg {
    width: 24px;
    height: 24px;
}

.mock-btn-display {
    pointer-events: none;
}

.bug-step-text {
    font-size: 0.85rem;
}

.bug-step-text strong {
    color: var(--text-primary);
}

.bug-step-text a {
    color: var(--accent-primary);
}

.bug-step-arrow {
    display: flex;
    justify-content: center;
    padding-left: 6px;
    color: var(--text-tertiary);
}

/* Bug Icon Demo */
.bug-icon-demo {
    display: flex;
    gap: var(--space-lg);
    margin: var(--space-md) 0;
    justify-content: center;
}

.bug-demo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.bug-demo-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.bug-demo-item .header-action-btn {
    position: relative;
}

.bug-demo-item .bug-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    background: var(--text-tertiary);
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bug-demo-item .has-errors {
    border-color: var(--error) !important;
    color: var(--error) !important;
}

.bug-demo-item .has-errors svg {
    stroke: var(--error);
}

.bug-demo-item .has-errors .bug-count {
    background: var(--error);
}

.bug-instruction {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: var(--space-sm) 0;
}

.bug-email-link {
    display: inline-block;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none;
    padding: var(--space-sm) var(--space-xl);
    background: #6366f1 !important;
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
    transition: var(--transition-base);
}

.bug-email-link:hover {
    background: #4f46e5 !important;
    transform: translateY(-2px);
}

.help-bug-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Help Tip improved */
.help-tip {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.help-tip svg {
    color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 2px;
}
