/* ============================================================
   Hostking DNS Propagation Checker — style.css
   ============================================================ */

:root {
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1a202c;
  --color-text-muted: #64748b;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-success: #16a34a;
  --color-success-bg: #dcfce7;
  --color-danger: #dc2626;
  --color-danger-bg: #fee2e2;
  --color-warning: #d97706;
  --color-warning-bg: #fef3c7;
  --color-header-bg: #1e293b;
  --color-footer-bg: #1e293b;
  --color-footer-link: #60a5fa;
  --color-footer-text: #94a3b8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07);
  --transition: 0.2s ease;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Courier New', Courier, monospace;
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-success-bg: #052e16;
  --color-danger-bg: #450a0a;
  --color-warning-bg: #431407;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }
.container { max-width: 900px; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header { background: var(--color-header-bg); padding: 1rem 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-md); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 0.5rem; }
.brand-name { color: #f8fafc; font-size: 1.2rem; font-weight: 700; }
.brand-tag { color: #93c5fd; font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.theme-toggle { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background var(--transition); }
.theme-toggle:hover { background: rgba(255,255,255,.2); }

/* Main */
.main { flex: 1; padding: 2.5rem 0; }
.hero { text-align: center; margin-bottom: 2rem; }
.hero h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.hero-sub { color: var(--color-text-muted); font-size: 1rem; max-width: 600px; margin: 0 auto; }

/* Card */
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; transition: background var(--transition), border-color var(--transition); }

/* Form */
.form-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.input-group { flex: 1; min-width: 200px; }
.text-input { width: 100%; padding: 0.7rem 1rem; font-size: 1rem; border: 2px solid var(--color-border); border-radius: 8px; background: var(--color-bg); color: var(--color-text); font-family: var(--mono); outline: none; transition: border-color var(--transition); }
.text-input:focus { border-color: var(--color-primary); }
.select-input { padding: 0.7rem 0.9rem; font-size: 0.95rem; border: 2px solid var(--color-border); border-radius: 8px; background: var(--color-surface); color: var(--color-text); cursor: pointer; outline: none; height: 100%; transition: border-color var(--transition); }
.select-input:focus { border-color: var(--color-primary); }

.btn { padding: 0.7rem 1.4rem; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; border: 2px solid transparent; transition: background var(--transition), opacity var(--transition); display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm { background: transparent; border-color: var(--color-border); color: var(--color-text-muted); font-size: 0.82rem; padding: 0.4rem 0.9rem; }
.btn-sm:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; }
.loading .btn-text { display: none; }
.loading .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.quick-types { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.quick-label { font-size: 0.8rem; color: var(--color-text-muted); }
.quick-btn { padding: 0.25rem 0.65rem; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--color-border); border-radius: 99px; background: transparent; color: var(--color-text-muted); cursor: pointer; transition: all var(--transition); font-family: var(--mono); }
.quick-btn:hover, .quick-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Progress */
.progress-card { padding: 1.2rem 1.5rem; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; font-size: 0.9rem; }
.progress-count { font-family: var(--mono); font-size: 0.85rem; color: var(--color-text-muted); }
.progress-bar-wrap { height: 8px; background: var(--color-border); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--color-primary); border-radius: 99px; transition: width 0.3s ease; }

/* Summary card */
.summary-card { padding: 1.25rem 1.5rem; }
.summary-inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.summary-donut { position: relative; flex-shrink: 0; }
.donut-svg { transform: rotate(-90deg); }
.donut-bg { fill: none; stroke: var(--color-border); stroke-width: 8; }
.donut-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.donut-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-pct { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.donut-sub { font-size: 0.65rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.summary-details { flex: 1; min-width: 200px; }
.summary-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.25rem; }
.summary-domain { font-family: var(--mono); color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 0.75rem; }
.summary-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 1.2rem; font-weight: 700; font-family: var(--mono); }
.stat-label { font-size: 0.75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value.success { color: var(--color-success); }
.stat-value.danger  { color: var(--color-danger); }

.majority-value { margin-top: 0.75rem; padding: 0.6rem 0.9rem; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.82rem; }
.majority-label { color: var(--color-text-muted); font-size: 0.75rem; margin-bottom: 0.2rem; }
.majority-val { font-family: var(--mono); word-break: break-all; }

.summary-actions { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }

/* Results table */
.results-card { padding: 1.25rem 1.5rem; }
.results-title { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.table-wrap { overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.results-table th { text-align: left; padding: 0.5rem 0.75rem; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); border-bottom: 2px solid var(--color-border); white-space: nowrap; }
.results-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table tbody tr:hover { background: rgba(37,99,235,.03); }

.resolver-name { font-weight: 600; }
.resolver-ip   { font-family: var(--mono); font-size: 0.78rem; color: var(--color-text-muted); }
.record-value  { font-family: var(--mono); font-size: 0.82rem; word-break: break-all; }
.ttl-cell      { font-family: var(--mono); font-size: 0.8rem; color: var(--color-text-muted); white-space: nowrap; }
.ms-cell       { font-family: var(--mono); font-size: 0.8rem; white-space: nowrap; }

.status-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.status-badge.ok       { background: var(--color-success-bg); color: var(--color-success); }
.status-badge.mismatch { background: var(--color-warning-bg); color: var(--color-warning); }
.status-badge.fail     { background: var(--color-danger-bg);  color: var(--color-danger); }

/* Info card */
.info-card h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.info-card h3 { font-size: 0.95rem; margin: 1rem 0 0.5rem; }
.info-card p  { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.tips-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.tips-list li { font-size: 0.88rem; color: var(--color-text-muted); padding-left: 1.4rem; position: relative; }
.tips-list li::before { content: '✓'; position: absolute; left: 0; color: var(--color-success); font-weight: 700; }

/* Footer */
.site-footer { background: var(--color-footer-bg); color: var(--color-footer-text); padding: 2rem 0; text-align: center; margin-top: auto; }
.site-footer p { font-size: 0.85rem; margin-bottom: 0.75rem; }
.site-footer strong { color: #f1f5f9; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 0.75rem; }
.footer-links a { color: var(--color-footer-link); text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { opacity: 0.8; text-decoration: underline; }
.footer-license { font-size: 0.8rem; }
.footer-license a { color: var(--color-footer-link); }

/* Toast */
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(1rem); background: #1e293b; color: #f1f5f9; padding: 0.7rem 1.5rem; border-radius: 99px; font-size: 0.9rem; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease; z-index: 1000; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.6rem; }
  .form-row { flex-direction: column; }
  .input-group, .select-input, .btn-primary { width: 100%; }
  .summary-inner { flex-direction: column; align-items: flex-start; }
}
