/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Navigation */
.navbar {
    background-color: #632CA6;
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 16px 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
}

.nav-link {
    display: block;
    color: white;
    text-decoration: none;
    padding: 20px 16px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
    min-height: calc(100vh - 140px);
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.dashboard-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

.status-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
}

.status-running {
    background-color: #d1fae5;
    color: #065f46;
}

.status-stopped {
    background-color: #fee2e2;
    color: #991b1b;
}

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

.dashboard-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background-color: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-content {
    padding: 20px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.stat-label {
    color: #6b7280;
}

.stat-value {
    font-weight: 500;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-button {
    display: inline-block;
    background-color: #632CA6;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

.action-button:hover {
    background-color: #5a259a;
}

/* Tooltip styles */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 4px;
}

.tooltip-wrapper .tooltip-text {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    max-width: 250px;
}

.tooltip-wrapper .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.activity-feed {
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.activity-time {
    color: #6b7280;
    font-size: 0.875rem;
    min-width: 80px;
}

.activity-text {
    font-size: 0.875rem;
}

/* Page headers */
.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

/* Lists and items */
.traces-list,
.sessions-list,
.snapshots-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trace-item,
.session-item,
.snapshot-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trace-header,
.session-header,
.snapshot-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.trace-header h3,
.session-header h3,
.snapshot-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.span-count {
    background-color: #f3f4f6;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #6b7280;
}

.trace-actions,
.session-actions,
.snapshot-actions {
    display: flex;
    gap: 8px;
}

/* Trace details */
.spans-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.span-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #632CA6;
}

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

.span-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
}

.span-id {
    font-size: 0.875rem;
    color: #6b7280;
    font-family: monospace;
}

.span-details p {
    margin-bottom: 4px;
    font-size: 0.875rem;
}

/* Session details */
.session-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.session-info h3 {
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 600;
}

.session-traces {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.session-traces h3 {
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 600;
}

.trace-summary {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 8px;
}

.trace-summary p {
    margin-bottom: 4px;
    font-size: 0.875rem;
}

/* Config page */
.config-editor {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.config-editor h3 {
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 600;
}

.config-textarea {
    width: 100%;
    height: 400px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.875rem;
    resize: vertical;
}

/* Empty states and messages */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* Footer */
.footer {
    background-color: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 16px;
    }

    .nav-links {
        margin-top: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-content {
        padding: 20px 16px;
    }

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

    .trace-item,
    .session-item,
    .snapshot-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .span-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .snapshots-table {
        overflow-x: auto;
    }

    .snapshots-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .snapshots-stats {
        min-width: auto;
    }

    .filter-input {
        min-width: auto;
        width: 100%;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .meta-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .meta-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }

    .meta-label {
        margin-right: 0;
        margin-bottom: 2px;
    }

    .meta-value {
        text-align: left;
    }
}

/* Snapshot viewer styles */
.snapshot-info {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #6b7280;
}

.snapshots-controls {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.snapshots-stats {
    padding: 12px 16px;
    background-color: #f8fafc;
    border-radius: 6px;
    border-left: 4px solid #632CA6;
    margin: 0;
    flex-grow: 1;
    min-width: 200px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    min-width: 200px;
    background-color: white;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: #632CA6;
    box-shadow: 0 0 0 3px rgba(99, 44, 166, 0.1);
}

.filter-query-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    flex-grow: 1;
    background-color: white;
    transition: border-color 0.2s;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.filter-query-input:focus {
    outline: none;
    border-color: #632CA6;
    box-shadow: 0 0 0 3px rgba(99, 44, 166, 0.1);
}

.snapshots-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.snapshots-table th {
    background-color: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.snapshots-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

.snapshot-row:hover {
    background-color: #f9fafb;
}

.filename-link {
    color: #632CA6;
    text-decoration: none;
    font-weight: 500;
}

.filename-link:hover {
    text-decoration: underline;
}

.size-cell, .modified-cell {
    color: #6b7280;
}

.actions-cell .action-button {
    padding: 4px 12px;
    font-size: 0.75rem;
}

/* Snapshot detail page */
.breadcrumb {
    margin-top: 8px;
    font-size: 0.875rem;
}

.breadcrumb-link {
    color: #632CA6;
    text-decoration: none;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
    color: #9ca3af;
}

.breadcrumb-current {
    color: #6b7280;
}

.snapshot-meta {
    margin-bottom: 24px;
}

.meta-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.meta-card h3 {
    margin-bottom: 16px;
    font-size: 1.125rem;
    font-weight: 600;
}

.meta-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    min-height: 24px;
}

.meta-label {
    font-weight: 500;
    color: #374151;
    flex-shrink: 0;
    margin-right: 12px;
}

.meta-value {
    color: #6b7280;
    text-align: left;
    word-break: break-word;
}

.meta-value.valid {
    color: #059669;
}

.meta-value.invalid {
    color: #dc2626;
}

/* Loading states and payload handling */
.loading-state {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 4px;
    color: #6b7280;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.large-payload-notice {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 16px;
    margin: 8px 0;
}

.payload-info {
    margin-bottom: 12px;
}

.payload-info strong {
    color: #92400e;
    font-size: 0.95rem;
}

.payload-info p {
    margin: 4px 0;
    color: #78350f;
    font-size: 0.875rem;
}

.decode-button {
    background-color: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.decode-button:hover {
    background-color: #d97706;
}

.decoding-error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
}

.decoding-error strong {
    color: #dc2626;
}

.decoding-error pre {
    margin: 8px 0 0 0;
    color: #7f1d1d;
    font-size: 0.875rem;
    white-space: pre-wrap;
}

.snapshot-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.content-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.content-actions {
    display: flex;
    gap: 8px;
}

.content-actions .action-button {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.code-container {
    overflow: auto;
    max-height: 80vh;
    max-width: 100%;
}

.code-block {
    margin: 0;
    padding: 20px;
    background-color: #1f2937;
    color: #f9fafb;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    max-width: 100%;
    box-sizing: border-box;
}

.code-block code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
}

/* Waterfall visualization styles */
.waterfall-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.waterfall-traces {
    padding: 16px;
}

.waterfall-trace {
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.waterfall-trace:last-child {
    margin-bottom: 0;
}

.trace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s;
}

.trace-header:hover {
    background-color: #f1f5f9;
}

.trace-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trace-toggle {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: monospace;
    user-select: none;
    transition: color 0.2s;
}

.trace-toggle:hover {
    color: #374151;
}

.trace-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.trace-duration {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.spans-timeline {
    padding: 8px;
    background-color: #ffffff;
}

.waterfall-span {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    min-height: 28px;
    position: relative;
}

.span-row {
    display: flex;
    align-items: center;
    width: 100%;
}

.span-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 200px;
    flex-shrink: 0;
    padding-right: 12px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.span-info:hover {
    background-color: #f9fafb;
    border-radius: 4px;
}

.span-label {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    flex-grow: 1;
}

.span-toggle {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: monospace;
    user-select: none;
    flex-shrink: 0;
}

.span-names {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.service-name {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.operation-name {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.span-timing {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
}

.span-bar-container {
    flex-grow: 1;
    height: 20px;
    background-color: #f3f4f6;
    border-radius: 2px;
    position: relative;
    margin-left: 8px;
}

.span-bar {
    height: 100%;
    border-radius: 2px;
    position: absolute;
    top: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.span-bar.span-normal {
    background-color: #632CA6;
}

/* Red outline for any span with error, regardless of service color */
.waterfall-span.span-error .span-bar {
    border: 2px dashed #dc2626;
    box-sizing: border-box;
}

.span-bar:hover {
    opacity: 0.8;
}

/* Service-based color variations - applied via JavaScript */
.span-bar.service-color-0 { background-color: #632CA6; }
.span-bar.service-color-1 { background-color: #3b82f6; }
.span-bar.service-color-2 { background-color: #10b981; }
.span-bar.service-color-3 { background-color: #f59e0b; }
.span-bar.service-color-4 { background-color: #8b5cf6; }
.span-bar.service-color-5 { background-color: #ec4899; }
.span-bar.service-color-6 { background-color: #06b6d4; }
.span-bar.service-color-7 { background-color: #84cc16; }

/* Hover effects for spans */
.waterfall-span:hover {
    background-color: #f9fafb;
}

.waterfall-span:hover .service-name {
    color: #632CA6;
}

/* Mobile responsive adjustments for waterfall */
@media (max-width: 768px) {
    .span-info {
        width: 150px;
    }

    .service-name,
    .operation-name {
        max-width: 120px;
    }

    .waterfall-span {
        min-height: 32px;
    }

    .span-bar-container {
        margin-left: 4px;
    }
}

/* Requests page styles */
.requests-page {
    padding: 20px;
}

.request-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.request-actions {
    display: flex;
    gap: 8px;
}

/* Removed clickable filter styles - now using search-based filtering */

.filter-hint {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.stat-badge {
    background-color: #632CA6;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.requests-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.request-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.stat-item {
    font-size: 0.875rem;
    color: #6b7280;
}

.filter-input, .filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 150px;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: #632CA6;
    box-shadow: 0 0 0 2px rgba(99, 44, 166, 0.1);
}

.view-count {
    font-size: 0.875rem;
    color: #6b7280;
}

.requests-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    max-width: 100%;
}

.requests-table {
    width: 100%;
    border-collapse: collapse;
}

.requests-table th {
    background-color: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}


.requests-table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    vertical-align: top;
}

.request-row:hover,
.snapshot-row:hover {
    background-color: #f0f9ff;
    cursor: pointer;
}

.method-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.method-get { background-color: #10b981; }
.method-post { background-color: #3b82f6; }
.method-put { background-color: #f59e0b; }
.method-delete { background-color: #dc2626; }
.method-patch { background-color: #8b5cf6; }

.path-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.path {
    font-weight: 500;
    color: #374151;
}

.query-string {
    font-size: 0.75rem;
    color: #6b7280;
    word-break: break-all;
}

.handler-name {
    background-color: #f3f4f6;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.75rem;
    color: #632CA6;
}

.session-token {
    background-color: #f3f4f6;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

.no-session {
    color: #9ca3af;
    font-style: italic;
}

.action-button.small {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.request-details {
    background-color: #f8fafc;
}

.request-details-content {
    padding: 16px;
    max-width: 100%;
    overflow-x: auto;
}

.request-details-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.details-section {
    margin-bottom: 16px;
}

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

.details-section h4 {
    margin: 0 0 8px 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.headers-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-item {
    display: flex;
    gap: 8px;
    font-size: 0.8125rem;
}

.header-name {
    font-weight: 500;
    color: #6b7280;
    min-width: 120px;
}

.header-value {
    color: #374151;
    word-break: break-all;
}

.query-params code {
    background-color: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8125rem;
    word-break: break-all;
}

/* Mobile responsive for requests */
@media (max-width: 768px) {
    .requests-controls {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .filter-controls {
        flex-wrap: wrap;
    }

    .filter-input, .filter-select {
        min-width: 120px;
    }

    .requests-table-container {
        overflow-x: auto;
    }

    .requests-table {
        min-width: 800px;
    }
}

/* Span metadata styles */
.span-details {
    margin-top: 8px;
    margin-left: 20px;
    padding: 12px;
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    max-height: 300px;
    overflow-y: auto;
}

.span-metadata h5 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.metadata-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.metadata-item {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 8px;
}

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

.metadata-label {
    font-weight: 600;
    color: #374151;
    flex-shrink: 0;
    min-width: 300px;
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.metadata-value {
    color: #374151;
    text-align: left;
    word-break: break-word;
    font-family: monospace;
    font-size: 0.8125rem;
    flex-grow: 1;
}

.metadata-section {
    margin-top: 16px;
}

.metadata-section h6 {
    margin: 0 0 8px 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mobile responsive adjustments for metadata */
@media (max-width: 768px) {
    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .metadata-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .metadata-value {
        text-align: left;
    }

    .span-details {
        margin-left: 10px;
    }
}

/* Tab styling for request/response details */
.details-tabs {
    display: flex;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.tab-button {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: #632CA6;
}

.tab-button.active {
    color: #632CA6;
    border-bottom-color: #632CA6;
}

.tab-content {
    display: block;
}

.body-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.body-section h5 {
    margin: 0 0 8px 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.request-body,
.response-body {
    background-color: #1f2937;
    color: #f9fafb;
    border-radius: 6px;
    padding: 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.request-body pre,
.response-body pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    overflow-x: auto;
}

.decoded-body {
    margin-top: 8px;
}

.decoded-body h5 {
    margin: 0 0 8px 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.decoded-body .json-body {
    background-color: #0f172a;
    color: #e2e8f0;
    border-radius: 6px;
    border-left: 4px solid #3b82f6; /* Blue for JSON */
    padding: 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.decoded-body .msgpack-body {
    background-color: #1e1b4b;
    color: #ddd6fe;
    border-radius: 6px;
    border-left: 4px solid #8b5cf6; /* Purple for MessagePack */
    padding: 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.decoded-body .text-body {
    background-color: #374151;
    color: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #6b7280; /* Gray for plain text */
    padding: 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.decoded-body .error-body {
    background-color: #7f1d1d;
    color: #fecaca;
    border-radius: 6px;
    border-left: 4px solid #dc2626; /* Red for errors */
    padding: 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.decoded-body .empty-body {
    background-color: #374151;
    color: #9ca3af;
    border-radius: 6px;
    border-left: 4px solid #6b7280; /* Gray for empty */
    padding: 12px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    font-style: italic;
}

.query-params {
    background-color: #f3f4f6;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    font-size: 0.75rem;
    color: #374151;
    word-break: break-all;
}

/* Action controls styling */
.action-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.action-controls .action-button {
    margin: 0;
}

/* SSE Pause button styling */
#pause-sse-btn {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
}

#pause-sse-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

#pause-sse-btn.paused {
    background-color: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

#pause-sse-btn.paused:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

/* Proxy status styling */
.proxy-enabled {
    color: #10b981 !important;
    font-weight: 600;
}

.proxy-disabled {
    color: #6b7280;
}

/* Multipart form data styling */
.multipart-data {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.multipart-field {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    padding: 12px;
}

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

.field-header strong {
    color: #374151;
    font-weight: 600;
}

.field-type {
    font-size: 0.875rem;
    color: #6b7280;
    font-style: italic;
}

.field-value {
    margin-top: 8px;
}

.field-value pre {
    margin: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.field-value code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-all;
    white-space: pre-wrap;
    word-wrap: break-word;
}