/* ============================================================
   Zeytoon.Dev — Shared Stylesheet
   All pages link to this file via: <link rel="stylesheet" href="/css/style.css">
   ============================================================ */

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

:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #1c2330;
  --border:      #30363d;
  --accent:      #58a6ff;
  --accent-dim:  #1f3f6e;
  --accent-glow: rgba(88,166,255,.15);
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --green:       #3fb950;
  --green-bg:    #0f3323;
  --green-border:#1a5c3a;
  --red:         #f85149;
  --red-bg:      #2d1215;
  --red-border:  #6e2229;
  --yellow:      #d29922;
  --yellow-bg:   #2d2208;
  --yellow-border:#6e4f0a;
  --orange:      #e3842a;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --nav-h:       58px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ──────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(22,27,34,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin-right: 16px;
  flex-shrink: 0;
}
.nav-logo-mark {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent), #a371f7);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  letter-spacing: -.02em;
}
.nav-logo-text {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -.01em;
}
.nav-logo-text span { color: var(--accent); }

/* Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}
.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}
.nav-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: .75;
}
.nav-link.active svg { opacity: 1; }

/* ── Page wrapper ────────────────────────────────────────────── */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 16px 80px;
}

/* ── Page header ─────────────────────────────────────────────── */
.page-header {
  text-align: center;
  margin-bottom: 36px;
  max-width: 640px;
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.page-title {
  font-size: clamp(22px, 5vw, 36px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin-bottom: 10px;
}
.page-title span { color: var(--accent); }

.page-desc {
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Search / Input row ──────────────────────────────────────── */
.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 640px;
  margin-bottom: 32px;
}

.input {
  flex: 1 1 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  transition: border-color .2s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus { border-color: var(--accent); }
.input.error { border-color: var(--red); }

.select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
}
.select:focus { border-color: var(--accent); }

.btn {
  background: var(--accent);
  color: #0d1117;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--text); border-color: var(--text-muted); background: var(--surface2); }

/* ── Output / result area ────────────────────────────────────── */
#output {
  width: 100%;
  max-width: 640px;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status boxes ────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid;
}
.alert-error   { background: var(--red-bg);    border-color: var(--red-border); }
.alert-success { background: var(--green-bg);  border-color: var(--green-border); }
.alert-warn    { background: var(--yellow-bg); border-color: var(--yellow-border); }
.alert .icon   { font-size: 20px; flex-shrink: 0; }
.alert strong  { display: block; margin-bottom: 3px; font-size: 14px; }
.alert p       { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.alert-error   strong { color: var(--red); }
.alert-success strong { color: var(--green); }
.alert-warn    strong { color: var(--yellow); }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Field rows ──────────────────────────────────────────────── */
.fields { padding: 6px 0; }
.field {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 8px 14px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--surface2);
  align-items: start;
}
.field:last-child { border-bottom: none; }
.field-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding-top: 1px;
}
.field-value {
  color: var(--text);
  font-size: 14px;
  word-break: break-word;
}
.field-value.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.field-value .null { color: var(--text-muted); font-style: italic; }

/* ── Pill / tag ──────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}
.pill-green  { background: var(--green-bg);  color: var(--green);  border-color: var(--green-border); }
.pill-red    { background: var(--red-bg);    color: var(--red);    border-color: var(--red-border); }
.pill-yellow { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }
.pill-blue   { background: var(--accent-dim); color: var(--accent); border-color: #2d5fa0; }

/* ── Tag list (nameservers etc.) ─────────────────────────────── */
.tag-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.tag-list li {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 13px;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--accent);
}

/* ── Card footer ─────────────────────────────────────────────── */
.card-footer {
  padding: 11px 22px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Collapsible section ─────────────────────────────────────── */
.collapsible-toggle {
  width: 100%;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-align: left;
}
.collapsible-toggle:hover { background: var(--surface2); }
.collapsible-toggle .chevron { transition: transform .2s; }
.collapsible-toggle.open .chevron { transform: rotate(180deg); }
.collapsible-body { display: none; padding: 0 22px 18px; }
.collapsible-body.open { display: block; }

pre.raw {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  overflow-x: auto;
  max-height: 360px;
  overflow-y: auto;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--surface2);
  vertical-align: top;
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ── Progress / score bar ────────────────────────────────────── */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
}
.score-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}
.score-bar-fill.green  { background: var(--green); }
.score-bar-fill.yellow { background: var(--yellow); }
.score-bar-fill.red    { background: var(--red); }
.score-label { font-size: 13px; font-weight: 700; min-width: 52px; text-align: right; }

/* ── Home: tool grid ─────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 900px;
  margin-top: 12px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, transform .15s, box-shadow .15s;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(88,166,255,.12);
}
.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.tool-card-icon svg { width: 20px; height: 20px; }
.tool-card h3 { font-size: 14px; font-weight: 700; }
.tool-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.45; }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 18px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Utilities ───────────────────────────────────────────────── */
.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;
}
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-yellow { color: var(--yellow); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.flex  { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.fw-bold { font-weight: 700; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  .field {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .field-label {
    font-size: 10px;
  }
  .search-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}
