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

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

/* Navbar */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.navbar .logo {
    font-size: 1.5rem;
    font-weight: 600;
}

.navbar .nav-links {
    display: flex;
    gap: 1.5rem;
}

.navbar .nav-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

.navbar .nav-links a:hover,
.navbar .nav-links a.active {
    opacity: 0.8;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header h2 {
    color: #2c3e50;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary {
    background: #2ecc71;
}

.btn-primary:hover {
    background: #27ae60;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #d68910;
}

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

.btn-block {
    width: 100%;
}

/* Queue Status */
.queue-status {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    gap: 2rem;
}

.status-item {
    display: flex;
    flex-direction: column;
}

.status-item .label {
    font-size: 0.875rem;
    color: #7f8c8d;
}

.status-item .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Table */
.scans-table {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

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

.url-cell {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.url-cell a {
    color: #3498db;
    text-decoration: none;
}

.url-cell a:hover {
    text-decoration: underline;
}

.empty {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem !important;
}

/* Status Badge */
.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-queued {
    background: #e8f4f8;
    color: #3498db;
}

.status-running {
    background: #fff3cd;
    color: #f39c12;
}

.status-completed {
    background: #d4edda;
    color: #27ae60;
}

.status-failed {
    background: #f8d7da;
    color: #e74c3c;
}

.status-stopped {
    background: #e2e3e5;
    color: #6c757d;
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-card h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: #7f8c8d;
    font-size: 0.875rem;
}

.error {
    background: #f8d7da;
    color: #e74c3c;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.success {
    background: #d4edda;
    color: #27ae60;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Cards */
.form-card,
.info-card,
.detail-card,
.results-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.info-card h3,
.info-card h4 {
    color: #2c3e50;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.info-card h3:first-child {
    margin-top: 0;
}

.info-card ul {
    margin-left: 1.5rem;
}

.info-card code {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* Detail Rows */
.detail-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 150px;
}

.detail-row .value {
    flex: 1;
    color: #2c3e50;
}

.detail-row .value code {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.actions-row {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
    display: flex;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Vulnerabilities */
.vulnerabilities {
    margin-top: 1rem;
}

.vulnerability {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.vulnerability h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.severity-critical {
    color: #e74c3c;
    font-weight: 600;
}

.severity-high {
    color: #f39c12;
    font-weight: 600;
}

.severity-medium {
    color: #f1c40f;
}

.severity-low {
    color: #3498db;
}

.severity-info {
    color: #7f8c8d;
}

/* Severity Filter */
.severity-filter {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.severity-filter label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.filter-btn.active {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

/* Count Badge */
.count-badge {
    display: inline-block;
    margin-left: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.25rem;
    text-align: center;
}

.filter-btn.active .count-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Collapsible Vulnerabilities using <details> */
.vulnerability {
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #e1e4e8;
    overflow: visible;
}

.vulnerability-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    list-style: none;
}

.vulnerability-header::-webkit-details-marker {
    display: none;
}

.vulnerability-header::marker {
    display: none;
}

.vulnerability-header:hover {
    background: #f0f2f5;
}

.vulnerability-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.vulnerability-title h4 {
    color: #2c3e50;
    margin: 0;
    font-size: 1rem;
}

.vulnerability-details {
    padding: 0 1rem 1rem 1rem;
}

.vulnerability summary::after {
    content: "▼";
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-left: auto;
    transition: transform 0.3s;
}

.vulnerability[open] summary::after {
    transform: rotate(180deg);
}

/* Vulnerability Data Table */
.vuln-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.vuln-data-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #e1e4e8;
    vertical-align: top;
}

.vuln-data-table td.key {
    font-weight: 600;
    color: #2c3e50;
    width: 25%;
    background: #f0f2f5;
    border-right: 1px solid #e1e4e8;
}

.vuln-data-table td.value {
    color: #34495e;
    word-break: break-word;
}

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

.vuln-data-table pre {
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 3px;
    padding: 0.75rem;
    margin: 0.25rem 0;
    overflow-x: auto;
    font-size: 0.85rem;
}

.vuln-data-table code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #e83e8c;
}

.vuln-data-table pre code {
    color: #2c3e50;
}

.vuln-data-table a {
    color: #3498db;
    text-decoration: none;
}

.vuln-data-table a:hover {
    text-decoration: underline;
}

/* Request/Response Expandable Data */
.expand-data-link {
    color: #3498db;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.expand-data-link:hover {
    text-decoration: underline;
}

.expanded-data {
    margin-top: 0.75rem;
}

.request-response-textarea {
    width: 100%;
    min-height: 200px;
    max-height: 500px;
    padding: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 3px;
    resize: vertical;
    color: #2c3e50;
    line-height: 1.4;
}

.request-response-textarea:focus {
    outline: none;
    border-color: #3498db;
}

/* Logs Section */
.logs-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.logs-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.log-count {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: normal;
}

.logs-container {
    background: #1e1e1e;
    border-radius: 4px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.log-line {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.log-stdout {
    color: #d4d4d4;
}

.log-stderr {
    color: #f48771;
}

.log-timestamp {
    color: #858585;
    margin-right: 0.5rem;
}

.log-text {
    color: inherit;
}

.logs-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logs-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}
