/* Network Diagnostics Service - Minimalist Redesign */

:root {
  --bg-primary: #0a0e1a;
  --bg-card: #1a1f2e;
  --bg-hover: #252b3d;

  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #78869a;

  --border: rgba(148, 163, 184, 0.15);
  --border-hover: rgba(148, 163, 184, 0.3);

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', Times, serif;
  --font-display: Georgia, 'Times New Roman', Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, 'Cascadia Code',
               'SFMono Mono', 'Cascadia Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(180deg, var(--bg-primary) 0%, #0f1420 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.page-wrapper {
  position: relative;
  min-height: 100vh;
}

.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--bg-primary) 0%, #0f1420 100%);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 24px;
}

.header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeInDown 0.6s ease-out;
}

.header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent), #f43f5e);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.header-icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

.header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.header .subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  min-height: 44px;
}

.nav-tab svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-tab span {
  display: none;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), #f43f5e);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

@media (min-width: 640px) {
  .nav-tab span {
    display: inline;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  animation: fadeInUp 0.6s ease-out backwards;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.status-card {
  animation-delay: 0.15s;
}

.tests-card {
  animation-delay: 0.2s;
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-title svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(148, 163, 184, 0.1);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-base);
}

.status-badge .badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  animation: blink 1.5s ease-in-out infinite;
}

.status-badge .badge-text {
  color: var(--text-secondary);
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.15);
}

.status-badge.success .badge-dot {
  background: var(--success);
  animation: none;
}

.status-badge.success .badge-text {
  color: var(--success);
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.15);
}

.status-badge.error .badge-dot {
  background: var(--error);
  animation: none;
}

.status-badge.error .badge-text {
  color: var(--error);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.status-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.status-box:hover {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border-hover);
}

.status-box.full-width {
  grid-column: 1 / -1;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(244, 63, 94, 0.1));
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.status-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.status-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.status-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-value.mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-lg {
  padding: 16px 24px;
  font-size: 0.95rem;
  flex: 1;
  min-width: 200px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #f43f5e);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 100%;
  height: 100%;
}

.btn-text {
  flex: 1;
  text-align: left;
}

.checkbox-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.checkbox-toggle:hover {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--border-hover);
}

.checkbox-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 100px;
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all var(--transition-base);
}

.checkbox-toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent), #f43f5e);
}

.checkbox-toggle input:checked + .toggle-slider::after {
  left: 23px;
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.checkbox-toggle input:checked ~ .toggle-label {
  color: var(--text-primary);
}

.results-panel {
  margin-top: 24px;
  padding: 24px;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.results-panel.visible {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.results-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.results-header h3 svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.results-badge {
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(244, 63, 94, 0.1));
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.results-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition-base);
}

.metric-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.metric-card.featured {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(244, 63, 94, 0.1));
  border-color: rgba(99, 102, 241, 0.3);
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.metric-card.featured .metric-value {
  color: var(--accent);
  font-size: 1.5rem;
}

.metric-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Hop Details Table */
.hop-details {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.hops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.hops-table th,
.hops-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.hops-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 1;
}

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

.hops-table tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.hops-table td:nth-child(1) {
  width: 50px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
}

.hops-table td:nth-child(2) {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.hops-table td:nth-child(3) {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hops-table td:nth-child(4) {
  color: var(--text-muted);
}

.hops-table td:nth-child(5) {
  font-family: var(--font-mono);
  color: var(--primary-start);
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.6s ease-out 0.3s backwards;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-content svg {
  width: 24px;
  height: 24px;
  opacity: 0.5;
  flex-shrink: 0;
}

.map-attribution {
  margin-top: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.map-attribution a {
  color: var(--text-secondary);
  text-decoration: none;
}

.map-attribution a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Privacy Policy - Editorial/Legal Design */
.privacy-content {
  background: var(--bg-card);
  padding: 48px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  animation: fadeInUp 0.6s ease-out;
  line-height: 1.9;
  max-width: 680px;
  margin: 0 auto;
}

.privacy-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.privacy-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.privacy-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-style: italic;
  font-family: var(--font-serif);
}

.privacy-content h1 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: 0.01em;
  display: none; /* Hidden - using page title only */
}

.privacy-section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.privacy-section:last-of-type {
  border-bottom: none;
  margin-bottom: 24px;
  padding-bottom: 0;
}

.privacy-content h2 {
  display: flex;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}

.privacy-content h2 svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-right: 12px;
}

.privacy-content > .privacy-section > p:first-of-type::first-letter {
  font-family: var(--font-serif);
  font-size: 3.5em;
  float: left;
  line-height: 0.8;
  padding-right: 12px;
  padding-top: 4px;
  color: var(--accent);
  font-weight: 500;
}

.privacy-list {
  margin: 20px 0 20px 8px;
  color: var(--text-secondary);
}

.privacy-list li {
  margin-bottom: 14px;
  line-height: 1.85;
}

/* List items with icons get flex layout */
.privacy-list li:has(.list-icon) {
  display: flex;
  align-items: flex-start;
}

.privacy-list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.list-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

.list-icon svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.privacy-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-serif);
  font-style: italic;
}

.privacy-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.97rem;
}

.privacy-content ul {
  margin: 20px 0 20px 8px;
  color: var(--text-secondary);
}

.privacy-content li {
  margin-bottom: 14px;
  line-height: 1.85;
  font-size: 0.97rem;
}

.contact-email {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  border-bottom: 1px solid transparent;
}

.contact-email:hover {
  color: #f43f5e;
  border-bottom-color: #f43f5e;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .privacy-content {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  .privacy-header h1 {
    font-size: 1.6rem;
  }

  .privacy-content > .privacy-section > p:first-of-letter {
    font-size: 2.8em;
  }

  .privacy-content h2 {
    font-size: 1.05rem;
  }
}

.contact-email:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
  transition: all var(--transition-base);
  animation: fadeInUp 0.5s ease-out backwards;
}

.stat-card-1 { animation-delay: 0.1s; }
.stat-card-2 { animation-delay: 0.2s; }
.stat-card-3 { animation-delay: 0.3s; }
.stat-card-4 { animation-delay: 0.4s; }
.stat-card-5 { animation-delay: 0.5s; }

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-card .value {
  display: block;
  font-size: 2.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #f43f5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1;
}

.stat-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.server-location {
  background: rgba(148, 163, 184, 0.05);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 32px;
  text-align: center;
}

.server-location .location {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.country-results {
  margin-top: 24px;
}

.view-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

/* Queue Status Card */
.queue-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  animation: fadeInUp 0.6s ease-out backwards;
}

.queue-status-card.hidden {
  display: none !important;
}

.queue-info p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.queue-info .queue-position,
.queue-info .estimated-wait,
.queue-info .active-count {
  font-weight: 700;
  color: var(--accent);
}

/* Map Container */
.map-container {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  padding: 16px;
}

.world-map {
  width: 100%;
  height: auto;
  display: block;
}

.country {
  fill: #1e293b;
  stroke: #334155;
  stroke-width: 0.5;
  transition: fill 0.2s ease;
  cursor: pointer;
}

.country:hover {
  fill: var(--accent);
  stroke: var(--accent);
}

.map-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  display: none;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-xl);
  max-width: 400px;
  width: 90%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease-out;
}

.modal-content h2 {
  margin-bottom: 16px;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-content > p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.captcha-question {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin: 20px 0;
  text-align: center;
  font-family: var(--font-mono);
}

.modal-content input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.modal-content input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.modal-actions .btn {
  flex: 1;
}

.error-message {
  color: var(--error);
  margin-top: 12px;
  font-size: 0.9rem;
  text-align: center;
}

.error-message.hidden {
  display: none;
}

.map-container {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.map-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}

#world-map {
  width: 100%;
  height: 100%;
}

#world-map .country-path {
  fill: #1e293b;
  stroke: #334155;
  stroke-width: 0.5;
  transition: fill var(--transition-fast);
}

#world-map .country-path:hover {
  fill: var(--accent);
  cursor: pointer;
  stroke: var(--accent);
}

#world-map .country-path[data-ping] {
  pointer-events: auto;
}

.map-tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  box-shadow: var(--shadow-lg);
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 100;
  color: var(--text-primary);
  display: none;
  white-space: nowrap;
}

.table-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}


.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-btn:hover {
  background: var(--bg-hover);
}

.toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.table-view {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.country-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.country-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.country-item:hover {
  background: var(--bg-hover);
}

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

.country-flag {
  font-size: 1.4rem;
  margin-right: 14px;
}

.country-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.country-stats {
  text-align: right;
}

.country-stats .ping {
  display: block;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.country-stats .count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Skeleton loading */
.skeleton {
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--bg-hover) 50%,
    var(--bg-card) 100%
  );
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to { transform: translateX(0); }
}

.skeleton-bar {
  height: 16px;
  width: 100%;
}

.skeleton-text {
  height: 20px;
  width: 60%;
}

/* Focus indicators */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
.toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Responsive Design */
@media (max-width: 639px) {
  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom)) 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 100;
  }

  .nav-tab {
    flex-direction: column;
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .nav-tab svg {
    width: 24px;
    height: 24px;
  }

  .container {
    padding-bottom: 80px;
  }

  .container {
    padding: 24px 16px;
  }

  .header {
    margin-bottom: 32px;
  }

  .header-icon {
    width: 56px;
    height: 56px;
  }

  .header-icon svg {
    width: 28px;
    height: 28px;
  }

  .header h1 {
    font-size: 1.6rem;
  }

  .card {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .status-box {
    padding: 16px;
  }

  .test-actions {
    flex-direction: column;
  }

  .btn-lg {
    width: 100%;
    min-width: auto;
  }

  .checkbox-toggle {
    padding: 14px 16px;
  }

  .toggle-label {
    font-size: 0.85rem;
  }

  .results-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card.featured {
    grid-column: 1 / -1;
  }

  .metric-value {
    font-size: 1.1rem;
  }

  .metric-card.featured .metric-value {
    font-size: 1.3rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 8px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card .value {
    font-size: 1.75rem;
  }
}

@media (max-width: 400px) {
  .nav-tab span {
    display: none;
  }

  .results-metrics {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  .skeleton::after {
    animation: none;
    background: var(--bg-hover);
  }
}
