/* ==========================================================================
   MyIP.Tool — Modern, High-Performance Stylesheet
   Production-ready, accessible, mobile-first, and shared-hosting friendly.
   ========================================================================== */

/* ===========================
   CSS CUSTOM PROPERTIES
=========================== */
:root {
  --navy-950: #020817;
  --navy-900: #0a1628;
  --navy-850: #0d1d36;
  --navy-800: #0f2040;
  --navy-700: #142850;
  --navy-600: #1a3460;
  
  --blue-600: #165694;
  --blue-500: #1e6ab4;
  --blue-400: #2980d4;
  --blue-300: #4fa3e8;
  --blue-200: #93c5fd;
  --blue-100: #dbeafe;
  
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --accent-dark: #0891b2;
  --accent-glow: rgba(6, 182, 212, 0.25);
  
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);
  
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.12);
  --error-border: rgba(239, 68, 68, 0.3);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 36px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.65);
  
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 9999px;
  
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--navy-950);
  color: var(--white);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue-300);
  text-decoration: none;
  transition: color var(--transition), text-decoration-color var(--transition);
}

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

button {
  cursor: pointer;
  font-family: var(--font-sans);
  border: none;
  outline: none;
  background: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--white);
}

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

/* ===========================
   ACCESSIBILITY & UTILITIES
=========================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-to-content {
  position: absolute;
  top: -60px;
  left: 20px;
  background: var(--accent);
  color: var(--navy-950);
  padding: 10px 18px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 10000;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 15px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-accent { color: var(--accent); }
.text-blue { color: var(--blue-300); }
.text-muted { color: var(--gray-400); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-info    { background: rgba(6, 182, 212, 0.15); color: var(--accent); border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-error   { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-border); }

/* ===========================
   SCROLLBAR & PROGRESS BAR
=========================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--navy-900); }
::-webkit-scrollbar-thumb { background: var(--navy-700); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--blue-500); }

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  z-index: 9999;
  background: linear-gradient(90deg, var(--blue-500), var(--accent));
  transition: width 0.15s ease-out;
  width: 0%;
}

/* ===========================
   ADSENSE PLACEHOLDER UNITS
=========================== */
.ad-banner-wrap {
  background: var(--navy-900);
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.adsense-placeholder {
  width: 100%;
  min-height: 90px;
  border: 1.5px dashed rgba(100, 116, 139, 0.35);
  border-radius: var(--radius-md);
  background: rgba(15, 32, 64, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
  color: var(--gray-400);
  transition: border-color var(--transition);
}

.adsense-placeholder:hover {
  border-color: rgba(100, 116, 139, 0.6);
}

.adsense-placeholder .ad-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.adsense-placeholder .ad-title {
  font-size: 0.82rem;
  color: var(--gray-400);
  line-height: 1.4;
}

.adsense-placeholder .ad-title small {
  display: block;
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.adsense-placeholder-inline {
  width: 100%;
  min-height: 250px;
  margin: 28px 0;
}

/* ===========================
   HEADER & NAVIGATION
=========================== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(2, 8, 23, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow var(--transition);
}

#site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-500), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: white;
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.35);
}

.logo-text {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--accent);
}

.logo-sub {
  font-size: 0.68rem;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-300);
  transition: all var(--transition);
  white-space: nowrap;
}

.main-nav a:hover, .main-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.main-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.nav-cta {
  padding: 8px 18px !important;
  border-radius: var(--radius-sm) !important;
  background: linear-gradient(135deg, var(--blue-500), var(--accent)) !important;
  color: white !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

.nav-cta:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.45) !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

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

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 14px 24px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 8, 23, 0.98);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray-300);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
}

.mobile-nav a:hover, .mobile-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.mobile-nav a.active {
  color: var(--accent);
}

/* ===========================
   HERO SECTION
=========================== */
#hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, var(--navy-900) 0%, var(--navy-950) 65%, #040b1a 100%);
  padding: 72px 24px 56px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 75% 20%, rgba(30, 106, 180, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 45% 50% at 20% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 50%, black 25%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 50%, black 25%, transparent 100%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #93c5fd 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--gray-300);
  max-width: 680px;
  font-weight: 400;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-500), var(--accent));
  color: white !important;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--gray-200) !important;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white !important;
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  max-width: 800px;
}

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

.hero-stat-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
}

.hero-stat-label {
  font-size: 0.74rem;
  color: var(--gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ===========================
   SECTION COMMONS
=========================== */
section {
  padding: 64px 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  color: var(--white);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--gray-400);
  font-size: 1.02rem;
  max-width: 600px;
  line-height: 1.6;
}

.section-header {
  margin-bottom: 40px;
}

.section-header.center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===========================
   IP DASHBOARD SECTION
=========================== */
#tool {
  background: var(--navy-950);
}

.dashboard-card {
  background: linear-gradient(165deg, var(--navy-800) 0%, var(--navy-900) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-500), var(--accent), var(--blue-300));
}

.dashboard-header {
  padding: 26px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-title-group h2 {
  font-size: 1.32rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-title-group p {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  background: rgba(30, 106, 180, 0.2);
  border: 1px solid rgba(30, 106, 180, 0.45);
  color: var(--blue-300);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.btn-retry:hover {
  background: rgba(30, 106, 180, 0.35);
  color: var(--white);
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.btn-copy:hover {
  background: rgba(6, 182, 212, 0.22);
}

.btn-copy.copied {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-border);
}

.dashboard-body {
  padding: 30px 32px;
}

/* IP Hero Display */
.ip-display-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.ip-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.ip-card:hover {
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.04);
}

.ip-card-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ip-card-label span.badge {
  font-size: 0.68rem;
}

.ip-value {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.02em;
  word-break: break-all;
  min-height: 38px;
  display: flex;
  align-items: center;
}

.ip-version-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.ipv4-tag { background: rgba(30, 106, 180, 0.2); color: var(--blue-300); border: 1px solid rgba(30, 106, 180, 0.35); }
.ipv6-tag { background: rgba(6, 182, 212, 0.15); color: var(--accent); border: 1px solid rgba(6, 182, 212, 0.3); }

.ip-na {
  font-size: 0.88rem;
  color: var(--gray-400);
  font-style: italic;
  font-family: var(--font-sans);
  line-height: 1.4;
}

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

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
  color: transparent !important;
  pointer-events: none;
  min-height: 20px;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.info-item {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition);
}

.info-item:hover {
  border-color: rgba(30, 106, 180, 0.4);
  background: rgba(30, 106, 180, 0.08);
}

.info-item-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-item-label i {
  font-size: 0.82rem;
  color: var(--blue-400);
}

.info-item-value {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--white);
  word-break: break-word;
}

/* Error State */
.error-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 44px 20px;
  text-align: center;
}

.error-state.visible {
  display: flex;
}

.error-icon {
  font-size: 2.8rem;
  color: var(--error);
}

.error-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--white);
}

.error-msg {
  color: var(--gray-300);
  font-size: 0.92rem;
  max-width: 440px;
  line-height: 1.5;
}

/* Privacy Notice */
.privacy-notice {
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.privacy-notice i {
  color: var(--accent);
  margin-top: 3px;
  flex-shrink: 0;
}

.privacy-notice p {
  font-size: 0.84rem;
  color: var(--gray-300);
  line-height: 1.55;
}

.privacy-notice strong {
  color: var(--white);
}

/* ===========================
   MAP SECTION
=========================== */
#map-section {
  background: var(--navy-900);
}

.map-wrapper {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-xl);
  position: relative;
}

.map-overlay-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  background: rgba(2, 8, 23, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--warning);
  box-shadow: var(--shadow-sm);
}

#leaflet-map {
  height: 440px;
  width: 100%;
  background: var(--navy-800);
}

.map-fallback {
  height: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--gray-400);
  background: var(--navy-800);
  text-align: center;
  padding: 20px;
}

.map-fallback i {
  font-size: 2.5rem;
  color: var(--gray-500);
}

.map-fallback p {
  font-size: 0.95rem;
  max-width: 360px;
}

/* ===========================
   GENUINE ON-SITE TOOLS
=========================== */
#tools {
  background: var(--navy-950);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.tool-card {
  background: linear-gradient(165deg, var(--navy-800), var(--navy-900));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
}

.tool-card:hover {
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: var(--shadow-lg);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tool-icon-blue   { background: rgba(30, 106, 180, 0.2); color: var(--blue-300); border: 1px solid rgba(30, 106, 180, 0.4); }
.tool-icon-cyan   { background: rgba(6, 182, 212, 0.15); color: var(--accent); border: 1px solid rgba(6, 182, 212, 0.3); }
.tool-icon-green  { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.tool-icon-orange { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }

.tool-title-wrap h3 {
  font-size: 1.12rem;
  margin-bottom: 4px;
}

.tool-title-wrap .badge {
  font-size: 0.68rem;
}

.tool-card-desc {
  font-size: 0.88rem;
  color: var(--gray-400);
  line-height: 1.55;
  flex: 1;
}

/* Tool Interactive Forms */
.tool-input-group {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.tool-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  transition: border-color var(--transition);
}

.tool-input:focus {
  border-color: var(--accent);
  outline: none;
}

.tool-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--blue-500), var(--accent));
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tool-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.tool-result-box {
  background: rgba(2, 8, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.82rem;
  color: var(--gray-300);
  display: none;
}

.tool-result-box.visible {
  display: block;
}

.tool-result-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.tool-result-label {
  color: var(--gray-400);
  font-weight: 500;
}

.tool-result-val {
  font-family: var(--font-mono);
  color: var(--white);
  font-weight: 600;
}

/* Latency Ping Bars */
.ping-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.ping-ms {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

.ping-ms.good { color: var(--success); }
.ping-ms.warn { color: var(--warning); }
.ping-ms.bad  { color: var(--error); }

/* Outbound Reference Tools */
.external-tools-sub {
  margin-top: 36px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
}

.external-tools-sub h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-200);
}

.external-tools-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.external-tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-300);
  transition: all var(--transition);
}

.external-tool-item:hover {
  background: rgba(30, 106, 180, 0.15);
  border-color: rgba(30, 106, 180, 0.4);
  color: var(--white);
  transform: translateY(-2px);
}

/* ===========================
   EDUCATIONAL GUIDE
=========================== */
#guide {
  background: var(--navy-900);
}

.guide-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 48px;
  align-items: start;
}

.guide-toc {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 90px;
}

.guide-toc h3 {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 14px;
}

.guide-toc ul {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-toc li a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--gray-400);
  transition: all var(--transition);
}

.guide-toc li a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
}

.guide-content {
  min-width: 0;
}

.guide-content h2 {
  font-size: 1.55rem;
  color: var(--white);
  margin-top: 44px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-content h2:first-child {
  margin-top: 0;
}

.guide-content h2 i {
  font-size: 1.15rem;
  color: var(--accent);
}

.guide-content h3 {
  font-size: 1.15rem;
  color: var(--blue-200);
  margin-top: 24px;
  margin-bottom: 10px;
}

.guide-content p {
  color: var(--gray-300);
  line-height: 1.8;
  margin-bottom: 16px;
  font-size: 0.98rem;
}

.guide-content ul, .guide-content ol {
  padding-left: 0;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.guide-content li {
  color: var(--gray-300);
  font-size: 0.97rem;
  padding-left: 20px;
  position: relative;
  line-height: 1.7;
}

.guide-content ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
  top: 1px;
}

.guide-content ol {
  counter-reset: guide-counter;
}

.guide-content ol li {
  counter-increment: guide-counter;
}

.guide-content ol li::before {
  content: counter(guide-counter) '.';
  position: absolute;
  left: 0;
  color: var(--blue-300);
  font-weight: 700;
  font-size: 0.85rem;
}

.info-box {
  margin: 22px 0;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
}

.info-box-blue { background: rgba(30, 106, 180, 0.1); border-color: var(--blue-400); }
.info-box-cyan { background: rgba(6, 182, 212, 0.08); border-color: var(--accent); }
.info-box-warn { background: rgba(245, 158, 11, 0.08); border-color: var(--warning); }
.info-box p { margin-bottom: 0; }
.info-box strong { color: var(--white); }

.ip-example {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--accent-light);
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}

.compare-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 20px;
}

.compare-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.compare-card.v4 h4 { color: var(--blue-300); }
.compare-card.v6 h4 { color: var(--accent); }
.compare-card li { font-size: 0.88rem; color: var(--gray-400); }

/* ===========================
   FAQ SECTION
=========================== */
#faq {
  background: var(--navy-950);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 880px;
  margin: 0 auto;
}

.faq-item {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item.open {
  border-color: rgba(6, 182, 212, 0.35);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  color: var(--white);
  font-size: 1.02rem;
  font-weight: 600;
  transition: background var(--transition);
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.03);
}

.faq-question .faq-icon {
  color: var(--accent);
  flex-shrink: 0;
  transition: transform var(--transition);
  font-size: 0.9rem;
}

.faq-item.open .faq-question .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-item.open .faq-answer {
  max-height: 600px;
}

.faq-answer-inner {
  padding: 0 24px 22px;
  color: var(--gray-300);
  font-size: 0.95rem;
  line-height: 1.8;
}

.faq-answer-inner p {
  margin-bottom: 10px;
}

.faq-answer-inner p:last-child {
  margin-bottom: 0;
}

/* ===========================
   INTERNAL SUBPAGE LAYOUTS
   (About, Contact, Privacy, Terms, Disclaimer)
=========================== */
.page-hero {
  background: linear-gradient(165deg, var(--navy-900) 0%, var(--navy-950) 100%);
  padding: 60px 0 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--gray-400);
}

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

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.page-lead {
  font-size: 1.08rem;
  color: var(--gray-300);
  max-width: 720px;
  line-height: 1.6;
}

.content-section {
  padding: 56px 0 72px;
}

.article-body {
  max-width: 860px;
  margin: 0 auto;
  color: var(--gray-300);
  line-height: 1.8;
  font-size: 0.98rem;
}

.article-body h2 {
  font-size: 1.45rem;
  color: var(--white);
  margin-top: 38px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.article-body h3 {
  font-size: 1.15rem;
  color: var(--blue-200);
  margin-top: 24px;
  margin-bottom: 10px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body ul, .article-body ol {
  margin-bottom: 18px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.article-body li {
  line-height: 1.7;
}

/* Contact Page Specific */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: start;
}

.contact-card {
  background: var(--navy-900);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}

.contact-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.contact-card p {
  color: var(--gray-400);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.contact-info-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-info-text h4 {
  font-size: 0.95rem;
  color: var(--white);
}

.contact-info-text p {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gray-300);
}

.form-group input, .form-group textarea, .form-group select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: border-color var(--transition);
  width: 100%;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input::placeholder, .form-group textarea::placeholder {
  color: var(--gray-500);
}

.form-group select option {
  background: var(--navy-900);
  color: var(--white);
}

.form-submit {
  padding: 12px 26px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--blue-500), var(--accent));
  color: white;
  font-weight: 700;
  font-size: 0.92rem;
  transition: all var(--transition);
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}

.form-submit:hover {
  opacity: 0.92;
  transform: translateY(-2px);
}

/* ===========================
   FOOTER
=========================== */
#site-footer {
  background: var(--navy-950);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 56px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 44px;
  margin-bottom: 44px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--gray-400);
  line-height: 1.7;
  margin-top: 16px;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 18px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col li a {
  font-size: 0.88rem;
  color: var(--gray-400);
  transition: color var(--transition);
}

.footer-col li a:hover {
  color: var(--white);
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.84rem;
  color: var(--gray-400);
}

.footer-legal {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.footer-legal a {
  font-size: 0.84rem;
  color: var(--gray-400);
  transition: color var(--transition);
}

.footer-legal a:hover {
  color: var(--gray-200);
}

.footer-disclaimer {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--gray-500);
  line-height: 1.6;
  text-align: center;
}

/* ===========================
   RESPONSIVE DESIGN
=========================== */
@media (max-width: 1024px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }
  .guide-toc {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .ip-display-area {
    grid-template-columns: 1fr;
  }
  .dashboard-body {
    padding: 20px;
  }
  .dashboard-header {
    padding: 20px;
  }
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .hero-stats {
    gap: 24px;
  }
  section {
    padding: 48px 0;
  }
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* ===========================
   PRINT STYLES
=========================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  #site-header, #site-footer, .ad-banner-wrap, .adsense-placeholder, .btn-retry, .btn-copy, .hamburger, .mobile-nav, .progress-bar {
    display: none !important;
  }
  .dashboard-card, .tool-card, .info-item, .ip-card {
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
  }
  .ip-value, h1, h2, h3, h4 {
    color: #000000 !important;
  }
}
