/**
 * IP Lookup Tool — Styles
 * All selectors scoped under .ipl-wrap to prevent theme conflicts.
 */

/* ── VARIABLES ── */
.ipl-wrap {
  --contrast:       #0f172a;
  --contrast-2:     #1e293b;
  --contrast-3:     #475569;
  --contrast-4:     #334155;
  --base:           #f1f5f9;
  --base-2:         #f8fafc;
  --base-3:         #ffffff;
  --accent:         #007aff;
  --accent-hover:   #0066cc;
  --accent-active:  #0056cc;
  --border-color:   #e2e8f0;
  --note-bg:        #eff6ff;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--contrast);
  line-height: 1.7;
  max-width: 820px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

.ipl-wrap *,
.ipl-wrap *::before,
.ipl-wrap *::after {
  box-sizing: border-box;
}

/* ── HERO ── */
.ipl-hero {
  text-align: center;
  padding: 20px 0 40px;
}

.ipl-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--note-bg);
  border: 1px solid #c5dcf7;
  border-radius: 100px;
  padding: 7px 18px;
  margin-bottom: 20px;
}

.ipl-badge svg {
  flex-shrink: 0;
}

.ipl-wrap h1.ipl-title {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--contrast);
  margin: 0 0 12px;
  padding: 0;
  letter-spacing: -0.5px;
}

.ipl-subtitle {
  font-size: 16px;
  color: var(--contrast-3);
  max-width: 540px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* ── IP CARD ── */
.ipl-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--base-3);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: box-shadow 0.4s ease;
}

.ipl-card.ipl-active {
  box-shadow: 0 12px 48px rgba(0,122,255,0.1), 0 4px 12px rgba(0,0,0,0.04);
}

.ipl-card-main {
  padding: 32px 28px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.ipl-card-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--contrast-3);
  margin: 0 0 12px;
}

.ipl-ip-value {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: break-all;
  margin: 0;
}

.ipl-ip-value.ipl-loading {
  color: var(--contrast-3);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 3px;
  font-family: inherit;
}

/* Loading dots */
.ipl-dots span {
  animation: iplDotPulse 1.4s infinite both;
}

.ipl-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.ipl-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes iplDotPulse {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

/* ── BUTTONS ── */
.ipl-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.ipl-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.ipl-btn-primary {
  background: var(--accent);
  color: #fff;
}

.ipl-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,122,255,0.25);
}

.ipl-btn-secondary {
  background: var(--base);
  color: var(--contrast-3);
  border: 1px solid var(--border-color);
}

.ipl-btn-secondary:hover {
  background: var(--border-color);
  transform: translateY(-1px);
}

.ipl-btn:active {
  transform: translateY(0) !important;
}

/* ── DETAILS GRID ── */
.ipl-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
}

.ipl-detail {
  padding: 18px 20px;
  border-right: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  transition: background 0.2s;
}

.ipl-detail:hover {
  background: var(--base-2);
}

.ipl-detail:nth-child(3n) {
  border-right: none;
}

.ipl-detail:last-child {
  border-right: none;
}

.ipl-detail-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 14px;
}

.ipl-icon-loc    { background: #ecfdf5; }
.ipl-icon-isp    { background: var(--note-bg); }
.ipl-icon-device { background: #fffbeb; }
.ipl-icon-type   { background: #f5f3ff; }
.ipl-icon-tz     { background: #fef2f2; }

.ipl-detail-key {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--contrast-3);
  margin: 0 0 3px;
}

.ipl-detail-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--contrast);
  word-break: break-word;
  margin: 0;
  line-height: 1.5;
}

.ipl-detail-val.ipl-pending {
  color: var(--contrast-3);
  font-weight: 400;
  font-size: 13px;
}

/* ── TOAST ── */
.ipl-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: var(--contrast, #0f172a);
  color: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
}

.ipl-toast.ipl-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── CHARACTER ANIMATION ── */
.ipl-char {
  display: inline-block;
  animation: iplCharIn 0.3s ease-out forwards;
  opacity: 0;
}

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

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .ipl-details {
    grid-template-columns: 1fr 1fr;
  }

  .ipl-detail {
    border-right: none;
  }

  .ipl-detail:nth-child(odd) {
    border-right: 1px solid var(--border-color);
  }

  .ipl-detail:last-child {
    border-right: none;
  }

  .ipl-card-main {
    padding: 24px 20px 20px;
  }
}
