/* === Catppuccin Mocha Palette === */
:root {
  --ctp-rosewater: #f5e0dc;
  --ctp-flamingo: #f2cdcd;
  --ctp-pink: #f5c2e7;
  --ctp-mauve: #cba6f7;
  --ctp-red: #f38ba8;
  --ctp-maroon: #eba0ac;
  --ctp-peach: #fab387;
  --ctp-yellow: #f9e2af;
  --ctp-green: #a6e3a1;
  --ctp-teal: #94e2d5;
  --ctp-sky: #89dceb;
  --ctp-sapphire: #74c7ec;
  --ctp-blue: #89b4fa;
  --ctp-lavender: #b4befe;
  --ctp-text: #cdd6f4;
  --ctp-subtext1: #bac2de;
  --ctp-subtext0: #a6adc8;
  --ctp-overlay2: #9399b2;
  --ctp-overlay1: #7f849c;
  --ctp-overlay0: #6c7086;
  --ctp-surface2: #585b70;
  --ctp-surface1: #45475a;
  --ctp-surface0: #313244;
  --ctp-base: #1e1e2e;
  --ctp-mantle: #181825;
  --ctp-crust: #11111b;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--ctp-base);
  color: var(--ctp-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* === Floating particles background === */
.bg-particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 0.08; }
  90% { opacity: 0.08; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* === Layout === */
.container {
  position: relative; z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* === Header (removed — clean minimal look) === */

/* === Ad Banner === */
.adsbygoogle {
  display: block;
}

.ad-slot {
  background: var(--ctp-surface0);
  border: 1px dashed var(--ctp-surface2);
  border-radius: 12px;
  text-align: center;
  color: var(--ctp-overlay0);
  font-size: 0.75rem;
  padding: 1rem;
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot-leaderboard { min-height: 90px; }
.ad-slot-top { margin-top: 1rem; }
.ad-slot-rectangle { min-height: 250px; max-width: 336px; margin-left: auto; margin-right: auto; }

/* === IP Card + Dog Row === */
.ip-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.ip-card {
  background: linear-gradient(135deg, var(--ctp-surface0), var(--ctp-mantle));
  border: 1px solid var(--ctp-surface1);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  flex: 1;
  min-width: 0;
}
.ip-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ctp-pink), var(--ctp-mauve), var(--ctp-blue), var(--ctp-teal));
}
.ip-label {
  font-size: 0.85rem;
  color: var(--ctp-overlay1);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}
.ip-address-row {
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.6s ease-out;
}
.ip-address {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  align-items: center;
  text-align: center;
}
.ip-address-line {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  color: var(--ctp-text);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}
.ip-address-line:hover,
.ip-address-line:focus-visible {
  color: var(--ctp-blue);
  transform: translateY(-1px);
  outline: none;
}
.ip-address-line:hover .ip-address-value,
.ip-address-line:focus-visible .ip-address-value {
  color: currentColor;
}
.ip-address-line.is-unavailable,
.ip-address-line:disabled {
  cursor: default;
  opacity: 0.65;
}
.ip-address-line.is-unavailable:hover,
.ip-address-line.is-unavailable:focus-visible,
.ip-address-line:disabled:hover,
.ip-address-line:disabled:focus-visible {
  color: var(--ctp-text);
  transform: none;
}
.ip-address-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ctp-overlay1);
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.ip-address-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  word-break: break-all;
  line-height: 1.15;
}
.ip-address-line.ipv6-line .ip-address-value {
  font-size: 1rem;
  color: var(--ctp-subtext0);
}
.ip-copy-hint {
  margin-top: 0.75rem;
  min-height: 1.2rem;
  font-size: 0.82rem;
  color: var(--ctp-green);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ip-copy-hint.visible {
  opacity: 1;
}
.ip-learn-btn {
  margin-top: 0.6rem;
  background: none;
  border: none;
  color: var(--ctp-blue);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}
.ip-learn-btn:hover { color: var(--ctp-lavender); }

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(17,17,27,0.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1.5rem;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
  background: var(--ctp-mantle);
  border: 1px solid var(--ctp-surface1);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.3s ease-out;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
@keyframes modalIn {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-close {
  position: absolute; top: 1rem; right: 1.2rem;
  background: var(--ctp-surface0);
  border: 1px solid var(--ctp-surface2);
  color: var(--ctp-subtext1);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--ctp-surface2); color: var(--ctp-text); }
.modal-copy-title {
  font-size: 1.3rem;
  color: var(--ctp-lavender);
  margin-bottom: 1rem;
}
.modal-copy-heading {
  font-size: 1.05rem;
  color: var(--ctp-blue);
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}
.modal-copy-paragraph {
  color: var(--ctp-subtext0);
  line-height: 1.7;
  font-size: 0.92rem;
  margin-bottom: 0.8rem;
}
.modal-copy-paragraph-last {
  margin-bottom: 0;
}
/* scrollbar inside modal */
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: var(--ctp-surface2); border-radius: 3px; }

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

/* === Details Grid === */
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.detail-item {
  background: var(--ctp-mantle);
  border: 1px solid var(--ctp-surface0);
  border-radius: 14px;
  padding: 1.2rem;
  animation: fadeInUp 0.5s ease-out both;
}
.detail-item:nth-child(1) { animation-delay: 0.1s; }
.detail-item:nth-child(2) { animation-delay: 0.15s; }
.detail-item:nth-child(3) { animation-delay: 0.2s; }
.detail-item:nth-child(4) { animation-delay: 0.25s; }
.detail-item:nth-child(5) { animation-delay: 0.3s; }
.detail-item:nth-child(6) { animation-delay: 0.35s; }
.detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ctp-overlay0);
  margin-bottom: 0.3rem;
}
.detail-value {
  font-size: 1rem;
  color: var(--ctp-text);
  font-weight: 500;
}
.detail-value.highlight { color: var(--ctp-peach); }

/* === Map Section === */
.map-section {
  margin-top: 1.5rem;
}
.map-section h2 {
  font-size: 1.1rem;
  color: var(--ctp-subtext1);
  margin-bottom: 0.8rem;
  font-weight: 500;
}
#map {
  height: 320px;
  border-radius: 16px;
  border: 1px solid var(--ctp-surface1);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

/* Leaflet dark theme overrides */
.leaflet-container { background: var(--ctp-crust) !important; }
.leaflet-control-zoom a {
  background: var(--ctp-surface0) !important;
  color: var(--ctp-text) !important;
  border-color: var(--ctp-surface1) !important;
}
.leaflet-control-attribution {
  background: rgba(30,30,46,0.85) !important;
  color: var(--ctp-overlay0) !important;
  font-size: 0.65rem !important;
}
.leaflet-control-attribution a { color: var(--ctp-blue) !important; }
.map-pin {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.map-popup-label { color: #1e1e2e; }

/* === Pixel Dog (floats to the right of IP card) === */
.dog-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}
.speech-bubble {
  background: var(--ctp-surface0);
  border: 2px solid var(--ctp-mauve);
  border-radius: 16px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.6rem;
  position: relative;
  max-width: 200px;
  text-align: center;
  animation: bubblePop 0.4s ease-out;
  font-size: 0.85rem;
  color: var(--ctp-text);
}
.speech-bubble-meta {
  font-size: 0.72rem;
  color: var(--ctp-overlay1);
}
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--ctp-mauve);
}
@keyframes bubblePop {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.pixel-dog {
  image-rendering: pixelated;
  width: 80px;
  height: 80px;
  animation: dogBounce 1.2s ease-in-out infinite;
}
@keyframes dogBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Tail wag on the SVG */
.dog-tail {
  animation: wagTail 0.4s ease-in-out infinite alternate;
  transform-origin: 4px 20px;
}
@keyframes wagTail {
  0% { transform: rotate(-15deg); }
  100% { transform: rotate(15deg); }
}

/* === Info Section (SEO content — visually hidden, accessible to crawlers) === */
.info-section {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--ctp-mantle);
  border-radius: 16px;
  border: 1px solid var(--ctp-surface0);
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
.info-section h2 {
  font-size: 1.3rem;
  color: var(--ctp-lavender);
  margin-bottom: 1rem;
}
.info-section h3 {
  font-size: 1.05rem;
  color: var(--ctp-blue);
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}
.info-section p {
  color: var(--ctp-subtext0);
  line-height: 1.7;
  font-size: 0.92rem;
  margin-bottom: 0.8rem;
}

/* === Footer === */
footer {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--ctp-surface0);
  color: var(--ctp-overlay0);
  font-size: 0.8rem;
}
footer a { color: var(--ctp-blue); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* === Loading === */
.loading-skeleton {
  background: linear-gradient(90deg, var(--ctp-surface0), var(--ctp-surface1), var(--ctp-surface0));
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  color: transparent !important;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* === Responsive === */
@media (max-width: 600px) {
  .ip-address-value { font-size: 1.3rem; }
  .ip-address-line.ipv6-line .ip-address-value { font-size: 0.88rem; }
  .container { padding: 1.5rem 1rem; }
  #map { height: 240px; }
  .details-grid { grid-template-columns: 1fr 1fr; }
  .ip-row { flex-direction: column; }
  .speech-bubble { max-width: 250px; }
}
