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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
    /* Fix for sticky header occlusion */
}

:root {
    /* --- Monokai Pro Brown (Ristretto) - Dark Theme --- */
    --bg-body: #2c2525;
    /* Main Background: Warm Deep Brown */
    --bg-layer-1: #2c2525;
    /* Alias for body */
    --bg-layer-2: #403838;
    /* Sidebar/Cards: Lighter Brown */
    --bg-surface: #403838;
    /* Semantic Alias */
    --bg-navbar: rgba(44, 37, 37, 0.95);
    /* Glassy Navbar */

    /* Glass Effects (Adjusted for Brown base) */
    --glass-surface: rgba(255, 241, 243, 0.03);
    --glass-border: rgba(255, 241, 243, 0.1);
    --glass-highlight: rgba(255, 241, 243, 0.05);

    /* Typography */
    --text-primary: #fff1f3;
    /* Warm White */
    --text-secondary: #ffd866;
    /* Monokai Yellow (Warmth) */
    --text-tertiary: #ab9df2;
    /* Monokai Purple (Muted) */

    /* Monokai Accents */
    --accent-primary: #fd971f;
    /* Monokai Orange */
    --accent-secondary: #f92672;
    /* Monokai Pink */
    --accent-glow: rgba(253, 151, 31, 0.3);

    /* Status */
    --success: #a6e22e;
    /* Monokai Green */
    --success-glow: rgba(166, 226, 46, 0.2);
    --warning: #fd971f;
    /* Orange as Warning */
    --danger: #f92672;
    /* Pink as Danger */

    /* Metrics */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Theme Specifics */
    --bg-glass-input: rgba(255, 255, 255, 0.05);
    --bg-glass-input-hover: rgba(255, 255, 255, 0.1);

    /* Sidebar (Dark default) */
    --sidebar-bg: rgba(10, 10, 12, 0.6);
    --sidebar-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    --sidebar-link-color: var(--text-secondary);
    --sidebar-link-hover-bg: var(--glass-surface);
    --sidebar-active-bg: rgba(99, 102, 241, 0.1);
    --sidebar-active-color: var(--accent-primary);
    --sidebar-active-border: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] {
    /* --- GitHub Light - Light Theme --- */
    --bg-body: #ffffff;
    --bg-layer-1: #f6f8fa;
    /* Sidebar / Muted Backgrounds */
    --bg-layer-2: #eaeef2;
    /* Borders / Inputs */
    --bg-surface: #f6f8fa;
    --bg-navbar: rgba(255, 255, 255, 0.98);

    /* Light Theme Glass (Minimal) */
    --glass-surface: #ffffff;
    --glass-border: #d0d7de;
    --glass-highlight: rgba(0, 0, 0, 0.05);

    /* Typography */
    --text-primary: #24292f;
    /* Ink 900 */
    --text-secondary: #57606a;
    /* Ink 600 */
    --text-tertiary: #8c959f;
    /* Ink 400 */

    /* Accents */
    --accent-primary: #0969da;
    /* GitHub Blue */
    --accent-secondary: #cf222e;
    /* GitHub Red */
    --accent-glow: rgba(9, 105, 218, 0.15);

    /* Status */
    --success: #1a7f37;
    --success-glow: rgba(26, 127, 55, 0.15);
    --warning: #9a6700;
    --danger: #cf222e;

    /* Inputs */
    --bg-glass-input: #ffffff;
    --bg-glass-input-hover: #f6f8fa;

    /* Sidebar */
    --sidebar-bg: rgba(255, 255, 255, 0.92);
    --sidebar-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ============================================
   LIGHT THEME — Dashboard Overrides
   ============================================ */
[data-theme="light"] body {
    background-image: none;
    background-color: #f0f2f5;
}

[data-theme="light"] .sidebar-nav {
    background: var(--sidebar-bg);
    backdrop-filter: blur(16px);
    border-color: #d0d7de;
    box-shadow: var(--sidebar-shadow);
}

[data-theme="light"] .dash-link {
    color: #24292f;
}

[data-theme="light"] .dash-link:hover {
    background: #eaeef2;
    color: #24292f;
    border-color: #d0d7de;
}

[data-theme="light"] .dash-link.active {
    background: rgba(9, 105, 218, 0.08);
    color: #0969da;
    border-color: rgba(9, 105, 218, 0.25);
    box-shadow: 0 0 12px rgba(9, 105, 218, 0.1);
}

[data-theme="light"] .stat-card,
[data-theme="light"] .card {
    background: #ffffff;
    border-color: #d0d7de;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .stat-card::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);
}

[data-theme="light"] .stat-card:hover,
[data-theme="light"] .card:hover {
    border-color: rgba(9, 105, 218, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .glass-panel {
    background: #ffffff;
    border-color: #d0d7de;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .data-table tr:hover td {
    background: #f6f8fa;
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select {
    background: #ffffff;
    border-color: #d0d7de;
    color: #24292f;
}

[data-theme="light"] .upload-zone,
[data-theme="light"] .upload-area {
    background: #f6f8fa;
    border-color: #d0d7de;
}

[data-theme="light"] .navbar {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chat-window {
    background: #ffffff;
    border-color: #d0d7de;
}

[data-theme="light"] .chat-body {
    background: #f6f8fa;
}

[data-theme="light"] .chat-footer {
    background: #ffffff;
}

[data-theme="light"] .msg-bot {
    background: #eaeef2;
    border-color: #d0d7de;
    color: #24292f;
}

[data-theme="light"] .code-preview {
    background: #f6f8fa;
    border-color: #d0d7de;
}

[data-theme="light"] .code-preview pre {
    color: #24292f;
}

.gradient-text {
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-primary) 50%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* --- Global Reset & Typography --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

body {
    background-color: var(--bg-body);
    /* Deep Void Gradient */
    background-image:
        radial-gradient(circle at 50% -20%, #1e1b4b 0%, transparent 40%),
        radial-gradient(circle at 100% 0%, #312e81 0%, transparent 20%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* --- Fix Browser Autofill for Dark Theme --- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.2) inset !important;
    box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.2) inset !important;
    border: 1px solid var(--border-color) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Light theme autofill */
[data-theme="light"] input:-webkit-autofill,
[data-theme="light"] input:-webkit-autofill:hover,
[data-theme="light"] input:-webkit-autofill:focus,
[data-theme="light"] input:-webkit-autofill:active,
[data-theme="light"] textarea:-webkit-autofill,
[data-theme="light"] textarea:-webkit-autofill:hover,
[data-theme="light"] textarea:-webkit-autofill:focus,
[data-theme="light"] select:-webkit-autofill,
[data-theme="light"] select:-webkit-autofill:hover,
[data-theme="light"] select:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary) !important;
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
    box-shadow: 0 0 0px 1000px #ffffff inset !important;
}

h1,
h2,
h3,
h4,
h5 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* --- Layout Utilities --- */
.dashboard-container {
    min-height: 100vh;
    padding-top: 70px;
    /* Navbar height */
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Components: Glass Panel --- */
.glass-panel {
    background: var(--glass-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
}

/* --- Navigation: Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
    background: var(--bg-navbar);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Public Pages Container */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    max-width: 1200px;
    gap: 0.5rem;
}

/* Dashboard Container (Wider) */
.nav-container-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    max-width: 100%;
    /* Occupy full width minus padding */
}

/* Responsiveness for Navbar */
@media (min-width: 1600px) {
    .nav-container-custom {
        max-width: 1800px;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: var(--text-primary);
}

/* --- Theme Toggle Switch (Global Redesign) --- */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    margin-left: 0.5rem;
}

.theme-toggle-btn {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    /* Circle */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    background: var(--bg-layer-2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--text-secondary);
}

.theme-toggle-btn:active {
    transform: translateY(0px);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    position: absolute;
    transition: all 0.3s ease;
}

/* Icon Switching Logic */
/* Dark Mode: Show Sun (to switch to light) */
[data-theme="dark"] .theme-toggle-btn .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #ffd866;
    /* Monokai Yellow */
}

/* Light Mode: Show Moon (to switch to dark) */
[data-theme="light"] .theme-toggle-btn .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

[data-theme="light"] .theme-toggle-btn .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #0969da;
    /* GitHub Blue */
}



/* --- Language Selector --- */
.lang-selector-wrapper {
    position: relative;
    margin-right: 1.5rem;
}

.lang-selector {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-glass-input);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 0.35rem 2rem 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-selector:hover {
    background: var(--bg-glass-input-hover);
    border-color: var(--text-secondary);
}

[data-theme="dark"] .lang-selector option {
    background-color: #1e293b;
    color: #f8fafc;
}

[data-theme="light"] .lang-selector option {
    background-color: #ffffff;
    color: #0f172a;
}

.lang-selector-wrapper::after {
    content: "▼";
    font-size: 0.5rem;
    color: var(--text-secondary);
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.nav-links {
    flex: 1;
    justify-content: center;
}

.nav-links a {
    margin: 0 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: rgba(253, 151, 31, 0.5);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* --- Navigation: Sidebar --- */
.sidebar-nav {
    width: 250px;
    position: fixed;
    top: 90px;
    bottom: 20px;
    left: 20px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 900;
    box-shadow: var(--sidebar-shadow);
}

.dash-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.dash-link:hover {
    background: var(--glass-surface);
    color: var(--text-primary);
    border-color: var(--glass-border);
}

.dash-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 15px var(--accent-glow);
}

.main-view {
    margin-left: 290px;
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1600px;
    /* Reasonable max width for content */
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    box-shadow: 0 4px 15px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

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

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

/* --- Stats Cards (Generic & Landing) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card,
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0.5;
}

.stat-card:hover,
.card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.stat-card h4 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.trend {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    gap: 0.25rem;
}

.trend.up {
    color: var(--success);
}

.card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.red-icon {
    color: var(--danger);
}

/* --- Tables --- */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-primary);
}

/* --- Badges --- */
.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-processing {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- LANDING PAGE: Hero & Sections --- */
.hero {
    position: relative;
    padding: 10rem 0 6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    text-align: center;
    overflow: hidden;
}

.glow-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, rgba(10, 10, 12, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-title {
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    padding: 1.5rem 3rem;
    gap: 2rem;
    background: var(--glass-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

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

.stat-item .stat-value {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.stat-item .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--glass-border);
}

.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

[data-theme="light"] .hero-title,
[data-theme="light"] .section-header h2 {
    color: #020617;
    /* Very Dark Slate */
    font-weight: 800;
}

[data-theme="light"] .hero-subtitle,
[data-theme="light"] .section-header p {
    color: #334155;
    /* Dark Slate Gray */
    font-weight: 600;
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* --- LANDING PAGE: Pipeline --- */
.pipeline-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.step-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

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

.tech-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(125, 125, 125, 0.1);
    font-size: 0.75rem;
    margin-top: 1rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.pipeline-connector {
    color: var(--text-tertiary);
    font-size: 1.5rem;
    opacity: 0.5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pipeline-connector::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    background-size: 200% 100%;
    animation: flow-line 2s linear infinite;
}

@keyframes flow-line {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(20px);
    }
}

.pipeline-step {
    flex: 1;
    min-width: 250px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pipeline-step:hover {
    transform: translateY(-5px) scale(1.02);
}

.step-content {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
}

.step-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.05),
            transparent);
    transition: 0.5s;
}

.step-step:hover .step-content::before {
    left: 100%;
}

.active-step .step-content {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {

    0%,
    100% {
        border-color: var(--accent-primary);
    }

    50% {
        border-color: var(--accent-secondary);
    }
}

.step-marker {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    display: inline-block;
    padding: 2px 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
}

/* --- LANDING PAGE: Output & Pricing --- */
.output-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.feature-list {
    list-style: none;
    margin-top: 2rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.feature-list i {
    color: var(--accent-primary);
}

.code-preview {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 1.5rem;
    background: #0d0d10;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

pre {
    color: #e2e8f0;
    overflow-x: auto;
}

.capture-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.capture-form {
    margin-top: 2rem;
    padding: 2rem;
    text-align: left;
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* --- Forms & Upload --- */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
}

.upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 3rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    background: rgba(125, 125, 125, 0.05);
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

.upload-area i {
    display: block;
    margin: 0 auto 0.5rem;
    width: 24px;
    height: 24px;
}

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: var(--glass-border);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    cursor: pointer;
}

/* --- Footer --- */
.footer {
    padding: 4rem 0;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.links {
    display: flex;
    gap: 2rem;
}

.links a:hover {
    color: var(--text-primary);
}

/* --- Chat Widget --- */
.chat-widget-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    font-family: var(--font-sans);
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--accent-glow);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle-btn:hover {
    transform: scale(1.05);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #13131a;
    /* Solid dark for readability */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-window.open {
    display: flex;
    animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-header {
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    padding: 1rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-layer-1);
}

.chat-msg {
    max-width: 80%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.msg-bot {
    background: var(--bg-layer-2);
    border: 1px solid var(--glass-border);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.msg-user {
    background: var(--accent-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-footer {
    padding: 1rem;
    background: var(--bg-layer-2);
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.chat-input {
    flex: 1;
    background: var(--bg-layer-1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
}

.chat-send {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    /* Navbar */
    .nav-links {
        display: none !important;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    /* Hide links for MVP, can add hamburger later if needed */
    .nav-container {
        padding: 0 1rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    /* Layout */
    .sidebar-nav {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 1100;
        background: var(--bg-layer-2);
    }

    .sidebar-nav.active {
        transform: translateX(0);
    }

    .main-view {
        margin-left: 0;
        padding: 1.5rem 1rem;
    }

    /* Typography */
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    /* Grids & Cards */
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .output-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-stats {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
        width: 100%;
    }

    .stat-divider {
        width: 100%;
        height: 1px;
    }

    /* Pipeline */
    .pipeline-flow {
        flex-direction: column;
        align-items: stretch;
    }

    .pipeline-connector {
        transform: rotate(90deg);
        margin: 0.5rem auto;
    }

    .pipeline-step {
        min-width: 0;
    }

    /* Chat Widget */
    .chat-window {
        width: calc(100vw - 2rem);
        bottom: 90px;
        right: 1rem;
    }
}

/* Ensure data tables scroll on mobile */
@media (max-width: 1024px) {
    .glass-panel {
        overflow-x: auto;
    }

    .data-table {
        min-width: 700px;
    }

    /* Force width to trigger scroll */
}

/* Progress Bar Styles */
.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    margin-top: 0.25rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    width: 0%;
    transition: width 0.5s ease-out;
    border-radius: 3px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(-45deg,
            rgba(255, 255, 255, 0.2) 25%,
            transparent 25%,
            transparent 50%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: move-stripes 1s linear infinite;
    z-index: 1;
}

@keyframes move-stripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 20px;
    }
}

/* --- Added Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered Delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-2px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(2px);
    }
}

.shake-alert {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.notif-item.unread {
    background: rgba(99, 102, 241, 0.05);
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

textarea,
.font-mono {
    font-family: 'JetBrains Mono', monospace !important;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

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

/* --- Support Widget --- */
#support-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

/* --- Cockpit Header Utility --- */
.page-header {
    text-align: left;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* --- Admin Console Toggle --- */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-layer-2);
    transition: .3s;
    border: 1px solid var(--border-color);
}

.slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-tertiary);
    transition: .3s;
    border-radius: 2px;
    /* Rectangular-ish */
}

input:checked+.slider {
    background-color: rgba(39, 201, 63, 0.2);
    border-color: #27c93f;
}

input:checked+.slider::before {
    transform: translateX(22px);
    background-color: #27c93f;
}

/* Rectangular Style for Admin Look */
.slider.round {
    border-radius: 4px;
}

.slider.round:before {
    border-radius: 2px;
}

/* Scroll Offset Fix */
html {
    scroll-padding-top: 90px;
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

/* Base state for reveal elements */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Revealed state */
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade in from left with bounce */
.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade in from right with bounce */
.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up reveal with elastic bounce */
.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered children animation with improved timing */
.stagger-children .reveal-child {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.visible .reveal-child:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-children.visible .reveal-child:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-children.visible .reveal-child:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-children.visible .reveal-child:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger-children.visible .reveal-child:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger-children.visible .reveal-child:nth-child(6) {
    transition-delay: 0.6s;
}

.stagger-children.visible .reveal-child {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Hero-specific entrance with dramatic effect */
.hero-reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    animation: heroReveal 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.2s;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Fade and slide up with rotation */
.reveal-rotate {
    opacity: 0;
    transform: translateY(40px) rotate(-2deg);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-rotate.visible {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* Blur reveal effect */
.reveal-blur {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(30px);
    transition: opacity 0.8s ease-out,
        filter 0.8s ease-out,
        transform 0.8s ease-out;
}

.reveal-blur.visible {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Card hover micro-interaction enhancement */
.reveal.visible .card,
.reveal.visible .glass-panel,
.reveal.visible .pipeline-step {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

/* Pulse animation for important elements */
@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
    }
}

.reveal-pulse.visible {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale,
    .reveal-rotate,
    .reveal-blur,
    .stagger-children .reveal-child,
    .hero-reveal {
        transition: none;
        animation: none;
        opacity: 1;
        transform: none;
        filter: none;
    }
}