/* ============================================================
   DF Lookup — Modern Dark Theme
   ============================================================ */

:root {
    --bg-base:       #080c14;
    --bg-surface:    #0d1220;
    --bg-card:       #111827;
    --bg-input:      #0d1220;
    --border:        #1f2d45;
    --border-subtle: #162033;

    --accent:        #00c9ff;
    --accent-dim:    #0090b8;
    --accent-glow:   rgba(0, 201, 255, 0.15);

    --text-primary:  #e8edf5;
    --text-secondary:#7a8a9e;
    --text-muted:    #4a5568;

    --validated:     #10b981;
    --validated-bg:  rgba(16, 185, 129, 0.1);
    --unvalidated:   #4a5568;
    --unvalidated-bg:rgba(74, 85, 104, 0.15);

    --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:     'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    --radius-sm:     6px;
    --radius-md:     10px;
    --radius-lg:     14px;

    --transition:    0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Layout ── */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Header ── */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 20px;
    color: var(--accent);
    line-height: 1;
}

.brand-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.db-count {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot--green {
    background: var(--validated);
    box-shadow: 0 0 6px var(--validated);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Search Section ── */
.search-section {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 48px 24px 32px;
}

.search-section-inner {
    max-width: 860px;
    margin: 0 auto;
}

.search-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.search-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.7;
}

.notice {
    font-size: 12.5px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Search Bar ── */
.search-bar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color var(--transition);
}

.search-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 15px;
    padding: 14px 48px 14px 48px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input:focus + .search-icon,
.search-bar-wrap:focus-within .search-icon {
    color: var(--accent);
}

/* Loading spinner */
.loading-spinner {
    position: absolute;
    right: 16px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ── Filters ── */
.filters-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

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

.filter-group--stats {
    margin-left: auto;
    justify-content: flex-end;
}

.filter-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 8px 32px 8px 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition);
    min-width: 150px;
}

.filter-select:focus,
.filter-select:hover {
    border-color: var(--accent-dim);
}

.results-stats {
    font-size: 12.5px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding-bottom: 8px;
}

/* ── Results Section ── */
.results-section {
    flex: 1;
    padding: 28px 24px 48px;
}

.results-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Table ── */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    transition: opacity var(--transition);
}

.results-table thead {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

.results-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    white-space: nowrap;
    user-select: none;
}

.results-table th[data-sort] {
    cursor: pointer;
    transition: color var(--transition);
}

.results-table th[data-sort]:hover {
    color: var(--text-secondary);
}

.results-table th[data-sort]::after {
    content: ' ⇅';
    opacity: 0.3;
    font-size: 10px;
}

.results-table th.sort-asc::after {
    content: ' ↑';
    opacity: 1;
    color: var(--accent);
}

.results-table th.sort-desc::after {
    content: ' ↓';
    opacity: 1;
    color: var(--accent);
}

.results-table th.sort-asc,
.results-table th.sort-desc {
    color: var(--accent);
}

.results-table td {
    padding: 13px 20px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table tbody tr {
    transition: background var(--transition);
}

.results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

/* Host cell — monospace */
.host-cell {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    word-break: break-all;
}

/* CDN tag */
.cdn-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0, 201, 255, 0.08);
    border: 1px solid rgba(0, 201, 255, 0.2);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Date cell */
.date-cell {
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
    font-weight: 500;
}

/* Date age colour coding */
.date-fresh   { color: #10b981; }  /* ≤ 1 month  — green  */
.date-good    { color: #06b6d4; }  /* ≤ 3 months — teal   */
.date-aging   { color: #f59e0b; }  /* ≤ 6 months — amber  */
.date-old     { color: #f97316; }  /* ≤ 1 year   — orange */
.date-stale   { color: #ef4444; }  /* > 1 year   — red    */
.date-unknown { color: var(--text-muted); }

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-validated {
    background: var(--validated-bg);
    color: var(--validated);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-unvalidated {
    background: var(--unvalidated-bg);
    color: var(--text-muted);
    border: 1px solid rgba(74, 85, 104, 0.3);
}

/* Empty / error state */
.empty-state {
    text-align: center;
    padding: 60px 20px !important;
    color: var(--text-muted);
    font-size: 14px;
}

.error-state {
    color: #f87171;
}

/* ── Pagination ── */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 7px 13px;
    font-size: 13px;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--transition);
    min-width: 38px;
}

.page-btn:hover {
    border-color: var(--accent-dim);
    color: var(--text-primary);
    background: rgba(0, 201, 255, 0.06);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .search-title { font-size: 22px; }
    .filters-row { gap: 12px; }
    .filter-group--stats { margin-left: 0; width: 100%; }
    .header-meta { display: none; }

    .results-table th:nth-child(4),
    .results-table td:nth-child(4) { display: none; }
}
