/* web/static/css/styles.css */

/* Reset and Base Styles */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

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

.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 20px; 
}

/* Header Styles */
.header { 
    text-align: center; 
    margin-bottom: 40px; 
    background: white; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

.header h1 { 
    margin: 0; 
    color: #1e293b; 
    font-size: 2.5rem; 
}

.header p { 
    margin: 10px 0 0 0; 
    color: #64748b; 
    font-size: 1.1rem; 
}

/* Tab Styles */
.section-tabs { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 30px; 
    justify-content: center; 
    flex-wrap: wrap; 
}

.tab-button { 
    padding: 12px 24px; 
    background: white; 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.2s; 
    font-size: 16px; 
}

.tab-button.active { 
    background: #3b82f6; 
    color: white; 
    border-color: #3b82f6; 
}

.tab-button:hover:not(.active) { 
    border-color: #3b82f6; 
}

.tab-content.hidden { 
    display: none; 
}

/* Form Styles */
.search-section, .section { 
    background: white; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    margin-bottom: 30px; 
}

.search-form { 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}

.form-group { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

.form-group label { 
    font-weight: 600; 
    color: #374151; 
}

.form-input, .filter-input { 
    padding: 12px 16px; 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    font-size: 16px; 
    transition: border-color 0.2s; 
}

.form-input:focus, .filter-input:focus { 
    outline: none; 
    border-color: #3b82f6; 
}

/* TLD Groups */
.tld-groups { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 15px; 
}

.tld-group { 
    padding: 15px; 
    border: 2px solid #e5e7eb; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: all 0.2s; 
}

.tld-group:hover { 
    border-color: #3b82f6; 
}

.tld-group.selected { 
    border-color: #3b82f6; 
    background-color: #eff6ff; 
}

.tld-group h4 { 
    margin: 0 0 5px 0; 
    color: #1e293b; 
}

.tld-group p { 
    margin: 0; 
    color: #64748b; 
    font-size: 14px; 
}

/* Button Styles */
.search-button, .filter-button { 
    background: #3b82f6; 
    color: white; 
    border: none; 
    padding: 12px 24px; 
    border-radius: 8px; 
    font-size: 16px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: background 0.2s; 
    margin-top: 10px; 
}

.search-button:hover, .filter-button:hover { 
    background: #2563eb; 
}

.search-button:disabled { 
    background: #9ca3af; 
    cursor: not-allowed; 
}

.clear-button { 
    padding: 8px 16px; 
    background: #6b7280; 
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
}

.back-button { 
    padding: 10px 20px; 
    background: #6b7280; 
    color: white; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    margin-bottom: 20px; 
}

.back-button:hover { 
    background: #4b5563; 
}

.delete-button { 
    padding: 6px 12px; 
    background: #dc2626; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 12px; 
}

.delete-button:hover { 
    background: #b91c1c; 
}

/* Query Management Styles */
.query-controls { 
    background: white; 
    padding: 20px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    margin-bottom: 20px; 
}

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

.filter-group { 
    display: flex; 
    flex-direction: column; 
    gap: 5px; 
}

.filter-group label { 
    font-weight: 600; 
    color: #374151; 
    font-size: 14px; 
}

.queries-table { 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    overflow: hidden; 
}

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

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

th, td { 
    padding: 12px 16px; 
    text-align: left; 
    border-bottom: 1px solid #e5e7eb; 
}

th { 
    background: #f8fafc; 
    font-weight: 600; 
    color: #374151; 
    position: sticky; 
    top: 0; 
}

tr:hover { 
    background: #f8fafc; 
}

.query-row { 
    cursor: pointer; 
}

/* Status and Metric Badges */
.status-badge { 
    padding: 4px 8px; 
    border-radius: 12px; 
    font-size: 11px; 
    font-weight: 600; 
    text-transform: uppercase; 
}

.status-completed { 
    background: #dcfce7; 
    color: #166534; 
}

.status-processing { 
    background: #fef3c7; 
    color: #92400e; 
}

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

.status-available { 
    background: #dcfce7; 
    color: #166534; 
}

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

.status-checked { 
    background: #ede9fe; 
    color: #7c3aed; 
}

.status-error { 
    background: #fef3c7; 
    color: #92400e; 
}

.metric-badge { 
    background: #f1f5f9; 
    color: #475569; 
    padding: 2px 6px; 
    border-radius: 8px; 
    font-size: 11px; 
    font-weight: 600; 
    margin: 0 2px; 
}

.metric-available { 
    background: #dcfce7; 
    color: #166534; 
}

.metric-taken { 
    background: #fee2e2; 
    color: #991b1b; 
}

.metric-error { 
    background: #fef3c7; 
    color: #92400e; 
}

/* Method Badges */
.method-badge { 
    background: #f1f5f9; 
    color: #475569; 
    padding: 2px 8px; 
    border-radius: 12px; 
    font-weight: 600; 
    font-size: 11px; 
}

.method-badge.library { 
    background: #dcfce7; 
    color: #166534; 
}

.method-badge.rdap { 
    background: #ede9fe; 
    color: #7c3aed; 
}

.method-badge.whois { 
    background: #fef3c7; 
    color: #92400e; 
}

.method-badge.fallback { 
    background: #fee2e2; 
    color: #991b1b; 
}

.confidence-badge { 
    background: #e0e7ff; 
    color: #3730a3; 
    padding: 2px 6px; 
    border-radius: 8px; 
    font-weight: 600; 
    font-size: 10px; 
}

/* Pagination */
.pagination { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px; 
    margin-top: 20px; 
}

.page-button { 
    padding: 8px 12px; 
    border: 1px solid #e5e7eb; 
    background: white; 
    cursor: pointer; 
    border-radius: 6px; 
}

.page-button.active { 
    background: #3b82f6; 
    color: white; 
    border-color: #3b82f6; 
}

.page-button:hover:not(.active) { 
    background: #f8fafc; 
}

/* Query Details */
.query-header { 
    background: white; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    margin-bottom: 20px; 
}

.query-title { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: #1e293b; 
    margin-bottom: 15px; 
}

.query-meta { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 15px; 
}

.meta-item { }

.meta-label { 
    font-size: 12px; 
    color: #6b7280; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 4px; 
}

.meta-value { 
    font-size: 16px; 
    font-weight: 600; 
    color: #1e293b; 
}

/* Summary Cards */
.summary-cards { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 
    gap: 15px; 
    margin-bottom: 30px; 
}

.summary-card { 
    background: white; 
    padding: 20px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    text-align: center; 
}

.summary-number { 
    font-size: 2rem; 
    font-weight: 700; 
    margin-bottom: 5px; 
}

.summary-label { 
    font-size: 12px; 
    color: #6b7280; 
    text-transform: uppercase; 
}

.summary-available .summary-number { 
    color: #10b981; 
}

.summary-taken .summary-number { 
    color: #ef4444; 
}

.summary-error .summary-number { 
    color: #f59e0b; 
}

.summary-time .summary-number { 
    color: #3b82f6; 
}

.summary-rate .summary-number { 
    color: #8b5cf6; 
}

/* Results Display */
.results-section { 
    background: white; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    margin-bottom: 30px; 
}

.results-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 15px; 
}

.result-card { 
    padding: 20px; 
    border-radius: 8px; 
    border-left: 4px solid #e5e7eb; 
    position: relative; 
    cursor: pointer; 
    transition: transform 0.2s; 
}

.result-card:hover { 
    transform: translateY(-2px); 
}

.result-card.available { 
    border-left-color: #10b981; 
    background-color: #f0fdf4; 
}

.result-card.taken { 
    border-left-color: #ef4444; 
    background-color: #fef2f2; 
}

.result-card.checked { 
    border-left-color: #8b5cf6; 
    background-color: #faf5ff; 
}

.result-card.error { 
    border-left-color: #f59e0b; 
    background-color: #fffbeb; 
}

.result-detail-card { 
    padding: 15px; 
    border: 1px solid #e5e7eb; 
    border-radius: 8px; 
    background: #f9fafb; 
}

.result-detail-card.available { 
    border-left: 4px solid #10b981; 
    background: #f0fdf4; 
}

.result-detail-card.taken { 
    border-left: 4px solid #ef4444; 
    background: #fef2f2; 
}

.result-detail-card.error { 
    border-left: 4px solid #f59e0b; 
    background: #fffbeb; 
}

.domain-name, .result-domain { 
    font-weight: 600; 
    font-size: 18px; 
    margin-bottom: 8px; 
    word-break: break-all; 
}

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

.response-time { 
    font-size: 12px; 
    color: #6b7280; 
    font-weight: 500; 
}

.error-message, .result-error { 
    font-size: 12px; 
    color: #dc2626; 
    margin-top: 8px; 
    background: #fef2f2; 
    padding: 8px; 
    border-radius: 4px; 
}

.result-meta { 
    font-size: 12px; 
    color: #6b7280; 
    margin-bottom: 4px; 
}

.result-method { 
    display: inline-block; 
    padding: 2px 6px; 
    background: #e5e7eb; 
    border-radius: 4px; 
    font-size: 10px; 
    margin-right: 5px; 
}

.result-confidence { 
    font-weight: 600; 
}

/* Method Info */
.method-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
}

/* Summary Stats */
.summary-stats { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
}

.stat-item { 
    background: #f8fafc; 
    padding: 12px 16px; 
    border-radius: 8px; 
    text-align: center; 
    min-width: 80px; 
}

.stat-number { 
    font-size: 24px; 
    font-weight: 700; 
    color: #1e293b; 
}

.stat-label { 
    font-size: 12px; 
    color: #64748b; 
    text-transform: uppercase; 
}

.stat-available .stat-number { 
    color: #10b981; 
}

.stat-taken .stat-number { 
    color: #ef4444; 
}

.stat-error .stat-number { 
    color: #f59e0b; 
}

/* Login Styles */
.login-container { 
    background: white; 
    padding: 40px; 
    border-radius: 10px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    width: 300px; 
    margin: 100px auto; 
}

.login-container h2 { 
    text-align: center; 
    margin-bottom: 30px; 
    color: #333; 
}

.login-container .form-group { 
    margin-bottom: 20px; 
}

.login-container .form-group label { 
    display: block; 
    margin-bottom: 5px; 
    color: #555; 
}

.login-container .form-group input { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    box-sizing: border-box; 
}

.login-button { 
    width: 100%; 
    padding: 12px; 
    background: #007bff; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 16px; 
}

.login-button:hover { 
    background: #0056b3; 
}

/* Utility Classes */
.loading { 
    text-align: center; 
    padding: 40px; 
    color: #6b7280; 
}

.hidden { 
    display: none !important; 
}

/* Responsive Design */
@media (max-width: 768px) {
    .section-tabs { 
        flex-direction: column; 
    }
    
    .tab-button { 
        width: 100%; 
    }
    
    .filter-row { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .query-meta { 
        grid-template-columns: 1fr; 
    }
    
    .summary-cards { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .results-grid { 
        grid-template-columns: 1fr; 
    }
    
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .search-section, .section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        min-width: auto;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .tab-button {
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* Print Styles */
@media print {
    .tab-button, .filter-row, .pagination {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .section, .search-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Add to web/static/css/styles.css - Testing Styles */

/* Testing Status Cards */
.testing-status {
    margin-bottom: 30px;
}

.status-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #e5e7eb;
}

.status-card.status-ready {
    border-left-color: #10b981;
}

.status-card.status-running {
    border-left-color: #3b82f6;
}

.status-card.status-error {
    border-left-color: #ef4444;
}

.status-card h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: #1e293b;
}

.status-card p {
    margin: 0 0 15px 0;
    color: #64748b;
}

/* Progress Bar */
.progress-info {
    margin: 15px 0;
}

.progress-bar {
    background: #f1f5f9;
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    background: linear-gradient(90deg, #3b82f6, #10b981);
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #64748b;
    text-align: center;
    font-weight: 600;
}

/* Run Details */
.run-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item .label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-item .value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

/* Testing Buttons */
.testing-button {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.testing-button:hover {
    background: #6d28d9;
}

.testing-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.retry-button {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.retry-button:hover {
    background: #4b5563;
}

/* Queue Status */
.queue-status {
    margin-bottom: 30px;
}

.queue-overview {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.queue-overview h4 {
    margin: 0 0 20px 0;
    color: #1e293b;
}

.queue-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.queue-stat {
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.queue-stat .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.queue-stat .stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Testing Results */
.testing-results {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

.results-header h4 {
    margin: 0;
    color: #1e293b;
}

.refresh-button {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.refresh-button:hover {
    background: #4b5563;
}

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

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

.results-table th,
.results-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.results-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
}

.result-row.success {
    background: #f0fdf4;
}

.result-row.failed {
    background: #fef2f2;
}

.result-row:hover {
    background: #f8fafc;
}

.tld-name {
    font-family: monospace;
    background: #eff6ff;
    padding: 4px 8px;
    border-radius: 4px;
    color: #1e40af;
    font-weight: 600;
}

.test-domain {
    font-family: monospace;
    font-size: 12px;
    color: #6b7280;
}

.status-success {
    background: #dcfce7;
    color: #166534;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.method-library {
    background: #dcfce7;
    color: #166534;
}

.method-rdap {
    background: #ede9fe;
    color: #7c3aed;
}

.method-whois {
    background: #fef3c7;
    color: #92400e;
}

.method-none {
    background: #f1f5f9;
    color: #6b7280;
}

.methods-count {
    font-weight: 600;
    font-size: 16px;
}

.method-indicators {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.method-indicator {
    font-size: 12px;
    opacity: 0.5;
}

.method-indicator.works {
    opacity: 1;
}

.response-times {
    font-size: 12px;
}

.response-times div {
    margin-bottom: 2px;
}

.test-date {
    font-size: 12px;
}

.test-date .time {
    color: #6b7280;
    font-size: 11px;
}

.details-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.details-button:hover {
    background: #2563eb;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-style: italic;
}

/* Modal Styles for Result Details */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 80vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

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

.modal-header h3 {
    margin: 0;
    color: #1e293b;
}

.modal-close {
    background: #ef4444;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #dc2626;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Result Summary in Modal */
.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-item label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.summary-item span {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

/* Method Details in Modal */
.method-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.method-detail {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.method-detail.method-success {
    border-left: 4px solid #10b981;
}

.method-detail.method-failed {
    border-left: 4px solid #ef4444;
}

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

.method-header h4 {
    margin: 0;
    color: #1e293b;
}

.method-info {
    padding: 15px 20px;
}

.method-info div {
    margin-bottom: 8px;
}

.error-message {
    color: #dc2626;
    background: #fef2f2;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 12px;
}

/* Raw Response Display */
.raw-response {
    margin-top: 15px;
}

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

.toggle-button {
    background: #6b7280;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.toggle-button:hover {
    background: #4b5563;
}

.response-content {
    background: #1e293b;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* Responsive Design for Testing Tab */
@media (max-width: 768px) {
    .run-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .queue-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .result-summary {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 15px;
        max-height: calc(90vh - 80px);
    }
}

@media (max-width: 480px) {
    .queue-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .run-details {
        grid-template-columns: 1fr;
    }
    
    .results-table {
        font-size: 12px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 12px;
    }
}
/* Optional: Clean enhancement for Query Details tab */
/* Add this to the end of your styles.css - NO debug styles, production-ready */

#query-details-tab {
    padding: 20px 0;
}

#queryDetailsContent {
    max-width: 100%;
}

/* Ensure proper spacing between sections */
#queryDetailsContent .query-header {
    margin-bottom: 30px;
}

#queryDetailsContent .summary-cards {
    margin-bottom: 30px;
}

#queryDetailsContent .results-section {
    margin-bottom: 20px;
}

/* Ensure query details button is properly hidden by default */
#query-details-button {
    display: none;
}

#query-details-button.show {
    display: inline-block;
}


/* TLD Groups Styles - Add to your existing web/static/css/styles.css */

/* TLD Groups CSS - Fixed for actual structure */

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid #e5e7eb;
}

.stat-number {
    font-size: 1.8em;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 5px;
}

.stat-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Groups Container */
.groups-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Category Cards (top level) */
.group-category {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
}

.category-count {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

/* Subcategories List */
.subcategories-list {
    padding: 15px;
}

.subcategory {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.subcategory-header {
    background: #f9fafb;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.subcategory-header:hover {
    background: #f3f4f6;
}

.subcategory-title {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.subcategory-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tld-count {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.group-count {
    background: #f3e8ff;
    color: #7c3aed;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.toggle-icon {
    color: #6b7280;
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* Groups List (within subcategories) */
.groups-list {
    padding: 15px;
    background: #fafafa;
    display: none;
    border-top: 1px solid #e5e7eb;
}

.groups-list.expanded {
    display: block;
}

/* Individual Group Items */
.group-item {
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    overflow: hidden;
}

.group-header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.group-header:hover {
    background: #f9fafb;
}

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

.group-name {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-description {
    color: #6b7280;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-stats {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.priority {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.expand-icon {
    font-size: 14px;
    cursor: pointer;
}

/* TLD List (within groups) */
.tld-list {
    padding: 15px;
    background: #f8fafc;
    display: none;
    border-top: 1px solid #e5e7eb;
}

.tld-list.expanded {
    display: block;
}

.tld-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
}

.no-tlds {
    text-align: center;
    padding: 20px;
    color: #ef4444;
    font-style: italic;
}

.tld-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.tld-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #374151;
    position: relative;
    transition: all 0.2s ease;
    cursor: default;
}

.tld-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tld-item.active {
    background: #f0fdf4;
    border-color: #10b981;
    color: #065f46;
}

.tld-item.inactive {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
    opacity: 0.7;
}

.status-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-active {
    background: #10b981;
}

.status-inactive {
    background: #ef4444;
}

/* Section Actions */
.section-actions {
    display: flex;
    gap: 10px;
}

.secondary-button {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.secondary-button:hover {
    background: #4b5563;
}

.primary-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

/* Filter Section */
.filter-section {
    margin-bottom: 20px;
}

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

.filter-group {
    min-width: 200px;
}

.filter-button {
    background: #6b7280;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-button:hover {
    background: #4b5563;
}

/* Error and Loading States */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #ef4444;
    background: #fef2f2;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .groups-grid {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: unset;
    }
    
    .group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .group-stats {
        align-self: flex-end;
    }
    
    .tld-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .category-count {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .subcategory-meta {
        flex-wrap: wrap;
        gap: 4px;
    }
}

/* Add this CSS to your styles.css file for retry query styling */

/* Retry Query Indicators */
.retry-indicator {
    margin-top: 4px;
    font-size: 12px;
}

.retry-badge {
    background: #ff9500;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.retry-query {
    background-color: #fff8f0 !important;
    border-left: 3px solid #ff9500;
}

.retry-context {
    font-size: 11px;
    color: #666;
    font-style: italic;
    margin-top: 2px;
}

/* Mini link buttons */
.mini-link-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-left: 4px;
}

.mini-link-button:hover {
    background: #0056b3;
}

/* Debug button styling */
.debug-button {
    background: #ff6b35;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 4px;
}

.debug-button:hover {
    background: #e55a2b;
}

/* Retry context banner */
.retry-context-banner {
    background: linear-gradient(135deg, #fff8f0, #ffe6cc);
    border: 1px solid #ff9500;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(255, 149, 0, 0.1);
}

.retry-context-banner h4 {
    margin: 0 0 8px 0;
    color: #d67e00;
    font-size: 16px;
}

.retry-context-banner p {
    margin: 0 0 12px 0;
    color: #8b5a00;
    line-height: 1.4;
}

.go-to-debug-button {
    background: #ff9500;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.go-to-debug-button:hover {
    background: #e6850e;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
}

/* Enhanced status badges for retry queries */
.status-badge.retry-query {
    background: linear-gradient(135deg, #ff9500, #ffb84d);
    animation: subtle-pulse 2s infinite;
}

@keyframes subtle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Query link buttons in debug errors */
.query-link {
    margin-top: 6px;
}

.query-link .mini-link-button {
    background: #28a745;
    font-size: 11px;
    padding: 3px 8px;
}

.query-link .mini-link-button:hover {
    background: #1e7e34;
}

/* Retry summary note */
.retry-summary-note {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 6px;
    padding: 10px;
    margin-top: 15px;
    font-size: 14px;
    color: #004085;
}

.retry-summary-note strong {
    color: #002752;
}

/* Enhanced modal styling for retry results */
.retry-result-modal .query-link-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.retry-result-modal .query-link-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
}

.retry-result-modal .query-link-section p {
    margin: 0 0 12px 0;
    color: #6c757d;
    line-height: 1.4;
}

.view-query-button, .view-history-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.view-query-button:hover, .view-history-button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.primary-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.primary-button:hover {
    background: #1e7e34;
    transform: translateY(-1px);
}

.secondary-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background: #545b62;
}