/* ── NetMap — Main Styles ── */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Outfit:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #060810;
  --surface: #0c1018;
  --card: #111824;
  --card-hover: #161f2e;
  --primary: #00b4d8;
  --primary-dim: rgba(0, 180, 216, 0.15);
  --primary-glow: rgba(0, 180, 216, 0.3);
  --secondary: #6366f1;
  --hop: #22c55e;
  --hop-dim: rgba(34, 197, 94, 0.2);
  --packet: #f59e0b;
  --packet-glow: rgba(245, 158, 11, 0.4);
  --error: #ef4444;
  --error-dim: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1a2332;
  --border-light: #243044;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --font-display: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Input View ── */
#input-view {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#input-view.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.input-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.input-card {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 56px;
  max-width: 600px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(0, 180, 216, 0.06);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.5;
}

/* ── Search Input ── */
.search-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  caret-color: var(--primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
  font-family: var(--font-body);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
}

.search-input:focus ~ .search-icon {
  color: var(--primary);
}

.trace-btn {
  width: 100%;
  padding: 14px 24px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: linear-gradient(135deg, var(--primary), #0096b7);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.trace-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 180, 216, 0.3);
}

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

.trace-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.trace-btn svg {
  width: 18px;
  height: 18px;
}

.examples {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.examples span {
  margin-right: 4px;
}

.example-link {
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.example-link:hover {
  color: var(--primary);
}

.example-sep {
  color: var(--border-light);
  margin: 0 6px;
}

/* ── Top Bar ── */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(6, 8, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

#top-bar.visible {
  opacity: 1;
  transform: translateY(0);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.top-bar-left .logo-icon {
  width: 28px;
  height: 28px;
}

.top-bar-left .logo-text {
  font-size: 1.3rem;
}

.top-bar-center {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.top-bar-domain {
  color: var(--text);
  font-weight: 600;
}

.top-bar-ip {
  color: var(--text-muted);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-sm {
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-sm:hover {
  color: var(--text);
  border-color: var(--border-light);
  background: var(--card-hover);
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-primary-sm {
  color: var(--bg);
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary-sm:hover {
  color: var(--bg);
  background: #00c5ec;
  border-color: #00c5ec;
}

/* ── Progress Bar ── */
#progress-bar {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 501;
  background: var(--border);
  opacity: 0;
  transition: opacity var(--transition);
}

#progress-bar.visible {
  opacity: 1;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 0 2px 2px 0;
  transition: width 0.3s ease;
}

#progress-text {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 501;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(6, 8, 16, 0.8);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity var(--transition);
  white-space: nowrap;
}

#progress-text.visible {
  opacity: 1;
}

/* ── Simulated Notice ── */
.simulated-notice {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(6, 8, 16, 0.8);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  opacity: 0;
  transition: opacity var(--transition);
  white-space: nowrap;
}

.simulated-notice.visible {
  opacity: 0.7;
}

/* ── Toast System ── */
#toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  color: var(--text);
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease forwards;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.toast-success { border-left: 3px solid var(--hop); }
.toast-error { border-left: 3px solid var(--error); }
.toast-info { border-left: 3px solid var(--primary); }
.toast-warning { border-left: 3px solid var(--warning); }

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

/* ── Responsive ── */
@media (max-width: 768px) {
  .input-card {
    padding: 32px 24px;
    border-radius: 16px;
  }
  .logo-text {
    font-size: 1.8rem;
  }
  .tagline {
    font-size: 0.85rem;
    margin-bottom: 28px;
  }
  .search-input {
    font-size: 0.9rem;
    padding: 14px 16px 14px 42px;
  }
  .top-bar-center {
    display: none;
  }
  .examples {
    font-size: 0.78rem;
  }
  .example-link {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .input-card {
    padding: 28px 18px;
    width: 95%;
  }
  .top-bar-right .btn-sm span {
    display: none;
  }
}
