* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --pipeops-primary: #2563eb;
    --pipeops-primary-dark: #1e40af;
    --pipeops-primary-light: #3b82f6;
    --pipeops-secondary: #64748b;
    --pipeops-success: #10b981;
    --pipeops-danger: #ef4444;
    --pipeops-warning: #f59e0b;
    --pipeops-bg: #f8fafc;
    --pipeops-surface: #ffffff;
    --pipeops-border: #e2e8f0;
    --pipeops-text: #1e293b;
    --pipeops-text-light: #64748b;
}

[data-theme="dark"] {
    --pipeops-primary: #3b82f6;
    --pipeops-primary-dark: #2563eb;
    --pipeops-primary-light: #60a5fa;
    --pipeops-secondary: #94a3b8;
    --pipeops-success: #10b981;
    --pipeops-danger: #ef4444;
    --pipeops-warning: #f59e0b;
    --pipeops-bg: #0a0f1a;
    --pipeops-surface: #131720;
    --pipeops-surface-elevated: #1a1f2e;
    --pipeops-border: #1e293b;
    --pipeops-text: #e2e8f0;
    --pipeops-text-light: #94a3b8;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Oxygen,
        Ubuntu, Cantarell, sans-serif;
    background: var(--pipeops-bg);
    color: var(--pipeops-text);
    line-height: 1.4;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Compact and Modern */
.app-header {
    background: var(--pipeops-surface);
    border-bottom: 1px solid var(--pipeops-border);
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    transition: opacity 0.2s ease;
}

.brand:hover {
    opacity: 0.7;
}

.brand-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--pipeops-text);
    letter-spacing: -0.01em;
}

.product-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--pipeops-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.github-link {
    background: transparent;
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--pipeops-text);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
    text-decoration: none;
}

.github-link:hover {
    background: var(--pipeops-surface-elevated, var(--pipeops-bg));
    border-color: var(--pipeops-primary);
    color: var(--pipeops-primary);
}

.github-link svg {
    width: 16px;
    height: 16px;
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    padding: 0.375rem 0.625rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--pipeops-text);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
}

.theme-toggle:hover {
    background: var(--pipeops-surface-elevated, var(--pipeops-bg));
    border-color: var(--pipeops-primary);
}

.theme-toggle svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Main Content - Compact */
.app-main {
    flex: 1;
    padding: 0.75rem;
}

/* Footer */
.app-footer {
    background: var(--pipeops-surface);
    border-top: 1px solid var(--pipeops-border);
    padding: 1.5rem 1rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-content p {
    color: var(--pipeops-text-light);
    font-size: 0.875rem;
    margin: 0;
    font-weight: 500;
}

.footer-link {
    color: var(--pipeops-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

.footer-link:hover {
    color: var(--pipeops-primary-dark);
    border-bottom-color: var(--pipeops-primary);
}

[data-theme="dark"] .app-footer {
    background: var(--pipeops-surface);
    border-top-color: var(--pipeops-border);
}

.content-layout {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Card Component - Compact and Modern */
.card {
    background: var(--pipeops-surface);
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    padding: 0.875rem;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--pipeops-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--pipeops-text);
    letter-spacing: -0.01em;
    margin-bottom: 0;
}

.test-host-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.host-label {
    font-size: 0.6875rem;
    color: var(--pipeops-text-light);
    font-weight: 500;
}

.host-url {
    font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
    font-size: 0.75rem;
    color: var(--pipeops-primary);
    font-weight: 500;
    word-break: break-all;
}

/* Form - Compact */
.form {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    height: 100%;
}

/* Form Section Dividers */
.form-section-divider {
    border-top: 1px solid var(--pipeops-border);
    margin: 1rem 0 0.875rem 0;
    padding-top: 0.875rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.form-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--pipeops-text-light);
    margin-bottom: 0.25rem;
}

.input,
.textarea {
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    font-size: 0.8125rem;
    background: var(--pipeops-bg);
    color: var(--pipeops-text);
    transition: all 0.15s;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.textarea {
    resize: vertical;
    min-height: 50px;
    line-height: 1.4;
    max-width: 100%;
}

[data-theme="dark"] .input,
[data-theme="dark"] .textarea {
    background: var(--pipeops-surface-elevated, #1a1f2e);
}

.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--pipeops-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-hint {
    font-size: 0.6875rem;
    color: var(--pipeops-text-light);
    margin-top: 0.25rem;
    line-height: 1.3;
}

/* Authentication Section */
.auth-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pipeops-border);
}

.auth-type-config {
    margin-top: 1rem;
}

select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    font-size: 0.8125rem;
    background: var(--pipeops-bg);
    color: var(--pipeops-text);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

[data-theme="dark"] select {
    background: var(--pipeops-surface-elevated, #1a1f2e);
}

select:focus {
    outline: none;
    border-color: var(--pipeops-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0;
}

/* Buttons - Compact and Modern */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--pipeops-primary-dark);
    border-color: var(--pipeops-primary-dark);
}

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

/* Live Overview Card */
.live-overview-card {
    background: var(--pipeops-surface);
    border: 1px solid var(--pipeops-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.overview-stat {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem;
    background: var(--pipeops-bg);
    border-radius: 6px;
    border: 1px solid var(--pipeops-border);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.overview-stat::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--pipeops-primary),
        var(--pipeops-primary-light)
    );
    opacity: 0;
    transition: opacity 0.2s ease;
}

.overview-stat:hover::before {
    opacity: 1;
}

.overview-stat:hover {
    border-color: var(--pipeops-primary);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .overview-stat {
    background: var(--pipeops-surface-elevated);
}

[data-theme="dark"] .overview-stat:hover {
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.overview-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--pipeops-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.overview-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pipeops-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
    transition: transform 0.2s ease;
}

.overview-stat:hover .overview-stat-value {
    transform: scale(1.05);
}

/* Special styling for specific overview stats */
#virtualUsers {
    color: #8b5cf6;
}

#elapsedTime {
    color: #0ea5e9;
}

#remainingTime {
    color: #f59e0b;
}

#testDuration {
    color: #10b981;
}

/* Legacy overview classes for backward compatibility */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.overview-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.overview-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--pipeops-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.overview-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--pipeops-text);
    font-variant-numeric: tabular-nums;
}

.progress-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--pipeops-border);
}

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

.progress-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pipeops-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-percentage {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--pipeops-primary);
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    height: 8px;
    background: var(--pipeops-bg);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .progress-bar {
    background: var(--pipeops-surface-elevated);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--pipeops-primary),
        var(--pipeops-primary-light)
    );
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

[data-theme="dark"] .progress-bar-fill {
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Metrics Grid - Compact */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    background: var(--pipeops-surface);
    border-radius: 6px;
    border: 1px solid var(--pipeops-border);
    transition: all 0.2s ease;
}

.metric:hover {
    border-color: var(--pipeops-primary);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .metric:hover {
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2);
}

.metric-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--pipeops-text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.metric-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--pipeops-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Metric value color coding */
.metric:has(#successRate) .metric-value,
.metric:has(#successRate) .metric-label {
    color: var(--pipeops-success);
}

.metric:has(#errorRate) .metric-value,
.metric:has(#totalErrors) .metric-value {
    color: var(--pipeops-danger);
}

.metric:has(#rps) .metric-value,
.metric:has(#avgRPS) .metric-value {
    color: var(--pipeops-primary);
}

.metric:has(#avgLatency) .metric-value,
.metric:has(#minLatency) .metric-value,
.metric:has(#maxLatency) .metric-value,
.metric:has(#p50Latency) .metric-value,
.metric:has(#p95Latency) .metric-value,
.metric:has(#p99Latency) .metric-value {
    color: var(--pipeops-warning);
}

/* Charts - Compact */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
}

.chart-card {
    background: var(--pipeops-surface);
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    padding: 0.875rem;
    transition: all 0.2s ease;
}

.chart-card:hover {
    border-color: var(--pipeops-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--pipeops-text);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.chart-container {
    position: relative;
    height: 200px;
}

.chart-container canvas {
    max-height: 200px;
}

/* History - Compact */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-item {
    background: var(--pipeops-surface);
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: var(--pipeops-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.history-item.expanded {
    border-color: var(--pipeops-primary);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.history-item-url {
    font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--pipeops-text);
    word-break: break-all;
    flex: 1;
}

.history-item-summary {
    margin-bottom: 0.5rem;
}

.summary-text {
    font-size: 0.8125rem;
    color: var(--pipeops-text-light);
    line-height: 1.5;
    margin-bottom: 0.375rem;
}

.expand-indicator {
    font-size: 0.6875rem;
    color: var(--pipeops-primary);
    font-weight: 500;
}

.history-item-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--pipeops-border);
}

.history-item-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.history-metric {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.history-item-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.history-item-time {
    font-size: 0.6875rem;
    color: var(--pipeops-text-light);
    white-space: nowrap;
}

/* Status Badge - Compact */
.status-badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-running {
    background: rgba(59, 130, 246, 0.1);
    color: var(--pipeops-primary);
}

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

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--pipeops-danger);
}

.history-metric-label {
    font-size: 0.625rem;
    color: var(--pipeops-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.history-metric-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--pipeops-text);
    font-variant-numeric: tabular-nums;
}

.history-item-actions {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.history-advanced-view {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--pipeops-border);
}

.advanced-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.loading-state,
.empty-state {
    text-align: center;
    padding: 1.5rem;
    color: var(--pipeops-text-light);
    font-size: 0.875rem;
}

.history-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.75rem;
}

.history-chart-card {
    padding: 0.75rem;
    background: var(--pipeops-bg);
    border-radius: 6px;
    border: 1px solid var(--pipeops-border);
}

.history-chart-card .chart-container {
    height: 180px;
}

.history-chart-card canvas {
    max-height: 180px;
}

/* CTA Card - Compact */
.cta-card {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(
        135deg,
        rgba(37, 99, 235, 0.05),
        rgba(59, 130, 246, 0.02)
    );
}

.cta-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--pipeops-text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.cta-content p {
    font-size: 0.875rem;
    color: var(--pipeops-text-light);
    margin-bottom: 1.25rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* Modal - Compact */
.modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.modal-overlay[style*="display: flex"] {
    visibility: visible;
    opacity: 1;
}

.modal {
    background: var(--pipeops-surface);
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    height: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

[data-theme="dark"] .modal {
    background: var(--pipeops-bg);
    color: var(--pipeops-text);
}

.modal-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--pipeops-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--pipeops-text);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--pipeops-text-light);
    cursor: pointer;
    padding: 0;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s;
}

.modal-close:hover {
    background: var(--pipeops-bg);
    color: var(--pipeops-text);
}

.modal-body {
    padding: 0;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.form-content {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 1rem;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.form-content::-webkit-scrollbar {
    width: 8px;
}

.form-content::-webkit-scrollbar-track {
    background: var(--pipeops-bg);
    border-radius: 4px;
}

.form-content::-webkit-scrollbar-thumb {
    background: var(--pipeops-border);
    border-radius: 4px;
}

.form-content::-webkit-scrollbar-thumb:hover {
    background: var(--pipeops-primary);
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--pipeops-bg);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--pipeops-border);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--pipeops-primary);
}

/* Advanced Metrics Toggle */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-toggle {
    background: var(--pipeops-bg);
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--pipeops-text);
    transition: all 0.15s;
    font-weight: 500;
}

.btn-toggle:hover {
    background: var(--pipeops-surface-elevated, var(--pipeops-surface));
    border-color: var(--pipeops-primary);
}

.btn-toggle.active {
    background: var(--pipeops-primary);
    color: white;
    border-color: var(--pipeops-primary);
}

.advanced-metrics {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--pipeops-border);
}

/* Resumed Banner */
.resumed-banner {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--pipeops-success);
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Circuit Breaker Banner */
.circuit-breaker-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.circuit-breaker-banner .banner-icon {
    color: #ef4444;
    font-size: 1rem;
    font-weight: bold;
}

.circuit-breaker-banner .banner-text {
    font-size: 0.8125rem;
    color: #ef4444;
    font-weight: 500;
}

.resumed-banner-icon {
    color: var(--pipeops-success);
    font-size: 1rem;
    animation: spin 1s linear infinite;
}

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

.resumed-banner-text {
    font-size: 0.8125rem;
    color: var(--pipeops-success);
    font-weight: 500;
}

/* Responsive - Compact */
/* Running Tests Card */
.running-tests-card {
    background: var(--pipeops-surface);
    border: 1px solid var(--pipeops-border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .running-tests-card {
    background: var(--pipeops-surface);
    border-color: var(--pipeops-border);
}

.running-tests-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.running-tests-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.running-tests-title h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.running-icon {
    font-size: 1.25rem;
    animation: pulse 2s ease-in-out infinite;
}

.running-tests-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    min-width: 1.5rem;
    text-align: center;
}

.running-tests-list {
    padding: 0;
}

.running-test-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--pipeops-border);
    transition: background 0.15s ease;
    cursor: pointer;
}

.running-test-item:last-child {
    border-bottom: none;
}

.running-test-item:hover {
    background: var(--pipeops-bg);
}

[data-theme="dark"] .running-test-item:hover {
    background: var(--pipeops-surface-elevated, #1a1f2e);
}

.running-test-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.625rem;
}

.running-test-url {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--pipeops-text);
    flex: 1;
    margin-right: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.running-test-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--pipeops-success);
    font-weight: 500;
}

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

.running-test-details {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.test-detail-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--pipeops-text-light);
}

.test-detail-icon {
    font-size: 0.875rem;
}

.test-detail-value {
    font-weight: 500;
    color: var(--pipeops-text);
}

.running-test-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.running-test-actions .btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

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

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

/* Test Started Notification (Toast) */
.test-started-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--pipeops-success);
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease-out;
}

.test-started-notification.show {
    opacity: 1;
    transform: translateX(0);
}

[data-theme="dark"] .test-started-notification {
    background: var(--pipeops-surface);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.notification-body {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    position: relative;
}

.notification-icon-success {
    width: 32px;
    height: 32px;
    background: var(--pipeops-success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}

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

.notification-message strong {
    display: block;
    color: var(--pipeops-text);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-message p {
    color: var(--pipeops-text-light);
    font-size: 0.75rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-view-btn {
    background: var(--pipeops-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.notification-view-btn:hover {
    background: var(--pipeops-primary-dark);
    transform: translateY(-1px);
}

.notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--pipeops-text-light);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s;
}

.notification-close:hover {
    background: var(--pipeops-bg);
    color: var(--pipeops-text);
}

@media (max-width: 768px) {
    .app-main {
        padding: 0.5rem;
    }

    .content-layout {
        gap: 0.5rem;
    }

    .card {
        padding: 0.75rem;
    }

    .app-footer {
        padding: 1rem 0.5rem;
        margin-top: 1.5rem;
    }

    .footer-content p {
        font-size: 0.8125rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .theme-toggle {
        align-self: flex-end;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Modal adjustments for tablet */
    .modal {
        max-width: 500px;
        width: 95%;
        max-height: 90vh;
    }

    .modal-body {
        padding: 1rem;
        padding-bottom: 6rem;
    }

    .form-field {
        margin-bottom: 1rem;
    }

    .action-buttons-container {
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .overview-stat {
        padding: 0.625rem;
    }

    .overview-stat-value {
        font-size: 1.25rem;
    }

    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .history-item-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-value {
        font-size: 1.125rem;
    }

    .chart-container {
        height: 180px;
    }

    .chart-container canvas {
        max-height: 180px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 12px;
    }

    .app-main {
        padding: 0.375rem;
    }

    .card {
        padding: 0.625rem;
    }

    /* Critical modal fixes for mobile */
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

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

    .form-content {
        padding: 0.75rem;
        padding-bottom: 0.75rem;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
    }

    .modal-header {
        padding: 0.75rem 1rem;
        flex-shrink: 0;
    }

    .form-field {
        margin-bottom: 1rem;
    }

    .textarea {
        min-height: 80px;
        max-height: 120px;
        font-size: 16px;
        -webkit-appearance: none;
    }

    .input {
        font-size: 16px;
        -webkit-appearance: none;
    }

    #bodyField .textarea {
        max-height: 150px;
    }

    #headersConfig .textarea {
        max-height: 120px;
    }

    .advanced-options-container {
        max-height: 250px;
        padding: 0.75rem;
        overflow-y: auto !important;
    }

    .advanced-section {
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .action-buttons-container {
        margin: 0 !important;
        padding: 0.875rem !important;
        background: var(--pipeops-surface) !important;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3) !important;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .form-actions .btn {
        width: 100%;
    }

    #advancedOptions {
        margin-bottom: 1rem;
    }

    .running-tests-card {
        margin-bottom: 1rem;
    }

    .running-tests-header {
        padding: 0.875rem 1rem;
    }

    .running-tests-title h3 {
        font-size: 0.875rem;
    }

    .running-test-item {
        padding: 0.875rem 1rem;
    }

    .running-test-details {
        gap: 1rem;
    }

    .running-test-actions {
        flex-direction: column;
    }

    .running-test-actions .btn {
        width: 100%;
    }

    .test-started-notification {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }

    .notification-body {
        flex-wrap: wrap;
        padding: 0.875rem 1rem;
    }

    .notification-view-btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    .overview-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .overview-stat {
        padding: 0.5rem;
    }

    .overview-stat-label {
        font-size: 0.625rem;
    }

    .overview-stat-value {
        font-size: 1.125rem;
    }

    .live-overview-card {
        padding: 0.75rem;
    }

    .overview-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric {
        padding: 0.5rem 0.625rem;
    }

    .metric-value {
        font-size: 1rem;
    }

    .modal-overlay {
        z-index: 9999;
    }

    .github-link span {
        display: none;
    }

    .github-link {
        padding: 0.375rem 0.5rem;
    }
}

/* Legacy styles - kept for backward compatibility but not used in new design */
.request-config-section,
.auth-section {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    max-height: none;
    overflow: visible;
}

/* Request Body Field Styling */
#bodyField {
    animation: slideDown 0.2s ease-out;
    margin-top: 0.5rem;
}

#bodyField .textarea {
    font-family:
        "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
        "Courier New", monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    min-height: 80px;
    max-height: 150px;
    resize: vertical;
}

/* Custom Headers Config */
#headersConfig {
    animation: slideDown 0.2s ease-out;
    background: var(--pipeops-bg);
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.75rem;
}

[data-theme="dark"] #headersConfig {
    background: rgba(255, 255, 255, 0.02);
}

#headersConfig .textarea {
    font-family:
        "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas,
        "Courier New", monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    max-height: 120px;
    resize: vertical;
}

/* Checkbox Styling */
.checkbox {
    width: auto !important;
    height: 16px;
    cursor: pointer;
    accent-color: var(--pipeops-primary);
    margin-right: 0.5rem;
}

label input[type="checkbox"] {
    margin-right: 0.625rem;
    vertical-align: middle;
}

label input[type="checkbox"] + span {
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    font-size: 0.8125rem;
    color: var(--pipeops-text);
}

.form-field label {
    display: flex;
    align-items: center;
    gap: 0;
}

.form-field label:has(input[type="checkbox"]) {
    margin-bottom: 0.5rem;
}

/* Form Hints */
.form-hint {
    font-size: 0.6875rem;
    color: var(--pipeops-text-light);
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        overflow: hidden;
    }
    to {
        opacity: 1;
        max-height: 500px;
        overflow: visible;
    }
}

/* Section Labels with Icons */
.form-field label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-field label[for="body"]::before,
.form-field label[for="customHeaders"]::before {
    content: "{ }";
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--pipeops-primary);
    font-weight: bold;
}

.form-field label[for="method"]::before {
    content: "⚡";
    font-size: 0.875rem;
}

/* Textarea Placeholder Styling */
.textarea::placeholder {
    color: var(--pipeops-text-light);
    opacity: 0.5;
    font-style: italic;
}

/* Better spacing for modal form sections */
.test-modal .form-field {
    margin-bottom: 1.25rem;
}

.test-modal .request-config-section,
.test-modal .auth-section {
    margin-bottom: 1.5rem;
}

/* Section Headers */
.section-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--pipeops-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--pipeops-border);
}

.section-header .section-icon {
    font-size: 1rem;
    display: inline-block;
    width: 1.25rem;
    text-align: center;
}

/* Advanced Options Toggle */
.advanced-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--pipeops-surface);
    border: 1px solid var(--pipeops-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.advanced-toggle-btn:hover {
    background: var(--pipeops-surface-elevated, #1a1f2e);
    border-color: var(--pipeops-primary);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.advanced-toggle-btn:active {
    transform: scale(0.98);
}

.advanced-toggle-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advanced-toggle-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--pipeops-text);
}

.advanced-toggle-hint {
    font-size: 0.6875rem;
    color: var(--pipeops-text-light);
    font-weight: 400;
}

.advanced-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--pipeops-primary);
    transition: transform 0.3s ease;
}

#advancedOptions {
    overflow: visible;
    transition:
        max-height 0.3s ease-out,
        opacity 0.3s ease-out;
    max-height: 0;
    opacity: 0;
    height: auto;
    margin-top: 0.625rem;
}

#advancedOptions.hidden {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
}

#advancedOptions:not(.hidden) {
    max-height: 2500px;
    opacity: 1;
    overflow: visible;
}

/* Advanced Options Container - Combined Scrollable */
.advanced-options-container {
    background: var(--pipeops-surface);
    border: 1px solid var(--pipeops-border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    max-height: 280px;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.advanced-options-container::-webkit-scrollbar {
    width: 6px;
}

.advanced-options-container::-webkit-scrollbar-track {
    background: var(--pipeops-bg);
    border-radius: 3px;
}

.advanced-options-container::-webkit-scrollbar-thumb {
    background: var(--pipeops-border);
    border-radius: 3px;
}

.advanced-options-container::-webkit-scrollbar-thumb:hover {
    background: var(--pipeops-primary);
}

[data-theme="dark"] .advanced-options-container {
    background: var(--pipeops-surface-elevated);
}

/* Advanced Sections */
.advanced-section {
    padding-bottom: 0.875rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--pipeops-border);
}

.advanced-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.advanced-section .form-field {
    margin-bottom: 0.75rem;
}

.advanced-section .form-field:last-child {
    margin-bottom: 0;
}

/* Action Buttons Section - Sticky Footer */
.action-buttons-container {
    margin: 0 !important;
    padding: 0.875rem 1rem !important;
    border-top: 2px solid var(--pipeops-border) !important;
    background: var(--pipeops-surface) !important;
    flex-shrink: 0 !important;
    z-index: 1000 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

[data-theme="dark"] .action-buttons-container {
    background: var(--pipeops-surface) !important;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3) !important;
    border-top-color: var(--pipeops-border) !important;
}

/* Enhanced form actions alignment */
.action-buttons-container .form-actions {
    display: flex !important;
    gap: 0.75rem !important;
    justify-content: flex-end !important;
    align-items: center !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force buttons to always be visible */
.action-buttons-container .btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.action-buttons-container .btn-primary,
.action-buttons-container .btn-secondary {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
