/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a26;
    --bg-card: rgba(26, 26, 38, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #e6e6ef;
    --text-secondary: #8892b0;
    --text-muted: #5a6178;
    --accent-primary: #e94560;
    --accent-secondary: #0ead69;
    --accent-warning: #f59e0b;
    --accent-info: #3b82f6;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Layout */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.15), rgba(233, 69, 96, 0.05));
    color: var(--accent-primary);
    border: 1px solid rgba(233, 69, 96, 0.2);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), #c73659);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

.logout-btn {
    color: var(--text-muted);
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    background: var(--bg-primary);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.content-header h1 {
    font-size: 28px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.worker-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--accent-secondary);
    background: rgba(14, 173, 105, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(14, 173, 105, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-secondary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.last-updated {
    font-size: 13px;
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.running {
    background: rgba(14, 173, 105, 0.15);
    color: var(--accent-secondary);
}

.stat-icon.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
}

.stat-icon.requests {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-info);
}

.stat-icon.endpoints {
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent-primary);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.2);
}

.data-table td {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 24px;
}

.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.running {
    background: rgba(14, 173, 105, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(14, 173, 105, 0.3);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.paused {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.completed {
    background: rgba(14, 173, 105, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(14, 173, 105, 0.3);
}

.status-badge.failed, .status-badge.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Method Badges */
.method-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.method-badge.get { background: rgba(14, 173, 105, 0.15); color: var(--accent-secondary); }
.method-badge.post { background: rgba(59, 130, 246, 0.15); color: var(--accent-info); }
.method-badge.put { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.method-badge.delete { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.method-badge.patch { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #c73659);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(233, 69, 96, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card);
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.btn-icon.success:hover {
    background: rgba(14, 173, 105, 0.15);
    color: var(--accent-secondary);
}

.actions {
    display: flex;
    gap: 4px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.modal form {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    margin-top: 24px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

select.form-input {
    cursor: pointer;
}

select[multiple].form-input {
    height: 120px;
}

textarea.form-input {
    resize: vertical;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: var(--accent-primary);
}

/* Results Section */
#resultsContainer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.result-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.result-time {
    font-size: 12px;
    color: var(--text-muted);
}

.duration-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.summary-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.summary-stat .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.summary-stat .stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-stat.success .stat-value { color: var(--accent-secondary); }
.summary-stat.danger .stat-value { color: #f87171; }
.summary-stat.warning .stat-value { color: var(--accent-warning); }

.result-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 24px;
}

.details-section h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.metric {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-primary);
    border-radius: 4px;
    font-size: 12px;
}

.metric .label {
    color: var(--text-muted);
}

.metric .value {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.metric.highlight {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.metric.highlight .value {
    color: var(--accent-info);
}

.status-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-code-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.status-code-badge.success {
    background: rgba(14, 173, 105, 0.15);
    color: var(--accent-secondary);
    border: 1px solid rgba(14, 173, 105, 0.3);
}

.status-code-badge.redirect {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-code-badge.client-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-code-badge.server-error {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.no-data {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
}

.errors-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.error-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: 4px;
    font-size: 12px;
}

.error-item .error-type {
    color: var(--text-muted);
}

.error-item .error-count {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.error-item.has-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.error-item.has-errors .error-count {
    color: #f87171;
}

.result-endpoint {
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
    font-size: 12px;
}

.endpoint-label {
    color: var(--text-muted);
    margin-right: 8px;
}

.endpoint-url {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-summary {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .result-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

