/* BGP Live Tools — light, colorful, professional */
.bgp-lt-app,
.bgp-lt-tool,
.bgp-lt-admin {
  --bgp-bg: #f4f7fb;
  --bgp-card: #ffffff;
  --bgp-fg: #0f172a;
  --bgp-muted: #475569;
  --bgp-subtle: #64748b;
  --bgp-border: #d0dbe8;
  --bgp-primary: #0d9488;
  --bgp-accent: #2563eb;
  --bgp-soft: #ccfbf1;
  --bgp-radius: 14px;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  color: var(--bgp-fg);
}

.bgp-lt-tool {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 1.25rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--bgp-bg) 100%);
  border: 1px solid var(--bgp-border);
  border-radius: calc(var(--bgp-radius) + 4px);
  box-shadow: 0 8px 30px rgb(15 23 42 / 0.06);
}

.bgp-lt-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bgp-lt-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bgp-lt-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, #5eead4, var(--bgp-primary) 55%, var(--bgp-accent));
  box-shadow: 0 4px 14px rgb(13 148 136 / 0.35);
}

.bgp-lt-brand strong {
  display: block;
  font-family: "Outfit", "DM Sans", sans-serif;
  font-size: 1.05rem;
}

.bgp-lt-brand span {
  display: block;
  font-size: 0.75rem;
  color: var(--bgp-subtle);
}

.bgp-lt-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.bgp-lt-input {
  flex: 1 1 220px;
  min-height: 46px;
  border: 1px solid var(--bgp-border);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92rem;
  background: #fff;
  color: var(--bgp-fg);
}

.bgp-lt-input:focus {
  outline: none;
  border-color: var(--bgp-primary);
  box-shadow: 0 0 0 3px rgb(13 148 136 / 0.18);
}

.bgp-lt-btn {
  min-height: 46px;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bgp-primary), #0f766e);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgb(13 148 136 / 0.28);
}

.bgp-lt-btn:hover {
  filter: brightness(1.05);
}

.bgp-lt-status {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #e8eef6;
  color: var(--bgp-muted);
  font-size: 0.85rem;
}

.bgp-lt-status.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.bgp-lt-results {
  min-height: 40px;
}

.bgp-lt-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.bgp-lt-title-row h2 {
  margin: 0;
  font-family: "Outfit", "DM Sans", sans-serif;
  font-size: 1.25rem;
}

.bgp-lt-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  background: #e8eef6;
  color: #334155;
}

.bgp-lt-badge.ok {
  background: #d1fae5;
  color: #065f46;
}
.bgp-lt-badge.warn {
  background: #fef3c7;
  color: #92400e;
}
.bgp-lt-badge.bad {
  background: #fee2e2;
  color: #991b1b;
}
.bgp-lt-badge.blue {
  background: #dbeafe;
  color: #1e40af;
}

.bgp-lt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.bgp-lt-stat {
  background: #fff;
  border: 1px solid var(--bgp-border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.bgp-lt-stat label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bgp-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.bgp-lt-stat div {
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}

.bgp-lt-stat .mono,
.mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 500;
}

.bgp-lt-table-wrap {
  overflow: auto;
  border: 1px solid var(--bgp-border);
  border-radius: 12px;
  background: #fff;
}

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

.bgp-lt-table th,
.bgp-lt-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--bgp-border);
}

.bgp-lt-table th {
  background: #f8fafc;
  color: var(--bgp-subtle);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bgp-lt-footer-note {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--bgp-subtle);
}

.bgp-lt-map {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--bgp-border);
}

.bgp-lt-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.bgp-lt-feature-card {
  background: #fff;
  border: 1px solid var(--bgp-border);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 4px 14px rgb(15 23 42 / 0.04);
}

.bgp-lt-feature-card h3 {
  margin: 0 0 0.35rem;
  font-family: "Outfit", "DM Sans", sans-serif;
  font-size: 1rem;
}

.bgp-lt-feature-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--bgp-muted);
  line-height: 1.45;
}

/* Hero */
.bgp-lt-hero {
  margin: 0 0 1.5rem;
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px solid var(--bgp-border);
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgb(13 148 136 / 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgb(37 99 235 / 0.1), transparent 50%),
    #fff;
}
.bgp-lt-hero-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 900px) {
  .bgp-lt-hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}
.bgp-lt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.bgp-lt-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bgp-soft);
  color: #0f766e;
}
.bgp-lt-pill-muted {
  background: #e8eef6;
  color: #475569;
}
.bgp-lt-hero-title {
  margin: 0 0 0.65rem;
  font-family: "Outfit", "DM Sans", system-ui, sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--bgp-fg);
}
.bgp-lt-hero-desc {
  margin: 0;
  color: var(--bgp-muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 36rem;
}
.bgp-lt-hero-visual {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgb(15 23 42 / 0.12);
  min-height: 180px;
}
.bgp-lt-hero-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
}

/* RPKI form */
.bgp-lt-rpki-form {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}
@media (min-width: 720px) {
  .bgp-lt-rpki-form {
    grid-template-columns: 1fr 1.25fr auto;
  }
}
.bgp-lt-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.bgp-lt-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bgp-muted);
  letter-spacing: 0.02em;
}
.bgp-lt-optional {
  font-weight: 500;
  color: var(--bgp-subtle);
  margin-left: 0.25rem;
}
.bgp-lt-required {
  font-weight: 600;
  color: var(--bgp-primary);
  margin-left: 0.25rem;
}
.bgp-lt-live {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--bgp-muted);
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid var(--bgp-border);
}
.bgp-lt-live.is-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.bgp-lt-live.is-warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.bgp-lt-live.is-err {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.bgp-lt-btn-rpki {
  min-height: 46px;
  white-space: nowrap;
}
.bgp-lt-rpki-form .bgp-lt-input {
  flex: none;
  width: 100%;
}
.bgp-lt-error {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.9rem;
}
.bgp-lt-muted {
  color: var(--bgp-muted);
  font-size: 0.85rem;
  margin: 0.35rem 0 0.75rem;
}
.bgp-lt-textarea {
  min-height: 120px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  resize: vertical;
  width: 100%;
}
.bgp-lt-bulk {
  flex-direction: column;
  align-items: stretch;
}

/* =========================================================
   MEGA MENU — replaces flat TT5 / page-list navigation
   ========================================================= */
.bgp-mega {
  --mega-bg: #ffffff;
  --mega-fg: #0f172a;
  --mega-muted: #64748b;
  --mega-border: #d0dbe8;
  --mega-primary: var(--bgp-primary, #0d9488);
  --mega-accent: var(--bgp-accent, #2563eb);
  position: relative;
  z-index: 10050;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  width: 100%;
  max-width: min(1100px, 100%);
  /* prevent theme overflow clipping of dropdown */
  overflow: visible !important;
}

.bgp-mega__inner {
  position: relative;
  overflow: visible;
}

/* Un-clip common theme wrappers when our mega is inside */
header:has(.bgp-mega),
.wp-block-group:has(.bgp-mega),
.wp-block-navigation:has(.bgp-mega),
.wp-block-navigation__responsive-container:has(.bgp-mega),
.wp-block-navigation__responsive-container-content:has(.bgp-mega) {
  overflow: visible !important;
}

.bgp-mega__bar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  position: relative;
  z-index: 2;
}

.bgp-mega__item {
  position: relative;
  list-style: none;
  margin: 0;
}

.bgp-mega__link,
.bgp-mega__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0.4rem 0.9rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--mega-fg);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
}

.bgp-mega__link:hover,
.bgp-mega__trigger:hover,
.bgp-mega.is-open .bgp-mega__trigger,
.bgp-mega__trigger[aria-expanded="true"] {
  background: #e8eef6;
  color: var(--mega-primary);
}

.bgp-mega__chev {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
  opacity: 0.7;
}

.bgp-mega.is-open .bgp-mega__chev,
.bgp-mega__trigger[aria-expanded="true"] .bgp-mega__chev {
  transform: rotate(225deg) translateY(-1px);
}

/*
  Panel sits under the full mega bar (not under Tools button alone),
  so it never clips off the right edge of a right-justified header.
*/
.bgp-mega__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  max-width: min(960px, calc(100vw - 1.5rem));
  /* Prefer left-align under bar; if bar is narrow on right, stay in viewport */
  margin-top: 0;
  z-index: 10060;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, visibility 0.14s;
}

/* Invisible bridge so pointer never "falls through" a gap */
.bgp-mega__panel-bridge {
  height: 10px;
  width: 100%;
  background: transparent;
}

.bgp-mega__panel-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.95fr;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--mega-bg);
  border: 1px solid var(--mega-border);
  border-radius: 18px;
  box-shadow: 0 22px 55px rgb(15 23 42 / 0.16);
}

/* Open states: hover OR click (.is-open on root) */
.bgp-mega.is-open .bgp-mega__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bgp-mega.is-open {
  z-index: 10070;
}

.bgp-mega__col-title {
  margin: 0 0 0.5rem;
  padding: 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mega-muted);
}

.bgp-mega__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.bgp-mega__card {
  display: block;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.bgp-mega__card:hover {
  background: #f1f5f9;
}

.bgp-mega__card-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mega-fg);
}

.bgp-mega__card:hover .bgp-mega__card-title {
  color: var(--mega-primary);
}

.bgp-mega__card-desc {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--mega-muted);
  line-height: 1.35;
}

.bgp-mega__aside {
  border-radius: 14px;
  padding: 1rem;
  background: linear-gradient(145deg, #ccfbf1 0%, #eff6ff 55%, #fff 100%);
  border: 1px solid var(--mega-border);
}

.bgp-mega__aside-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.bgp-mega__aside-text {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  color: var(--mega-muted);
  line-height: 1.4;
}

.bgp-mega__aside-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  background: var(--mega-primary);
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none !important;
}

.bgp-mega__aside-btn:hover {
  filter: brightness(0.95);
}

.bgp-mega__compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.bgp-mega__compact-list a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.bgp-mega__compact-list a:hover {
  color: var(--mega-primary);
}

@media (max-width: 900px) {
  .bgp-mega__item--desktop {
    display: none;
  }
  .bgp-mega__panel {
    position: static;
    max-width: none;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
  }
  .bgp-mega.is-open .bgp-mega__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 80vh;
    overflow: auto;
  }
  .bgp-mega.is-open .bgp-mega__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 80vh;
  }
  .bgp-mega__panel-bridge {
    display: none;
  }
  .bgp-mega__panel-inner {
    grid-template-columns: 1fr;
    box-shadow: none;
    border-radius: 12px;
    margin-top: 0.35rem;
  }
  .bgp-mega__aside {
    display: none;
  }
}

@media (min-width: 901px) {
  /* On wide screens keep panel fully in viewport */
  .bgp-mega__panel {
    left: 0;
    right: auto;
    width: min(960px, calc(100vw - 2rem));
  }
}

header .bgp-mega,
.wp-block-navigation .bgp-mega,
.wp-block-group .bgp-mega {
  flex: 1 1 auto;
  max-width: 100%;
}

.elementor-widget-bgp-lt,
.elementor-bgp-lt,
.bgp-lt-app {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.elementor-widget-bgp-lt *,
.bgp-lt-app *,
.bgp-lt-tool * {
  box-sizing: border-box;
}


/* RPKI aligned fields + live bubble on top */
.bgp-lt-live--top {
  margin: 0 0 0.85rem;
}
.bgp-lt-rpki-form {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 0.75rem 0.85rem;
  align-items: end;
}
@media (min-width: 720px) {
  .bgp-lt-rpki-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto;
  }
}
.bgp-lt-rpki-form .bgp-lt-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.bgp-lt-rpki-form .bgp-lt-input {
  width: 100%;
  min-height: 48px;
  height: 48px;
}
.bgp-lt-rpki-form .bgp-lt-btn-rpki {
  width: 100%;
  min-height: 48px;
  height: 48px;
}
.bgp-lt-label--spacer {
  visibility: hidden;
  user-select: none;
}
.bgp-lt-field--action {
  min-width: 140px;
}

/* =========================================================
   FRONT LAYOUT — tight under header, no theme title gap
   ========================================================= */
.bgp-lt-app {
  margin-top: 0;
  padding-top: 0.15rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.bgp-lt-hero {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
}

body.bgp-lt-front .bgp-lt-hero,
body.bgp-lt-page--home .bgp-lt-hero {
  margin-top: 0;
}

.bgp-lt-features {
  margin-top: 0.85rem;
}

.bgp-lt-feature-link {
  color: inherit;
  text-decoration: none;
}
.bgp-lt-feature-link:hover {
  color: var(--bgp-primary, #0d9488);
  text-decoration: underline;
}
.bgp-lt-feature-card h3 a {
  color: inherit;
  text-decoration: none;
}
.bgp-lt-feature-card h3 a:hover {
  color: var(--bgp-primary, #0d9488);
}

/* Home search sits closer to hero */
body.bgp-lt-front .bgp-lt-tool,
body.bgp-lt-page--home .bgp-lt-tool {
  margin-top: 0.75rem;
}

/* ASN Explorer — announced prefixes */
.bgp-lt-section-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bgp-fg, #0f172a);
}
.bgp-lt-prefix-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}
@media (min-width: 720px) {
  .bgp-lt-prefix-cols {
    grid-template-columns: 1fr 1fr;
  }
}
.bgp-lt-prefix-cols .bgp-lt-table-wrap {
  max-height: 360px;
  overflow: auto;
}
