/* ============================================================
   IP Lookup App — Custom CSS
   Tailwind is used via CDN; this file handles:
   - CSS custom properties (dark/light mode)
   - Skeleton loading animations
   - Custom map container
   - Toast / notification
   - Hero gradient animation
   - Micro-interactions
   ============================================================ */

/* ── Google Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-primary:      #0f172a;
  --bg-secondary:    #1e293b;
  --bg-card:         #1e293b;
  --bg-card-hover:   #263548;
  --text-primary:    #f1f5f9;
  --text-secondary:  #94a3b8;
  --text-muted:      #64748b;
  --accent:          #6366f1;
  --accent-light:    #818cf8;
  --accent-glow:     rgba(99, 102, 241, 0.3);
  --success:         #10b981;
  --warning:         #f59e0b;
  --danger:          #ef4444;
  --border:          rgba(148, 163, 184, 0.12);
  --border-accent:   rgba(99, 102, 241, 0.4);
  --shadow-card:     0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow:     0 0 40px rgba(99, 102, 241, 0.2);
  --radius:          0.875rem;
  --radius-sm:       0.5rem;
  --transition:      0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary:      #f8fafc;
  --bg-secondary:    #f1f5f9;
  --bg-card:         #ffffff;
  --bg-card-hover:   #f8fafc;
  --text-primary:    #0f172a;
  --text-secondary:  #475569;
  --text-muted:      #94a3b8;
  --accent:          #6366f1;
  --accent-light:    #4f46e5;
  --accent-glow:     rgba(99, 102, 241, 0.15);
  --border:          rgba(15, 23, 42, 0.1);
  --border-accent:   rgba(99, 102, 241, 0.3);
  --shadow-card:     0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-glow:     0 0 40px rgba(99, 102, 241, 0.1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Utility: hide ── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition);
}

[data-theme="light"] .navbar {
  background: rgba(248, 250, 252, 0.85);
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

.navbar-logo .logo-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--accent-light);
  background: var(--accent-glow);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Theme Toggle ── */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 1.1rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(20deg);
}

/* ── Hero Section ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(139,92,246,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
  pointer-events: none;
  opacity: 0.5;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  text-align: center;
  max-width: 520px;
  margin-bottom: 2.5rem;
}

/* ── IP Display Card (Hero) ── */
.ip-display-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: 1.25rem;
  padding: 2rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  min-width: min(520px, 90vw);
  margin-bottom: 2rem;
  transition: all var(--transition);
}

.ip-display-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 1.3rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.4), transparent 60%);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition);
}

.ip-display-card:hover::before { opacity: 1; }

.ip-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.ip-address {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--accent-light);
  font-family: 'Inter', monospace;
  word-break: break-all;
  transition: all var(--transition);
}

.ip-address.loaded {
  color: var(--accent-light);
}

.ip-v6,
.ip-v4 {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.25rem;
  word-break: break-all;
}

.ip-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
}

.btn-ghost {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

/* ── Alert Banner ── */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  margin-bottom: 2rem;
  max-width: min(600px, 90vw);
  animation: slideDown 0.5s ease;
}

.alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.alert-banner strong { color: #f87171; display: block; margin-bottom: 0.2rem; }
.alert-banner p { font-size: 0.875rem; color: var(--text-secondary); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Search Section ── */
.search-section {
  width: 100%;
  max-width: 560px;
  margin-bottom: 2rem;
}

.search-wrapper {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.375rem 0.375rem 0.375rem 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', monospace;
  font-size: 0.95rem;
  min-width: 0;
}

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

/* ── Info Cards Grid ── */
.cards-section {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.info-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.info-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.info-card:hover::after { transform: scaleX(1); }

.card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.card-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-rows { display: flex; flex-direction: column; gap: 0.5rem; }

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-row-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.card-row-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.card-row-value.accent { color: var(--accent-light); }
.card-row-value.success { color: var(--success); }
.card-row-value.danger  { color: var(--danger); }
.card-row-value.warning { color: var(--warning); }

/* ── VPN Detection Badge ── */
.vpn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.vpn-badge.detected {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.3);
}

.vpn-badge.clean {
  background: rgba(16,185,129,0.12);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.25);
}

/* ── Map Container ── */
.map-section {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.map-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.map-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.map-card-title {
  font-weight: 700;
  font-size: 0.95rem;
}

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

#map {
  height: 380px;
  width: 100%;
  z-index: 1;
}

/* Override Leaflet for dark mode */
[data-theme="dark"] .leaflet-tile { filter: brightness(0.75) saturate(0.7); }
[data-theme="dark"] .leaflet-container { background: #1e293b; }

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
  color: transparent !important;
  pointer-events: none;
  user-select: none;
}

.skeleton * { visibility: hidden !important; }

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

.skeleton-line {
  height: 1em;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.w-3\/4 { width: 75%; }
.skeleton-line.w-1\/2 { width: 50%; }
.skeleton-line.w-full { width: 100%; }

.skeleton-ip {
  height: 2.5rem;
  width: 240px;
  margin: 0.5rem auto;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  display: inline-block;
}

/* ── Toast Notification ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-card);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  pointer-events: all;
  max-width: 280px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity:0; transform: translateX(20px); } }

/* ── AdSense Placeholders ── */
.ad-slot {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem;
}

.ad-slot-leaderboard { height: 90px; }
.ad-slot-rectangle   { height: 250px; }
.ad-slot-banner      { height: 60px; }

/* ── VPN Affiliate Section ── */
.affiliate-section {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.affiliate-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.affiliate-icon { font-size: 3rem; }

.affiliate-content { flex: 1; min-width: 200px; }
.affiliate-content h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.affiliate-content p  { font-size: 0.875rem; color: var(--text-secondary); }

.affiliate-vpns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.vpn-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.vpn-pill:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
}

/* ── SEO Article Section ── */
.article-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.article-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
  color: var(--text-primary);
}

.article-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
  color: var(--text-primary);
}

.article-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.article-section ul, .article-section ol {
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.article-section li { margin-bottom: 0.3rem; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  transition: background var(--transition);
  user-select: none;
}

.faq-question:hover { background: var(--bg-card-hover); }

.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.faq-answer.open {
  max-height: 300px;
  padding: 1rem 1.25rem;
}

.faq-chevron {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-question.open .faq-chevron { transform: rotate(180deg); }

/* ── Footer ── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  font-weight: 500;
}

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

/* ── Hamburger / Mobile menu ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── Section divider ── */
.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ── Mobile Nav — hidden by default on ALL screen sizes ── */
.mobile-nav {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar-links { display: none; }
  .hamburger { display: flex; }

  .mobile-nav {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 99;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .mobile-nav.open { display: flex; }
  .mobile-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
  }
  .mobile-nav a:hover { background: var(--accent-glow); color: var(--accent-light); }

  .ip-display-card { padding: 1.5rem; min-width: auto; width: 100%; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  #map { height: 280px; }
  .affiliate-card { flex-direction: column; text-align: center; }
  .affiliate-vpns { justify-content: center; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .ip-actions { flex-direction: column; align-items: stretch; }
  .ip-actions .btn { justify-content: center; }
}


/* ── Animated entrance ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Copy button feedback ── */
.copy-success {
  background: var(--success) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* ════════════════════════════════════════════════════════════
   MEGA-MENU DROPDOWN
   ════════════════════════════════════════════════════════════ */
.has-dropdown { position: relative; }

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
  opacity: 0.7;
}

.has-dropdown:hover .chevron,
.has-dropdown.open   .chevron { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: 100%;           /* flush to trigger, gap bridged by padding-top below */
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem;
  padding-top: calc(0.4rem + 10px);  /* invisible bridge over the gap */
  margin-top: 0;
  min-width: 220px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown.open  .dropdown-menu {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(8px);
}

/* Arrow pointer */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--border);
  border-top: none;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: var(--accent-glow);
  color: var(--accent-light);
}

/* ════════════════════════════════════════════════════════════
   PAGE LAYOUT — 2-column (content + sidebar)
   ════════════════════════════════════════════════════════════ */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
}

.page-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.page-main  { min-width: 0; }

.page-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.sidebar-widget-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.sidebar-links a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.sidebar-links a:last-child { border-bottom: none; }
.sidebar-links a:hover { color: var(--accent-light); }

/* Page hero (tools/blog/legal) */
.page-hero {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 5.5rem 1.5rem 2.5rem;
  text-align: center;
}

.page-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.page-hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   TOOL PAGES
   ════════════════════════════════════════════════════════════ */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.tool-result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.tool-result-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.tool-result-table td {
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}

.tool-result-table td:first-child {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  width: 30%;
}

.tool-result-table tr:last-child td { border-bottom: none; }

.tool-tag {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent-light);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.35rem;
}

/* Speed test meter */
.speed-meter {
  text-align: center;
  padding: 2rem 0;
}

.speed-gauge {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent-light);
  line-height: 1;
}

.speed-unit { font-size: 1.25rem; font-weight: 500; color: var(--text-muted); }

.speed-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.speed-stat {
  text-align: center;
}

.speed-stat-value { 
  font-size: 1.5rem; 
  font-weight: 800;
  color: var(--text-primary); 
}

.speed-stat-label { 
  font-size: 0.75rem; 
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

/* Random IP output area */
.ip-output-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-family: 'Inter', monospace;
  font-size: 0.9rem;
  color: var(--accent-light);
  min-height: 120px;
  line-height: 2;
  word-break: break-all;
  white-space: pre-wrap;
}

/* ════════════════════════════════════════════════════════════
   ENHANCED SITE FOOTER (replaces simple .footer)
   ════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.footer-brand-col p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
}

.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  transition: color var(--transition);
}

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

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--accent-light);
  text-decoration: none;
}

/* ════════════════════════════════════════════════════════════
   BLOG CARD GRID
   ════════════════════════════════════════════════════════════ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.blog-card-thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--accent-glow), rgba(139,92,246,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  border-bottom: 1px solid var(--border);
}

.blog-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-tag {
  display: inline-flex;
  align-items: center;
  background: var(--accent-glow);
  color: var(--accent-light);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  width: fit-content;
}

.blog-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.blog-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════
   MOBILE NAV SECTIONS (dropdown inside mobile nav)
   ════════════════════════════════════════════════════════════ */
.mobile-section-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}

.mobile-section-toggle:hover {
  background: var(--accent-glow);
  color: var(--accent-light);
}

.mobile-section-toggle .chevron { transition: transform var(--transition); }
.mobile-section-toggle.open .chevron { transform: rotate(180deg); }

.mobile-sub-menu {
  display: none;
  flex-direction: column;
  padding-left: 1rem;
  border-left: 2px solid var(--border-accent);
  margin-left: 0.75rem;
  margin-bottom: 0.25rem;
}

.mobile-sub-menu.open { display: flex; }

.mobile-sub-menu a {
  font-size: 0.85rem !important;
  padding: 0.45rem 0.75rem !important;
}

/* ════════════════════════════════════════════════════════════
   PAGE CONTENT COMMON
   ════════════════════════════════════════════════════════════ */
.content-prose h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.content-prose h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.content-prose p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}

.content-prose ul, .content-prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

.content-prose li { margin-bottom: 0.35rem; }

.content-prose strong { color: var(--text-primary); }

.content-prose a {
  color: var(--accent-light);
  text-decoration: none;
}

.content-prose a:hover { text-decoration: underline; }

.content-prose code {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-family: monospace;
  font-size: 0.875em;
  color: var(--accent-light);
}

.content-callout {
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Form styles */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.form-control { resize: vertical; min-height: 130px; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE UPDATES
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
  .page-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .blog-grid   { grid-template-columns: 1fr; }
  .page-layout, .page-wrap { padding-top: 5rem; }
}

@media (max-width: 480px) {
  .footer-grid   { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .speed-stats   { gap: 1rem; }
}

