:root {
  --font-sans: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Default: Midnight Purple Theme (Screenshots 2 & 3) */
  --nav-bg: #080524;
  --hero-bg-1: #0b072d;
  --hero-bg-2: #1c1355;
  --hero-bg-3: #2a1d72;
  --accent: #7c3aed;
  --accent-bright: #38bdf8;
  --accent-cyan: #22d3ee;
  --banner-bg: rgba(255, 255, 255, 0.08);
  --banner-border: rgba(255, 255, 255, 0.14);
  --dash-color: rgba(255, 255, 255, 0.14);
  --disguise-fill-good: linear-gradient(90deg, #2dd4bf, #38f9d7);
  --disguise-text-color: #062129;

  --surface: #ffffff;
  --surface-muted: #f5f7fb;
  --border-light: #e5e9f2;
  --text-dark: #16192c;
  --text-muted: #64748b;
}

/* Classic Teal Theme (Screenshot 1) */
body.theme-teal {
  --nav-bg: #051f29;
  --hero-bg-1: #072834;
  --hero-bg-2: #0c3b4a;
  --hero-bg-3: #114e60;
  --accent: #10b981;
  --accent-bright: #38bdf8;
  --accent-cyan: #22c55e;
  --disguise-fill-good: linear-gradient(90deg, #16a34a, #22c55e);
  --disguise-text-color: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--surface-muted);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--font-mono);
}

.mono-sm {
  font-family: var(--font-mono);
  font-size: 1.02rem;
}

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

/* Navbar */
.navbar {
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

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

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0 4px 0 10px;
  height: 32px;
  width: 240px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-box:focus-within {
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
  background: rgba(255, 255, 255, 0.14);
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: #ffffff;
  width: 100%;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.search-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.search-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-pill:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.16);
}

.lang-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  height: 32px;
  padding: 0 8px 0 10px;
  border-radius: 8px;
}

.lang-dropdown select {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.lang-dropdown select option {
  background: #0f172a;
  color: #ffffff;
}

.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

body.theme-teal .theme-dot {
  background: linear-gradient(135deg, #0f766e, #22c55e);
}

/* Hero */
.hero {
  background: radial-gradient(circle at 75% 20%, var(--hero-bg-3) 0%, var(--hero-bg-2) 45%, var(--hero-bg-1) 100%);
  color: #ffffff;
  padding: 20px 0 26px;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ip-headline {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 6px;
}

.flag-img {
  width: 42px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.flag-emoji {
  font-size: 2.2rem;
  line-height: 1;
}

.ip-title {
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.copy-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38bdf8;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  transform: translateY(-1px);
}

.copied-toast {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.location-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.28rem;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 18px;
}

.loc-pin-btn {
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.loc-pin-btn:hover {
  background: rgba(56, 189, 248, 0.15);
}

.error-banner {
  width: 100%;
  max-width: 820px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  text-align: center;
}

/* Status Banner */
.status-banner {
  width: 100%;
  max-width: 860px;
  background: var(--banner-bg);
  border: 1px solid var(--banner-border);
  border-radius: 999px;
  padding: 8px 12px 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  backdrop-filter: blur(8px);
}

.status-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92);
}

.engine-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.banner-btn {
  border: none;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.banner-btn.primary {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #ffffff;
}

body.theme-teal .banner-btn.primary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.banner-btn.primary:hover {
  filter: brightness(1.1);
}

.banner-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.banner-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Secure Internet Toggle */
.secure-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
}

.toggle-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  padding: 3px;
  display: flex;
  align-items: center;
  transition: background 0.2s;
}

.toggle-switch.active {
  background: #22c55e;
  justify-content: flex-end;
}

.toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Info Grid */
.info-grid {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 42px;
  margin-bottom: 18px;
}

.info-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--dash-color);
  gap: 10px;
}

.info-label {
  width: 116px;
  flex-shrink: 0;
  font-size: 1.04rem;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

.info-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.06rem;
  color: #ffffff;
  min-width: 0;
  white-space: nowrap;
}

.row-icon {
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.underline-val {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.4);
  padding-bottom: 1px;
  white-space: nowrap;
}

.country-mini {
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.78);
  margin-inline-start: 2px;
  white-space: nowrap;
}

.mini-flag {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  margin-inline-start: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

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

.status-dot.green {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.status-dot.red {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.status-dot.amber {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-blue {
  background: #2563eb;
  color: #ffffff;
}

.badge-green {
  background: #10b981;
  color: #ffffff;
}

.badge-amber {
  background: #f59e0b;
  color: #1e1b4b;
}

.badge-red {
  background: #ef4444;
  color: #ffffff;
}

/* Disguise Meter */
.disguise-wrapper {
  width: 100%;
  max-width: 1120px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.disguise-track {
  flex: 1;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.disguise-fill {
  height: 100%;
  background: var(--disguise-fill-good);
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.disguise-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.disguise-fill.warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #1e1b4b;
}

.disguise-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
  color: #ffffff;
}

.disguise-shield {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.hide-btn {
  background: transparent;
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.hide-btn:hover {
  background: rgba(56, 189, 248, 0.15);
}

/* Breakdown Section */
.breakdown-section {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 28px 0;
}

.checks-list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid #f1f5f9;
}

.check-item:last-child {
  border-bottom: none;
}

.check-badge {
  width: 92px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  flex-shrink: 0;
}

.check-badge.amber {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.check-badge.orange {
  background: linear-gradient(135deg, #f97316, #fb7185);
}

.check-badge.red {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}

.check-badge.green {
  background: linear-gradient(135deg, #10b981, #22c55e);
}

.check-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.check-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Extended Section */
.extended-section {
  padding: 40px 0 60px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--text-dark);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.detail-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.card-header h3 {
  font-size: 1.02rem;
  font-weight: 700;
}

.mini-badge {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.map-box {
  width: 100%;
  height: 210px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  z-index: 1;
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.kv-item {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
}

.kv-key {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.kv-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  word-break: break-word;
}

.flags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.flag-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.flag-chip.safe {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.flag-chip.alert {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* API Inspector */
.api-card {
  margin-top: 8px;
}

.tab-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn {
  background: #f1f5f9;
  border: 1px solid transparent;
  color: #475569;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.tab-btn.active {
  background: #1e1b4b;
  color: #ffffff;
}

.copy-json-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.json-pre {
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  max-height: 360px;
}

/* Localized SEO Guide & Latest Blog Cards on Home */
.seo-guide-card {
  margin-top: 24px;
  padding: 28px 32px;
}

.seo-guide-card h2 {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.seo-guide-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: #1e1b4b;
  margin: 18px 0 8px;
}

.seo-guide-card p {
  font-size: 0.96rem;
  line-height: 1.8;
  color: #334155;
  margin-bottom: 12px;
}

.seo-guide-card ul {
  margin: 8px 0 14px;
  padding-inline-start: 22px;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.75;
}

.seo-guide-card li {
  margin-bottom: 6px;
}

.latest-blog-wrap {
  margin-top: 28px;
}

.latest-blog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.view-all-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.94rem;
}

.view-all-link:hover {
  text-decoration: underline;
}

.home-blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.home-post-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.home-post-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.home-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.home-post-cat {
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.home-post-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

.home-post-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.home-post-more {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
}

/* Ad Slots */
.ad-slot.ad-hero {
  width: 100%;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 10px 18px;
  margin-bottom: 16px;
  color: #ffffff;
}

.ad-slot.ad-banner {
  margin-top: 18px;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 16px;
  overflow: hidden;
}

/* Footer */
.footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 20px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-admin-link {
  opacity: 0.65;
  font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .info-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .info-value {
    white-space: normal;
    flex-wrap: wrap;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .home-blog-grid {
    grid-template-columns: 1fr;
  }
  .status-banner {
    border-radius: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  .disguise-wrapper {
    flex-direction: column;
    border-radius: 16px;
  }
  .disguise-track {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .search-box {
    width: 155px;
  }
  .kv-grid {
    grid-template-columns: 1fr;
  }
}
