/**
 * ============================================
 * FLOWBOT DCI v4.0 - PROFESSIONAL DASHBOARD
 * Complete UI Redesign: 78+ Progress Bars
 * ============================================
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Background Colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;
    --bg-card-hover: #252b33;

    /* Text Colors */
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    --text-muted: #484f58;

    /* Border Colors */
    --border-primary: #30363d;
    --border-secondary: #21262d;

    /* Progress Bar Colors - Core */
    --bar-processed: linear-gradient(90deg, #3B82F6, #60A5FA);
    --bar-imported: linear-gradient(90deg, #10B981, #34D399);
    --bar-ignored: linear-gradient(90deg, #F59E0B, #FBBF24);
    --bar-errors: linear-gradient(90deg, #EF4444, #F87171);

    /* Progress Bar Colors - HTTP Codes */
    --bar-2xx: linear-gradient(90deg, #10B981, #34D399);
    --bar-3xx: linear-gradient(90deg, #3B82F6, #60A5FA);
    --bar-4xx: linear-gradient(90deg, #F59E0B, #FBBF24);
    --bar-5xx: linear-gradient(90deg, #EF4444, #F87171);

    /* Progress Bar Colors - Phases */
    --phase-0: linear-gradient(90deg, #8B5CF6, #A78BFA);
    --phase-1: linear-gradient(90deg, #EC4899, #F472B6);
    --phase-2: linear-gradient(90deg, #06B6D4, #22D3EE);
    --phase-3: linear-gradient(90deg, #F97316, #FB923C);

    /* Status Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;
    --color-purple: #8B5CF6;
    --color-pink: #EC4899;
    --color-cyan: #06B6D4;
    --color-orange: #F97316;

    /* Domain Health */
    --domain-healthy: #10B981;
    --domain-warning: #F59E0B;
    --domain-problematic: #EF4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.3);
    --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.3);

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

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

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes activeGlow {
    0%, 100% { box-shadow: 0 0 5px currentColor, 0 0 10px currentColor; }
    50% { box-shadow: 0 0 15px currentColor, 0 0 25px currentColor; }
}

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

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

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

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

@keyframes progressFill {
    from { width: 0%; }
}

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

@keyframes barGrow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: activeGlow 2s ease-in-out infinite; }
.animate-shimmer { animation: shimmer 2s linear infinite; }

/* ============================================
   NAVIGATION
   ============================================ */
.main-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    height: 60px;
    gap: var(--spacing-lg);
}

.nav-brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-primary);
}

.brand-logo svg {
    width: 32px;
    height: 32px;
}

.brand-text {
    font-size: 18px;
    font-weight: 600;
}

.brand-version {
    font-size: 11px;
    background: var(--color-info);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.nav-main {
    display: flex;
    gap: var(--spacing-md);
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition-fast);
}

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

.nav-icon {
    width: 18px;
    height: 18px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-tertiary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.running .status-dot {
    background: var(--color-success);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.completed .status-dot {
    background: var(--color-success);
}

.status-indicator.paused .status-dot {
    background: var(--color-warning);
}

.status-indicator.initializing .status-dot {
    background: var(--color-info);
    animation: pulse 1s ease-in-out infinite;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.main-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.hero-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.hero-meta {
    display: flex;
    gap: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 14px;
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Main Progress Bar */
.hero-progress {
    margin-bottom: var(--spacing-lg);
}

.hero-progress-bar {
    height: 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.hero-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6, #EC4899);
    border-radius: var(--radius-lg);
    transition: width var(--transition-normal);
    position: relative;
}

.hero-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s linear infinite;
}

.hero-progress-text {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    font-size: 12px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Hero Stats Grid */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.hero-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    transition: var(--transition-fast);
}

.hero-stat:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1.2;
}

.hero-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.hero-stat.success .hero-stat-value { color: var(--color-success); }
.hero-stat.warning .hero-stat-value { color: var(--color-warning); }
.hero-stat.error .hero-stat-value { color: var(--color-error); }
.hero-stat.info .hero-stat-value { color: var(--color-info); }

/* ============================================
   3-COLUMN DASHBOARD GRID
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}

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

/* Column Containers */
.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* ============================================
   CARD / SECTION COMPONENT
   ============================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-fast);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.card-title svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.card-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
}

.card-body {
    padding: var(--spacing-md);
}

/* ============================================
   PROGRESS BAR COMPONENT
   ============================================ */
.progress-item {
    margin-bottom: var(--spacing-sm);
}

.progress-item:last-child {
    margin-bottom: 0;
}

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

.progress-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-value {
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width var(--transition-normal);
    transform-origin: left;
}

/* Progress Fill Colors */
.progress-fill.processed { background: var(--bar-processed); }
.progress-fill.imported { background: var(--bar-imported); }
.progress-fill.ignored { background: var(--bar-ignored); }
.progress-fill.errors { background: var(--bar-errors); }
.progress-fill.success { background: var(--bar-2xx); }
.progress-fill.redirect { background: var(--bar-3xx); }
.progress-fill.client-error { background: var(--bar-4xx); }
.progress-fill.server-error { background: var(--bar-5xx); }
.progress-fill.phase-0 { background: var(--phase-0); }
.progress-fill.phase-1 { background: var(--phase-1); }
.progress-fill.phase-2 { background: var(--phase-2); }
.progress-fill.phase-3 { background: var(--phase-3); }
.progress-fill.blue { background: var(--bar-processed); }
.progress-fill.green { background: var(--bar-imported); }
.progress-fill.yellow { background: var(--bar-ignored); }
.progress-fill.red { background: var(--bar-errors); }
.progress-fill.purple { background: var(--phase-0); }
.progress-fill.pink { background: var(--phase-1); }
.progress-fill.cyan { background: var(--phase-2); }
.progress-fill.orange { background: var(--phase-3); }
.progress-fill.gray { background: linear-gradient(90deg, #6B7280, #9CA3AF); }

/* Large Progress Bars */
.progress-bar.lg {
    height: 12px;
}

/* Mini Progress Bars */
.progress-bar.sm {
    height: 4px;
}

/* ============================================
   PHASE PIPELINE
   ============================================ */
.phase-pipeline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.phase-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: var(--transition-fast);
}

.phase-card.active {
    border-color: var(--color-info);
    box-shadow: var(--shadow-glow-blue);
}

.phase-card.completed {
    border-color: var(--color-success);
}

.phase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.phase-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.phase-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.phase-card[data-phase="0"] .phase-badge { background: var(--phase-0); }
.phase-card[data-phase="1"] .phase-badge { background: var(--phase-1); }
.phase-card[data-phase="2"] .phase-badge { background: var(--phase-2); }
.phase-card[data-phase="3"] .phase-badge { background: var(--phase-3); }

.phase-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.phase-status.active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-info);
}

.phase-status.waiting {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}

.phase-status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

.phase-status.pending {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.phase-stats-row {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
    font-size: 12px;
}

.phase-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.phase-stat.success { color: var(--color-success); }
.phase-stat.retry { color: var(--color-warning); }
.phase-stat.error { color: var(--color-error); }

.phase-config {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
    font-size: 11px;
    color: var(--text-tertiary);
}

/* ============================================
   HTTP CODES GRID
   ============================================ */
.http-codes-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.http-category {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
}

.http-category-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-primary);
}

.http-category.success .http-category-header { color: var(--color-success); }
.http-category.redirect .http-category-header { color: var(--color-info); }
.http-category.client-error .http-category-header { color: var(--color-warning); }
.http-category.server-error .http-category-header { color: var(--color-error); }

.http-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.http-code-badge {
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    min-width: 40px;
    text-align: center;
}

.http-code-badge.success { background: rgba(16, 185, 129, 0.2); color: var(--color-success); }
.http-code-badge.redirect { background: rgba(59, 130, 246, 0.2); color: var(--color-info); }
.http-code-badge.client-error { background: rgba(245, 158, 11, 0.2); color: var(--color-warning); }
.http-code-badge.server-error { background: rgba(239, 68, 68, 0.2); color: var(--color-error); }

.http-code-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.http-code-count {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* ============================================
   DOMAIN HEALTH LIST
   ============================================ */
.domain-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    max-height: 400px;
    overflow-y: auto;
}

.domain-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.domain-item:hover {
    background: var(--bg-card-hover);
}

.domain-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: var(--bg-tertiary);
}

.domain-item.healthy .domain-icon { background: var(--color-success); }
.domain-item.warning .domain-icon { background: var(--color-warning); }
.domain-item.problematic .domain-icon { background: var(--color-error); }

.domain-info {
    flex: 1;
    min-width: 0;
}

.domain-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.domain-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.domain-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
}

.domain-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--transition-normal);
}

.domain-item.healthy .domain-bar-fill { background: var(--color-success); }
.domain-item.warning .domain-bar-fill { background: var(--color-warning); }
.domain-item.problematic .domain-bar-fill { background: var(--color-error); }

.domain-stats {
    font-size: 10px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.domain-error-count {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
}

/* ============================================
   PERFORMANCE SECTION
   ============================================ */
.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.perf-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
}

.perf-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.perf-value {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.perf-bar {
    margin-top: 6px;
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
}

/* ============================================
   REQUEST STATS / PERCENTILES
   ============================================ */
.percentiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
}

.percentile-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    text-align: center;
}

.percentile-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.percentile-value {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-top: 2px;
}

.percentile-bar {
    margin-top: 6px;
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
}

/* ============================================
   TIME STATS
   ============================================ */
.time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.time-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    text-align: center;
}

.time-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.time-value {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-top: 2px;
}

/* ============================================
   RETRY STATS
   ============================================ */
.retry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.retry-total {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.retry-success-rate {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

.retry-phases {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.retry-phase {
    display: flex;
    align-items: center;
    gap: 8px;
}

.retry-phase-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    width: 24px;
}

.retry-phase-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.retry-phase-count {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
}

/* ============================================
   CIRCUIT BREAKER
   ============================================ */
.circuit-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.circuit-indicator {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circuit-indicator.closed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
}

.circuit-indicator.open {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
    animation: pulse 1.5s ease-in-out infinite;
}

.circuit-info {
    flex: 1;
}

.circuit-status-text {
    font-weight: 600;
    font-size: 14px;
}

.circuit-detail {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ============================================
   LIVE LOG SECTION
   ============================================ */
.log-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.log-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.log-filters {
    display: flex;
    gap: 4px;
}

.filter-btn {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.filter-btn.active {
    background: var(--color-info);
    border-color: var(--color-info);
    color: white;
}

.log-search {
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-size: 12px;
    width: 200px;
}

.log-search:focus {
    outline: none;
    border-color: var(--color-info);
}

.log-count {
    font-size: 11px;
    color: var(--text-tertiary);
}

.log-container {
    max-height: 400px;
    overflow-y: auto;
}

.log-entry {
    display: flex;
    flex-direction: column;
    padding: 8px var(--spacing-md);
    border-bottom: 1px solid var(--border-secondary);
    font-size: 12px;
    transition: background var(--transition-fast);
    animation: slideIn 0.3s ease;
}

.log-entry:hover {
    background: var(--bg-tertiary);
}

.log-entry.success { border-left: 3px solid var(--color-success); }
.log-entry.error { border-left: 3px solid var(--color-error); }
.log-entry.warning { border-left: 3px solid var(--color-warning); }
.log-entry.ignored { border-left: 3px solid var(--text-muted); }

.log-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-timestamp {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    min-width: 60px;
}

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

.log-entry.success .log-icon { color: var(--color-success); }
.log-entry.error .log-icon { color: var(--color-error); }
.log-entry.warning .log-icon { color: var(--color-warning); }

.log-code {
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.log-code.success { background: rgba(16, 185, 129, 0.2); color: var(--color-success); }
.log-code.redirect { background: rgba(59, 130, 246, 0.2); color: var(--color-info); }
.log-code.client-error { background: rgba(245, 158, 11, 0.2); color: var(--color-warning); }
.log-code.server-error { background: rgba(239, 68, 68, 0.2); color: var(--color-error); }

.log-duration {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    min-width: 50px;
}

.log-domain {
    color: var(--text-primary);
    font-weight: 500;
}

.log-row-url {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
    padding-left: 72px;
}

.log-row-message {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 2px;
    padding-left: 72px;
}

/* ============================================
   INITIALIZING OVERLAY
   ============================================ */
.initializing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.init-content {
    text-align: center;
    max-width: 400px;
}

.init-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--border-primary);
    border-top-color: var(--color-info);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-lg);
}

.init-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.init-steps {
    text-align: left;
    margin-bottom: var(--spacing-lg);
}

.init-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.init-step.active {
    opacity: 1;
}

.init-step.done {
    opacity: 1;
}

.init-step.done .step-icon {
    color: var(--color-success);
}

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

.step-icon svg {
    animation: spin 1s linear infinite;
}

.step-text {
    font-size: 14px;
}

.init-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ============================================
   COMPLETION BANNER
   ============================================ */
.completion-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    animation: slideUp 0.5s ease;
}

.completion-icon {
    width: 64px;
    height: 64px;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-success);
}

.completion-info {
    flex: 1;
}

.completion-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-success);
    margin-bottom: 4px;
}

.completion-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.completion-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

.btn-primary {
    background: var(--color-info);
    color: white;
}

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

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

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

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

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

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

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-control {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.btn-pause {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
    border-color: var(--color-warning);
}

.btn-pause:hover {
    background: rgba(245, 158, 11, 0.3);
}

.btn-resume {
    background: rgba(16, 185, 129, 0.2);
    color: var(--color-success);
    border-color: var(--color-success);
}

.btn-resume:hover {
    background: rgba(16, 185, 129, 0.3);
}

.btn-cancel {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
    border-color: var(--color-error);
}

.btn-cancel:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast-success {
    background: var(--color-success);
    color: white;
}

.toast-error {
    background: var(--color-error);
    color: white;
}

.toast-warning {
    background: var(--color-warning);
    color: white;
}

.toast-info {
    background: var(--color-info);
    color: white;
}

/* ============================================
   SPEED CHART CONTAINER
   ============================================ */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.chart-container-small {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    position: relative;
}

.chart-container-small canvas {
    max-width: 100%;
}

/* HTTP Totals Row */
.http-totals-row strong {
    font-weight: 600;
}

/* Error Trend Legend */
.error-trend-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Latency Stats Row */
.latency-stats span {
    color: var(--text-secondary);
}

.latency-stats strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================
   UTILITIES
   ============================================ */
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-error { color: var(--color-error) !important; }
.text-info { color: var(--color-info) !important; }
.text-muted { color: var(--text-muted) !important; }

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
}

.empty-state-text {
    font-size: 14px;
}

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

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

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

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

/* ============================================
   SPINNER SVG
   ============================================ */
.spinner-svg {
    animation: spin 1s linear infinite;
}
