/* ==========================================================================
   TESTRUNNER - Test Automation & CI/CD Testing Platform
   Terminal-inspired, developer-focused design
   ========================================================================== */

/* ==========================================================================
   DESIGN TOKENS
   ========================================================================== */

:root {
    /* Color System - GitHub-inspired dark palette */
    --color-bg-canvas: #0d1117;
    --color-bg-default: #161b22;
    --color-bg-subtle: #1c2128;
    --color-bg-muted: #21262d;
    --color-bg-emphasis: #30363d;

    --color-border-default: #30363d;
    --color-border-muted: #21262d;
    --color-border-subtle: #1c2128;

    /* Text Colors */
    --color-text-primary: #f0f6fc;
    --color-text-secondary: #8b949e;
    --color-text-muted: #6e7681;
    --color-text-link: #58a6ff;

    /* Status Colors */
    --color-success: #3fb950;
    --color-success-subtle: rgba(63, 185, 80, 0.15);
    --color-success-muted: #238636;

    --color-danger: #f85149;
    --color-danger-subtle: rgba(248, 81, 73, 0.15);
    --color-danger-muted: #da3633;

    --color-warning: #d29922;
    --color-warning-subtle: rgba(210, 153, 34, 0.15);
    --color-warning-muted: #bb8009;

    --color-info: #58a6ff;
    --color-info-subtle: rgba(88, 166, 255, 0.15);
    --color-info-muted: #1f6feb;

    --color-purple: #a371f7;
    --color-purple-subtle: rgba(163, 113, 247, 0.15);

    /* Accent - Terminal Green */
    --color-accent: #39d353;
    --color-accent-subtle: rgba(57, 211, 83, 0.15);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;
    --text-hero: clamp(2.5rem, 6vw, 4.5rem);

    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-green: 0 0 20px rgba(63, 185, 80, 0.3);
    --shadow-glow-blue: 0 0 20px rgba(88, 166, 255, 0.3);
    --shadow-glow-red: 0 0 20px rgba(248, 81, 73, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --transition-slower: 500ms ease;

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-tooltip: 500;
}

/* Light mode overrides */
[data-theme="light"] {
    --color-bg-canvas: #ffffff;
    --color-bg-default: #f6f8fa;
    --color-bg-subtle: #f0f2f4;
    --color-bg-muted: #eaeef2;
    --color-bg-emphasis: #d8dee4;

    --color-border-default: #d0d7de;
    --color-border-muted: #d8dee4;
    --color-border-subtle: #eaeef2;

    --color-text-primary: #1f2328;
    --color-text-secondary: #656d76;
    --color-text-muted: #8c959f;
    --color-text-link: #0969da;

    --color-success: #1a7f37;
    --color-success-subtle: rgba(26, 127, 55, 0.1);

    --color-danger: #cf222e;
    --color-danger-subtle: rgba(207, 34, 46, 0.1);

    --color-warning: #9a6700;
    --color-warning-subtle: rgba(154, 103, 0, 0.1);

    --color-info: #0969da;
    --color-info-subtle: rgba(9, 105, 218, 0.1);

    --color-accent: #1a7f37;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-canvas);
}

/* Selection */
::selection {
    background-color: var(--color-accent);
    color: var(--color-bg-canvas);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--color-accent);
    color: var(--color-bg-canvas);
    font-weight: 600;
    border-radius: var(--radius-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-4);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin: 0;
    color: var(--color-text-secondary);
}

a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent);
}

.text-mono {
    font-family: var(--font-mono);
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-success), var(--color-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-lg {
    max-width: 1440px;
}

.container-sm {
    max-width: 960px;
}

.section {
    padding: var(--space-20) 0;
}

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

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-default);
}

[data-theme="light"] .nav {
    background: rgba(255, 255, 255, 0.8);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text-primary);
}

.nav-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-success);
    border-radius: var(--radius-md);
}

.nav-logo-icon svg {
    width: 20px;
    height: 20px;
    color: var(--color-bg-canvas);
}

.nav-links {
    display: none;
    align-items: center;
    gap: var(--space-1);
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }
}

.nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-subtle);
}

.nav-link.active {
    color: var(--color-accent);
}

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

.nav-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-mobile-toggle:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
}

@media (min-width: 1024px) {
    .nav-mobile-toggle {
        display: none;
    }
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-canvas);
    padding: var(--space-6);
    display: none;
    flex-direction: column;
    gap: var(--space-2);
    z-index: var(--z-overlay);
    overflow-y: auto;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu-link {
    display: block;
    padding: var(--space-4);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.mobile-menu-link:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--color-success);
    color: var(--color-bg-canvas);
    border-color: var(--color-success);
}

.btn-primary:hover {
    background: var(--color-success-muted);
    border-color: var(--color-success-muted);
    color: white;
    box-shadow: var(--shadow-glow-green);
}

.btn-secondary {
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
    border-color: var(--color-border-default);
}

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

.btn-outline {
    background: transparent;
    color: var(--color-text-primary);
    border-color: var(--color-border-default);
}

.btn-outline:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-text-muted);
}

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

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

.btn-danger {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.btn-danger:hover {
    background: var(--color-danger-muted);
    box-shadow: var(--shadow-glow-red);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
}

.btn-icon-sm {
    width: 32px;
    height: 32px;
    padding: 0;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

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

.card:hover {
    border-color: var(--color-border-muted);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--color-border-default);
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-5);
    border-top: 1px solid var(--color-border-default);
    background: var(--color-bg-subtle);
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
}

.badge-success {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.badge-danger {
    background: var(--color-danger-subtle);
    color: var(--color-danger);
}

.badge-warning {
    background: var(--color-warning-subtle);
    color: var(--color-warning);
}

.badge-info {
    background: var(--color-info-subtle);
    color: var(--color-info);
}

.badge-muted {
    background: var(--color-bg-muted);
    color: var(--color-text-muted);
}

.badge-purple {
    background: var(--color-purple-subtle);
    color: var(--color-purple);
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.status-dot-success {
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot-danger {
    background: var(--color-danger);
    box-shadow: 0 0 8px var(--color-danger);
}

.status-dot-warning {
    background: var(--color-warning);
    box-shadow: 0 0 8px var(--color-warning);
}

.status-dot-info {
    background: var(--color-info);
    box-shadow: 0 0 8px var(--color-info);
}

.status-dot-pending {
    background: var(--color-text-muted);
    animation: pulse 2s ease-in-out infinite;
}

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

/* ==========================================================================
   TERMINAL / CODE BLOCKS
   ========================================================================== */

.terminal {
    background: var(--color-bg-canvas);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-family: var(--font-mono);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border-default);
}

.terminal-dots {
    display: flex;
    gap: var(--space-2);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.terminal-dot-red { background: #ff5f56; }
.terminal-dot-yellow { background: #ffbd2e; }
.terminal-dot-green { background: #27c93f; }

.terminal-title {
    flex: 1;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.terminal-body {
    padding: var(--space-4);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    overflow-x: auto;
}

.terminal-line {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

.terminal-prompt {
    color: var(--color-success);
    user-select: none;
}

.terminal-command {
    color: var(--color-text-primary);
}

.terminal-output {
    color: var(--color-text-secondary);
    padding-left: calc(var(--space-4) + 2ch);
}

.terminal-success {
    color: var(--color-success);
}

.terminal-error {
    color: var(--color-danger);
}

.terminal-warning {
    color: var(--color-warning);
}

/* Code syntax highlighting */
.code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    background: var(--color-bg-subtle);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.code-block {
    display: block;
    padding: var(--space-4);
    overflow-x: auto;
}

.code-keyword { color: #ff7b72; }
.code-string { color: #a5d6ff; }
.code-number { color: #79c0ff; }
.code-comment { color: #8b949e; }
.code-function { color: #d2a8ff; }
.code-variable { color: #ffa657; }
.code-operator { color: #ff7b72; }

/* ==========================================================================
   TEST RESULT TREE
   ========================================================================== */

.test-tree {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.test-tree-item {
    border-left: 2px solid var(--color-border-default);
    margin-left: var(--space-4);
    padding-left: var(--space-4);
}

.test-tree-item:first-child {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

.test-tree-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.test-tree-header:hover {
    background: var(--color-bg-subtle);
    margin: 0 calc(-1 * var(--space-3));
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
}

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

.test-tree-icon-pass {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.test-tree-icon-fail {
    background: var(--color-danger-subtle);
    color: var(--color-danger);
}

.test-tree-icon-skip {
    background: var(--color-warning-subtle);
    color: var(--color-warning);
}

.test-tree-icon-pending {
    background: var(--color-bg-muted);
    color: var(--color-text-muted);
}

.test-tree-name {
    flex: 1;
    color: var(--color-text-primary);
}

.test-tree-duration {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
}

.test-tree-expand {
    color: var(--color-text-muted);
    transition: transform var(--transition-fast);
}

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

.test-tree-children {
    display: none;
    padding-top: var(--space-2);
}

.test-tree-children.expanded {
    display: block;
}

.test-tree-error {
    margin: var(--space-3) 0;
    padding: var(--space-3);
    background: var(--color-danger-subtle);
    border-left: 3px solid var(--color-danger);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--color-danger);
    white-space: pre-wrap;
    overflow-x: auto;
}

/* ==========================================================================
   PROGRESS RINGS
   ========================================================================== */

.progress-ring {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-ring-svg {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--color-bg-emphasis);
    stroke-width: 8;
}

.progress-ring-progress {
    fill: none;
    stroke: var(--color-success);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.progress-ring-progress-fail {
    stroke: var(--color-danger);
}

.progress-ring-content {
    position: absolute;
    text-align: center;
}

.progress-ring-value {
    font-family: var(--font-mono);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

.progress-ring-label {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ==========================================================================
   STATS GRID
   ========================================================================== */

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

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-base);
}

.stat-card:hover {
    border-color: var(--color-border-muted);
    transform: translateY(-2px);
}

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

.stat-icon-success {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.stat-icon-danger {
    background: var(--color-danger-subtle);
    color: var(--color-danger);
}

.stat-icon-warning {
    background: var(--color-warning-subtle);
    color: var(--color-warning);
}

.stat-icon-info {
    background: var(--color-info-subtle);
    color: var(--color-info);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
}

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

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
}

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

.stat-trend-down {
    color: var(--color-danger);
}

/* ==========================================================================
   COVERAGE HEATMAP
   ========================================================================== */

.heatmap {
    display: grid;
    gap: 2px;
    font-family: var(--font-mono);
}

.heatmap-row {
    display: flex;
    gap: 2px;
}

.heatmap-cell {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    transition: transform var(--transition-fast);
}

.heatmap-cell:hover {
    transform: scale(1.3);
    z-index: 1;
}

.heatmap-level-0 { background: var(--color-bg-emphasis); }
.heatmap-level-1 { background: rgba(63, 185, 80, 0.25); }
.heatmap-level-2 { background: rgba(63, 185, 80, 0.4); }
.heatmap-level-3 { background: rgba(63, 185, 80, 0.6); }
.heatmap-level-4 { background: var(--color-success); }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* ==========================================================================
   TEST RUN TABLE
   ========================================================================== */

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border-default);
    white-space: nowrap;
}

.table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border-default);
    color: var(--color-text-primary);
}

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

.table tr:hover td {
    background: var(--color-bg-subtle);
}

.table-mono {
    font-family: var(--font-mono);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 64px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(63, 185, 80, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(88, 166, 255, 0.1), transparent);
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(48, 54, 61, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(48, 54, 61, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black, transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-8);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--color-success);
    border-radius: var(--radius-full);
    animation: pulse 2s ease-in-out infinite;
}

.hero-title {
    font-size: var(--text-hero);
    font-weight: 800;
    letter-spacing: var(--tracking-tight);
    margin-bottom: var(--space-6);
}

.hero-title-accent {
    color: var(--color-success);
}

.hero-description {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-10);
    line-height: var(--leading-relaxed);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
}

@media (min-width: 640px) {
    .hero-actions {
        flex-direction: row;
        justify-content: center;
    }
}

.hero-terminal {
    margin-top: var(--space-16);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* ==========================================================================
   FEATURE SECTIONS
   ========================================================================== */

.feature-grid {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-card {
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--color-success);
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-4px);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--color-success-subtle);
    color: var(--color-success);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
}

.feature-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-3);
}

.feature-description {
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

/* ==========================================================================
   PRICING
   ========================================================================== */

.pricing-grid {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pricing-card {
    position: relative;
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    transition: all var(--transition-base);
}

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

.pricing-card-popular {
    border-color: var(--color-success);
    box-shadow: var(--shadow-glow-green);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-1) var(--space-4);
    background: var(--color-success);
    color: var(--color-bg-canvas);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    border-radius: var(--radius-full);
}

.pricing-name {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
}

.pricing-amount {
    font-family: var(--font-mono);
    font-size: var(--text-4xl);
    font-weight: 700;
}

.pricing-period {
    color: var(--color-text-muted);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-8);
}

.pricing-feature {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    color: var(--color-text-secondary);
}

.pricing-feature-icon {
    flex-shrink: 0;
    color: var(--color-success);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    background: var(--color-bg-default);
    border-top: 1px solid var(--color-border-default);
    padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
    display: grid;
    gap: var(--space-12);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr repeat(3, 1fr);
    }
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

.footer-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
    line-height: var(--leading-relaxed);
}

.footer-social {
    display: flex;
    gap: var(--space-3);
}

.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.footer-social-link:hover {
    background: var(--color-bg-muted);
    color: var(--color-text-primary);
    border-color: var(--color-border-muted);
}

.footer-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link {
    display: block;
    padding: var(--space-2) 0;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-text-primary);
}

.footer-bottom {
    margin-top: var(--space-12);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border-default);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-copyright {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.footer-legal {
    display: flex;
    gap: var(--space-6);
}

.footer-legal-link {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.footer-legal-link:hover {
    color: var(--color-text-primary);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* Typing animation */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

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

.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(30) forwards;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--color-success);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

/* Counter animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glow pulse */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px var(--color-success); }
    50% { box-shadow: 0 0 40px var(--color-success); }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-success);
    box-shadow: 0 0 0 3px var(--color-success-subtle);
}

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

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238b949e' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: var(--space-10);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.form-checkbox-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-success);
}

/* ==========================================================================
   INTEGRATION CARDS
   ========================================================================== */

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

@media (min-width: 768px) {
    .integration-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .integration-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.integration-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.integration-card:hover {
    border-color: var(--color-success);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-green);
}

.integration-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.integration-icon img {
    max-width: 100%;
    max-height: 100%;
}

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

/* ==========================================================================
   DOCUMENTATION
   ========================================================================== */

.docs-layout {
    display: grid;
    gap: var(--space-8);
}

@media (min-width: 1024px) {
    .docs-layout {
        grid-template-columns: 260px 1fr;
    }
}

.docs-sidebar {
    position: sticky;
    top: calc(64px + var(--space-8));
    height: fit-content;
}

.docs-nav {
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.docs-nav-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.docs-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-nav-link {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.docs-nav-link:hover {
    background: var(--color-bg-subtle);
    color: var(--color-text-primary);
}

.docs-nav-link.active {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.docs-content {
    min-width: 0;
}

.docs-content h2 {
    margin-top: var(--space-12);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-default);
}

.docs-content h2:first-child {
    margin-top: 0;
}

.docs-content h3 {
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
}

.docs-content p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

.docs-content ul,
.docs-content ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
    color: var(--color-text-secondary);
}

.docs-content li {
    margin-bottom: var(--space-2);
}

/* ==========================================================================
   BLOG
   ========================================================================== */

.blog-grid {
    display: grid;
    gap: var(--space-8);
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-card {
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.blog-card:hover {
    border-color: var(--color-border-muted);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.blog-card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: var(--space-6);
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.blog-card-category {
    color: var(--color-success);
    font-weight: 600;
}

.blog-card-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
    line-height: var(--leading-snug);
}

.blog-card-title a {
    color: var(--color-text-primary);
}

.blog-card-title a:hover {
    color: var(--color-success);
}

.blog-card-excerpt {
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   RUN TIMELINE
   ========================================================================== */

.run-timeline {
    position: relative;
    padding-left: var(--space-8);
}

.run-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border-default);
}

.run-timeline-item {
    position: relative;
    padding-bottom: var(--space-8);
}

.run-timeline-item:last-child {
    padding-bottom: 0;
}

.run-timeline-dot {
    position: absolute;
    left: calc(-1 * var(--space-8) + 8px);
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-bg-canvas);
}

.run-timeline-dot-success {
    background: var(--color-success);
    box-shadow: 0 0 0 4px var(--color-success-subtle);
}

.run-timeline-dot-fail {
    background: var(--color-danger);
    box-shadow: 0 0 0 4px var(--color-danger-subtle);
}

.run-timeline-dot-running {
    background: var(--color-info);
    box-shadow: 0 0 0 4px var(--color-info-subtle);
    animation: pulse 2s ease-in-out infinite;
}

.run-timeline-content {
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.run-timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.run-timeline-title {
    font-family: var(--font-mono);
    font-weight: 600;
}

.run-timeline-time {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.run-timeline-stats {
    display: flex;
    gap: var(--space-4);
    font-size: var(--text-sm);
}

.run-timeline-stat {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.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;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }

.hidden { display: none; }

.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.pt-4 { padding-top: var(--space-4); }
.pt-8 { padding-top: var(--space-8); }
.pb-4 { padding-bottom: var(--space-4); }
.pb-8 { padding-bottom: var(--space-8); }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.border { border: 1px solid var(--color-border-default); }
.border-t { border-top: 1px solid var(--color-border-default); }
.border-b { border-bottom: 1px solid var(--color-border-default); }

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .nav,
    .footer,
    .btn,
    .mobile-menu {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .terminal {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}
