/* ============================================================
   DNS Lookup Tool — Styles
   Fonts: Inter (UI), Gotham Bold (display headings), ProFontII (DNS results)
   ============================================================ */

/* --- Local Fonts ------------------------------------------ */
@font-face {
    font-family: 'Gotham';
    src: url('gotham-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'ProFontII';
    src: url('ProFontIIxNerdFont-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* --- Custom Properties ------------------------------------ */
/* All themeable colors live as variables here.
   Theme overrides are applied via [data-theme="..."] blocks below. */
:root {
    /* Base surfaces */
    --bg:           #0d1117;
    --surface:      #161d27;
    --surface-2:    #1e2836;
    --border:       #2a3444;
    --border-hover: #3a4a5e;

    /* Accent (Humanfrog teal) — same value in both themes */
    --accent:             #00C9A5;
    --accent-hover:       #00ddb5;
    --accent-active:      #00b594;
    --accent-dim:         rgba(0, 201, 165, 0.12);
    --accent-border:      rgba(0, 201, 165, 0.3);
    --accent-soft:        rgba(0, 201, 165, 0.08);
    --accent-soft-border: rgba(0, 201, 165, 0.28);
    --accent-text:        #0d1117;  /* text color on top of --accent fills */

    /* Text */
    --text:         #e6edf3;
    --text-muted:   #8b949e;
    --text-mono:    #c9d1d9;

    /* Status — pure hues (same in both themes) */
    --green:        #22c55e;
    --amber:        #f59e0b;
    --red:          #ef4444;

    /* Status — green tints */
    --green-bg:          rgba(34, 197, 94, 0.1);
    --green-bg-soft:     rgba(34, 197, 94, 0.08);
    --green-border:      rgba(34, 197, 94, 0.3);
    --green-border-soft: rgba(34, 197, 94, 0.28);

    /* Status — amber tints */
    --amber-bg:          rgba(245, 158, 11, 0.1);
    --amber-bg-soft:     rgba(245, 158, 11, 0.08);
    --amber-bg-faint:    rgba(245, 158, 11, 0.05);
    --amber-bg-strong:   rgba(245, 158, 11, 0.15);
    --amber-border:      rgba(245, 158, 11, 0.3);

    /* Status — red tints */
    --red-bg:            rgba(239, 68, 68, 0.1);
    --red-bg-soft:       rgba(239, 68, 68, 0.12);
    --red-bg-strong:     rgba(239, 68, 68, 0.15);
    --red-border:        rgba(239, 68, 68, 0.3);
    --red-border-soft:   rgba(239, 68, 68, 0.35);
    --red-border-strong: rgba(239, 68, 68, 0.45);
    --red-border-hover:  rgba(239, 68, 68, 0.65);

    /* Server tags — fixed brand colors, same in both themes */
    --server-da:        #5CB2E6;  /* DirectAdmin blue */
    --server-cp:        #FF6C2C;  /* cPanel orange */
    --server-tag-text:  #0d1117;

    /* Effects */
    --shadow-dropdown:          0 18px 44px rgba(0, 0, 0, 0.32);
    --shimmer-overlay:          rgba(255, 255, 255, 0.05);
    --spinner-border-on-accent: rgba(13, 17, 23, 0.3);
    --card-shadow:              none;
    --hero-glow:                0 1px 2px rgba(0, 0, 0, 0.25), 0 14px 36px -10px rgba(0, 201, 165, 0.28);
    --card-hover-glow:          0 1px 3px rgba(0, 0, 0, 0.3), 0 10px 28px -10px rgba(0, 201, 165, 0.30);

    /* Sizing & typography */
    --radius:       10px;
    --radius-sm:    6px;
    --font-ui:      'Inter', system-ui, sans-serif;
    --font-display: 'Gotham', 'Inter', system-ui, sans-serif;
    --font-mono:    'ProFontII', 'JetBrains Mono', 'Fira Code', monospace;
}

/* --- Light Theme Overrides -------------------------------- */
/* Applied via [data-theme="light"] on <html> (default for new users).
   Only variables that differ from dark are overridden here.
   Accent teal, status hues, server-tag colors and accent-text stay
   identical between themes. */
:root[data-theme="light"] {
    /* Base surfaces — clean off-white bg, white cards, subtle gray borders */
    --bg:           #f3f5f4;
    --surface:      #ffffff;
    --surface-2:    #f1f4f3;
    --border:       #e3e7e5;
    --border-hover: #c7cdcb;

    /* Accent tints — softer alpha values work better on white */
    --accent-hover:       #00b18f;
    --accent-active:      #009878;
    --accent-dim:         rgba(0, 201, 165, 0.10);
    --accent-border:      rgba(0, 201, 165, 0.28);
    --accent-soft:        rgba(0, 201, 165, 0.07);
    --accent-soft-border: rgba(0, 201, 165, 0.22);

    /* Text — dark on light */
    --text:         #1a2422;
    --text-muted:   #6b7472;
    --text-mono:    #2d3835;

    /* Status tints — low-alpha rgba overlays render as pale pastels on
       white surfaces, so the dark-mode values still work and read clean. */

    /* Effects */
    --shadow-dropdown:  0 14px 36px rgba(15, 30, 25, 0.10);
    --shimmer-overlay:  rgba(0, 0, 0, 0.04);
    --card-shadow:      0 1px 2px rgba(15, 30, 25, 0.04), 0 1px 1px rgba(15, 30, 25, 0.02);
    --hero-glow:        0 1px 2px rgba(15, 30, 25, 0.04), 0 12px 32px -8px rgba(0, 201, 165, 0.22);
    --card-hover-glow:  0 1px 3px rgba(15, 30, 25, 0.05), 0 10px 26px -8px rgba(0, 201, 165, 0.22);
}

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

/* --- Base ------------------------------------------------- */
html { font-size: 16px; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout ----------------------------------------------- */
.page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
}

.main {
    flex: 1;
    padding-bottom: 64px;
}

/* --- Header ----------------------------------------------- */
.site-header {
    padding: 22px 0 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.logo-eyebrow {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.logo-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

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

/* Theme toggle button — circular, pale-teal fill, sun/moon icon swap. */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: 50%;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

.theme-toggle:active {
    transform: scale(0.94);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-icon {
    width: 18px;
    height: 18px;
    display: none;
}

/* Show the icon for the theme you'd switch to: moon when in light, sun in dark. */
:root[data-theme="light"] .theme-icon--moon { display: block; }
:root[data-theme="dark"]  .theme-icon--sun  { display: block; }

/* --- Hero ------------------------------------------------- */
.hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px 36px;
    margin-bottom: 36px;
    box-shadow: var(--hero-glow);
}

.hero-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* --- Lookup Form ------------------------------------------ */
.lookup-form {
    margin-bottom: 48px;
    position: relative;
}

.field-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.domain-input {
    flex: 1;
    height: 52px;
    padding: 0 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.domain-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

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

/* --- Search History --------------------------------------- */
.history-dropdown {
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-dropdown);
    overflow: hidden;
    animation: fadeSlideIn 0.16s ease both;
}

.history-list {
    display: flex;
    flex-direction: column;
}

.history-item {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text-mono);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-align: left;
    padding: 10px 14px;
    cursor: pointer;
}

.history-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.history-clear {
    width: 100%;
    border: none;
    background: var(--surface-2);
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.76rem;
    padding: 8px 14px;
    cursor: pointer;
    text-align: right;
}

.history-clear:hover {
    color: var(--text);
}

.lookup-btn {
    height: 52px;
    padding: 0 28px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, opacity 0.15s;
    min-width: 110px;
}

.lookup-btn:hover {
    background: var(--accent-hover);
}

.lookup-btn:active {
    background: var(--accent-active);
}

.lookup-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Button loading state */
.btn-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid var(--spinner-border-on-accent);
    border-top-color: var(--accent-text);
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

.lookup-btn.is-loading .btn-label  { display: none; }
.lookup-btn.is-loading .btn-spinner { display: block; }

/* Error message below input */
.field-error {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--red);
    min-height: 20px;
}

/* --- Results ---------------------------------------------- */
.results-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.results-domain-name {
    color: var(--text);
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* --- Cards ------------------------------------------------ */
.cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    animation: fadeSlideIn 0.3s ease both;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: var(--accent-soft-border);
    box-shadow: var(--card-hover-glow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 26px;
    padding: 0 8px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.card-title-group {
    flex: 1;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
    flex-shrink: 0;
}

.card-count.has-records {
    color: var(--accent);
    border-color: var(--accent-border);
    background: var(--accent-dim);
}

.card-body {
    padding: 6px 0;
}

/* --- Record Rows ------------------------------------------ */
.record-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 9px 20px;
    border-bottom: 1px solid transparent;
    transition: background 0.1s;
}

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

.record-row:hover {
    background: var(--surface-2);
}

.record-value {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-mono);
    word-break: break-all;
}

.record-ttl {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
}

/* MX-specific: priority badge + provider label */
.mx-priority {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
}

.provider-label {
    font-size: 0.72rem;
    font-family: var(--font-ui);
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* SOA: key-value table layout */
.soa-table {
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 16px;
    align-items: baseline;
}

.soa-key {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.soa-val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-mono);
    word-break: break-all;
}

/* --- Empty State ------------------------------------------ */
.empty-state,
.error-state {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.error-state {
    color: var(--red);
}

/* --- Loading Skeleton ------------------------------------- */
.skeleton-body {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        var(--surface-2) 25%,
        var(--shimmer-overlay) 50%,
        var(--surface-2) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-line:nth-child(2) { width: 70%; }
.skeleton-line:nth-child(3) { width: 50%; }

/* --- Footer ----------------------------------------------- */
.site-footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Animations ------------------------------------------- */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Section Label ---------------------------------------- */
/* Divides the DNS record cards from the email health check cards */
.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 4px 0 2px;
    animation: fadeSlideIn 0.3s ease both;
}

.section-label::before,
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* --- Health Badges ---------------------------------------- */
/* Coloured pill shown in the card header for DMARC / SPF status */
.health-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
}

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

.health-badge.pass {
    background: var(--green-bg);
    border-color: var(--green-border);
    color: var(--green);
}
.health-badge.pass .health-dot { background: var(--green); }

.health-badge.warn {
    background: var(--amber-bg);
    border-color: var(--amber-border);
    color: var(--amber);
}
.health-badge.warn .health-dot { background: var(--amber); }

.health-badge.fail {
    background: var(--red-bg);
    border-color: var(--red-border);
    color: var(--red);
}
.health-badge.fail .health-dot { background: var(--red); }

/* --- Issue List ------------------------------------------- */
/* Displays SPF warnings / errors inside the SPF card */
.issue-list {
    list-style: none;
    padding: 10px 20px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.issue-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.84rem;
    line-height: 1.45;
}

.issue-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.issue-item.warn { color: var(--amber); }
.issue-item.warn .issue-icon {
    background: var(--amber-bg-strong);
    color: var(--amber);
}
.issue-item.warn .issue-icon::before { content: '!'; }

.issue-item.fail { color: var(--red); }
.issue-item.fail .issue-icon {
    background: var(--red-bg-strong);
    color: var(--red);
}
.issue-item.fail .issue-icon::before { content: '!'; }

/* --- DKIM Selector Grid ----------------------------------- */
.selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px 16px;
}

.selector-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px solid transparent;
}

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

.selector-chip.found {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}
.selector-chip.found .chip-dot { background: var(--accent); }

.selector-chip.not-found {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text-muted);
}
.selector-chip.not-found .chip-dot { background: var(--border-hover); }

/* Inline monospace span used in "not found" empty-state messages */
.mono-inline {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text-mono);
}

/* --- MX IP Resolution ------------------------------------- */
/* MX rows may grow vertically (hostname + resolved IPs), so top-align */
.record-row--mx {
    align-items: flex-start;
}

/* Wraps the hostname and its resolved IPs as a vertical column */
.mx-host-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Container for resolved IP entries below the hostname */
.mx-ips {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* A single resolved IP + its org tag on one line */
.mx-ip-entry {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Resolved IP — smaller and dimmer than the hostname above it */
.mx-ip {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* --- ISP / Org Tags --------------------------------------- */
/* Empty slot in the DOM — filled dynamically with IP metadata tags once
   the ipinfo.io response arrives. display:contents means it takes no
   space itself but its child becomes a normal flex item. */
.ipmeta-slot {
    display: contents;
}

.org-label,
.hostname-label {
    font-size: 0.72rem;
    font-family: var(--font-ui);
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hostname-label {
    color: var(--accent);
    border-color: var(--accent-soft-border);
    background: var(--accent-soft);
}

/* --- Known Server Tags ------------------------------------ */
.server-tag {
    font-size: 0.72rem;
    font-family: var(--font-ui);
    font-weight: 500;
    border-radius: 20px;
    padding: 1px 8px;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--server-tag-text);
}

.server-tag--da { background: var(--server-da); } /* DirectAdmin blue  */
.server-tag--cp { background: var(--server-cp); } /* cPanel orange     */

/* --- PTR Records ------------------------------------------ */
.record-row--ptr {
    align-items: flex-start;
}

.ptr-targets {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ptr-target {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

/* --- Empty Type Summary ----------------------------------- */
/* One-liner shown below DNS cards when some types returned no records */
.empty-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-align: center;
    padding: 4px 0 8px;
    animation: fadeSlideIn 0.3s ease both;
}

/* --- IP Info Card ----------------------------------------- */
/* Key/value grid for the ipinfo.io response in IP lookup mode */
.ipinfo-grid {
    padding: 12px 20px;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 16px;
    align-items: baseline;
}

.ipinfo-key {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ipinfo-val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-mono);
    word-break: break-all;
}

.ipinfo-block {
    border-bottom: 1px solid var(--border);
}

.ipinfo-block:last-child {
    border-bottom: none;
}

.ipinfo-title {
    padding: 12px 20px 0;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
}

.ipinfo-block .ipinfo-grid {
    padding-top: 8px;
}

.empty-state--inline {
    padding: 0;
    text-align: left;
}

.ipinfo-block .empty-state--inline {
    padding: 8px 20px 12px;
}

/* --- Filter Bar ------------------------------------------- */
/* Row of toggle buttons shown above results after a lookup completes */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    align-items: center;
}

.filter-separator {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 2px;
}

.filter-btn {
    height: 30px;
    padding: 0 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.filter-btn--active {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
}

.filter-btn--danger {
    border-color: var(--red-border-strong);
    color: var(--red);
}

.filter-btn--danger.filter-btn--active,
.filter-btn--danger:hover {
    background: var(--red-bg-soft);
    border-color: var(--red-border-hover);
    color: var(--red);
}

/* --- Blacklist Check -------------------------------------- */
.bl-loading {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.bl-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-hover);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.bl-details {
    border: none;
}

.bl-summary {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.86rem;
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.bl-summary::-webkit-details-marker { display: none; }
.bl-summary::marker { display: none; }

.bl-summary.has-hits {
    color: var(--red);
}

.bl-summary-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.bl-listed-toggle {
    border: 1px solid var(--red-border-soft);
    background: var(--red-bg);
    color: var(--red);
    border-radius: 20px;
    padding: 2px 9px;
    font-family: var(--font-ui);
    font-size: 0.74rem;
    cursor: pointer;
}

.bl-listed-toggle:hover {
    border-color: var(--red-border-hover);
}

.bl-chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-top: -3px;
}

.bl-details[open] .bl-chevron {
    transform: rotate(-135deg);
    margin-top: 3px;
}

.bl-list {
    display: flex;
    flex-direction: column;
}

.bl-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--border);
}

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

.bl-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--green);
}

.bl-row.listed .bl-status-dot {
    background: var(--red);
}

.bl-row.unavailable .bl-status-dot {
    background: var(--amber);
}

.bl-listed-only .bl-row.clean,
.bl-listed-only .bl-row.unavailable {
    display: none;
}

.bl-main {
    min-width: 0;
    flex: 1;
}

.bl-name {
    font-size: 0.86rem;
    color: var(--text);
}

.bl-meta {
    margin-top: 2px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    word-break: break-all;
}

.bl-state {
    font-size: 0.74rem;
    font-family: var(--font-ui);
    border-radius: 20px;
    padding: 1px 8px;
    color: var(--green);
    background: var(--green-bg);
    border: 1px solid var(--green-border-soft);
    white-space: nowrap;
    flex-shrink: 0;
}

.bl-row.listed .bl-state {
    color: var(--red);
    background: var(--red-bg-soft);
    border-color: var(--red-border-soft);
}

.bl-row.unavailable .bl-state {
    color: var(--amber);
    background: var(--amber-bg);
    border-color: var(--amber-border);
}

/* --- SSL Certificate Card --------------------------------- */
/* Expiry date + issuer pill appended to the right of the health badge */
.ssl-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ssl-expiry {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
}

.ssl-issuer-tag {
    font-size: 0.72rem;
    font-family: var(--font-ui);
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1px 8px;
    white-space: nowrap;
}

/* Expandable details <details>/<summary> element */
.ssl-details {
    border: none;
}

.ssl-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--text-muted);
    list-style: none;
    user-select: none;
    transition: background 0.1s, color 0.1s;
}

/* Remove the browser's default triangle marker */
.ssl-summary::-webkit-details-marker { display: none; }
.ssl-summary::marker { display: none; }

.ssl-summary:hover {
    background: var(--surface-2);
    color: var(--text);
}

.ssl-details[open] > .ssl-summary {
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

/* Chevron arrow built from CSS borders */
.ssl-chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-top: -3px;
}

.ssl-details[open] .ssl-chevron {
    transform: rotate(-135deg);
    margin-top: 3px;
}

/* Two-column key/value grid inside the expanded panel */
.ssl-detail-grid {
    padding: 14px 20px;
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px 16px;
    align-items: start;
}

.ssl-key {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 3px;
}

.ssl-val {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-mono);
    word-break: break-all;
}

/* Fingerprint is longer so gets slightly smaller text */
.ssl-fp {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

/* "Wildcard" chip shown next to the CN when certificate is wildcard */
.ssl-chip {
    display: inline-block;
    font-size: 0.7rem;
    font-family: var(--font-ui);
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    border-radius: 20px;
    padding: 0 7px;
    margin-left: 6px;
    vertical-align: middle;
}

/* SAN list — each entry is a small pill */
.ssl-san-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ssl-san {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1px 7px;
}

/* --- Propagation Toggle ----------------------------------- */
.propagation-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
}

.propagation-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.propagation-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--border-hover);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.propagation-toggle input:checked ~ .toggle-track {
    background: var(--accent-dim);
    border-color: var(--accent-border);
}

.propagation-toggle input:checked ~ .toggle-track .toggle-thumb {
    background: var(--accent);
    transform: translateX(16px);
}

.toggle-label {
    font-size: 0.84rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.propagation-toggle input:checked ~ .toggle-label {
    color: var(--accent);
}

.propagation-toggle.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Propagation Card Rows -------------------------------- */
.prop-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 20px;
    transition: background 0.1s;
}

.prop-row + .prop-row {
    border-top: 1px solid var(--border);
}

.prop-row:hover {
    background: var(--surface-2);
}

.prop-row--diff {
    background: var(--amber-bg-faint);
}

.prop-row--diff:hover {
    background: var(--amber-bg);
}

.prop-resolver {
    font-size: 0.74rem;
    font-family: var(--font-ui);
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 82px;
    text-align: center;
    margin-top: 1px;
}

.prop-row--diff .prop-resolver {
    color: var(--amber);
    border-color: var(--amber-border);
    background: var(--amber-bg-soft);
}

.prop-row--agree .prop-resolver {
    color: var(--green);
    border-color: var(--green-border);
    background: var(--green-bg-soft);
}

.prop-value {
    flex: 1;
    min-width: 0;
}

.prop-mx-line {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prop-mx-line + .prop-mx-line {
    margin-top: 6px;
}

.prop-mx-ips {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.prop-ip-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-mono);
}

.prop-mx-ip-entry {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.prop-ip-line:last-child {
    margin-bottom: 0;
}

.prop-text-line {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-mono);
    word-break: break-all;
    margin-bottom: 3px;
}

.prop-text-line:last-child {
    margin-bottom: 0;
}

.prop-no-result {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
}

.prop-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-ui);
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.prop-badge--agree {
    background: var(--green-bg);
    border-color: var(--green-border);
    color: var(--green);
}

.prop-badge--disagree {
    background: var(--amber-bg);
    border-color: var(--amber-border);
    color: var(--amber);
}
