/* ============================================================
   ATTACK OBSERVATORY — public AMTD capture feed
   Uses theme custom properties only, so light mode inherits.
   ============================================================ */

.obs-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.obs-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green, #00d97e);
  box-shadow: 0 0 0 0 rgba(0, 217, 126, 0.6);
  animation: obs-pulse 2.4s infinite;
  flex: 0 0 auto;
}

@keyframes obs-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 217, 126, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(0, 217, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 217, 126, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .obs-live-dot { animation: none; }
}

/* ---------- stat row ---------- */

.obs-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.obs-stat {
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  text-align: center;
}

.obs-stat__value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1;
  margin-bottom: 8px;
}

.obs-stat__label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ---------- target device selector ---------- */

.obs-targets { margin-bottom: 36px; }

.obs-targets__head h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.obs-targets__head p {
  margin: 0 0 18px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.obs-targets__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.obs-target {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.obs-target:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.obs-target.is-active {
  border-color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 12%, transparent);
}

.obs-target__name {
  font-weight: 600;
  font-size: 0.9rem;
}

.obs-target__meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.obs-target--all { justify-content: center; }
.obs-target--all .obs-target__name { color: var(--accent-blue); }

/* ---------- controls ---------- */

.obs-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}

.obs-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 320px;
  max-width: 460px;
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
}

.obs-search i {
  color: var(--text-secondary);
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.obs-search input {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 11px 10px;
  min-width: 0;
}

.obs-search input::placeholder { color: var(--text-secondary); }

.obs-search:focus-within { border-color: var(--accent-blue); }

.obs-toggle {
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.obs-toggle:hover { border-color: var(--accent-blue); color: var(--text-primary); }

.obs-toggle.is-active {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
  background: color-mix(in srgb, var(--accent-orange) 12%, transparent);
}

.obs-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---------- table ---------- */

.obs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card, var(--bg-secondary));
}

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

.obs-table thead th {
  background: var(--bg-secondary);
  padding: 0;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.obs-th-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 13px 16px;
}

.obs-th-btn:hover { color: var(--accent-blue); }

.obs-c-country .obs-th-btn { justify-content: center; }
.obs-c-attempts .obs-th-btn { justify-content: flex-end; }

.obs-caret { font-size: 0.7rem; opacity: 0.4; }
.obs-caret.is-active { opacity: 1; color: var(--accent-blue); }

.obs-table tbody tr { border-top: 1px solid var(--border); }
.obs-table tbody tr:first-child { border-top: none; }
.obs-table tbody tr:hover { background: color-mix(in srgb, var(--accent-blue) 6%, transparent); }

/* Every cell stays on one line so all rows share a height and the table
   scans cleanly; long values truncate with the full text on hover. */
.obs-table td {
  padding: 10px 16px;
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.obs-c-time,
.obs-c-ip,
.obs-c-user,
.obs-c-pass { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; }

.obs-c-time { color: var(--text-secondary); font-size: 0.78rem; }
.obs-c-ip { color: var(--accent-blue); }

.obs-c-target { font-weight: 600; max-width: 290px; }

.obs-c-user { color: var(--text-primary); max-width: 150px; }
.obs-c-pass { color: var(--accent-orange); max-width: 150px; }

.obs-c-country { text-align: center; width: 1%; }
.obs-c-service { color: var(--text-secondary); }
.obs-c-attempts { text-align: right; font-variant-numeric: tabular-nums; }

.obs-cc {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: help;
}

/* ---------- clickable source + detail popup ---------- */

.obs-ip-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--accent-blue);
  cursor: pointer;
  border-bottom: 1px dotted color-mix(in srgb, var(--accent-blue) 55%, transparent);
}

.obs-ip-btn:hover,
.obs-ip-btn:focus-visible { color: var(--text-primary); border-bottom-color: var(--text-primary); }

.obs-pop-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
}

.obs-pop {
  position: fixed;
  top: 20vh;
  left: 50%;
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.obs-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.obs-pop__ip {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.obs-pop__close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.obs-pop__close:hover { color: var(--text-primary); }

.obs-pop__body { padding: 6px 14px 12px; }

.obs-pop__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}

.obs-pop__row:last-child { border-bottom: none; }

.obs-pop__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.obs-pop__value {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

.obs-pop__devices { padding: 10px 14px 14px; border-top: 1px solid var(--border); }

.obs-pop__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.obs-pop__chip {
  font-size: 0.72rem;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent-blue) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-blue) 35%, transparent);
  border-radius: 20px;
  padding: 3px 10px;
}

.obs-pop__note {
  margin: 0;
  padding: 0 14px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.obs-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 0.9rem;
}

/* ---------- pagination ---------- */

.obs-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 16px;
}

.obs-pg-btn {
  background: var(--bg-card, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.obs-pg-btn:hover:not(:disabled) {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.obs-pg-btn:disabled { opacity: 0.4; cursor: default; }

.obs-pg-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---------- server-rendered summary + FAQ ---------- */

.obs-static__answer {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 28px;
}

.obs-static__answer strong { color: var(--accent-blue); }

.obs-static__block { margin-bottom: 36px; }

.obs-static__block h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0 0 12px;
  color: var(--text-primary);
}

.obs-static__wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card, var(--bg-secondary));
}

.obs-static__table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

.obs-static__table thead th {
  background: var(--bg-secondary);
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.obs-static__table tbody tr { border-top: 1px solid var(--border); }
.obs-static__table tbody tr:first-child { border-top: none; }
.obs-static__table td { padding: 9px 14px; color: var(--text-primary); }
.obs-static__table td:first-child { font-weight: 600; }
.obs-static__table td:not(:first-child) { font-variant-numeric: tabular-nums; color: var(--text-secondary); }

.obs-faq__item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.obs-faq__item:last-child { border-bottom: none; }

.obs-faq__q {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.obs-faq__a {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .obs-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .obs-stats { grid-template-columns: 1fr; }
  .obs-controls { flex-direction: column; align-items: stretch; }
  .obs-count { text-align: right; }
  .obs-search { max-width: none; }
  .obs-pager { justify-content: space-between; }
}
