/* MODULE: Landing Pages Protection | FILE: styles.css */
/* All styles for the Lead Protection Rules Manager. */

/* ───────────────────────────── SHARED ────────────────────────────────── */

.prot-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  font-size: 0.9rem;
  color: #94a3b8;
}

/* ───────────────────────────── DASHBOARD SHELL ──────────────────────── */

.prot-dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.prot-dashboard__header {
  margin-bottom: 1.5rem;
}

.prot-dashboard__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 0.25rem;
}

.prot-dashboard__subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0;
}

.prot-dashboard__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #334155;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.prot-dashboard__tab {
  padding: 0.65rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.prot-dashboard__tab:hover {
  color: #e2e8f0;
}

.prot-dashboard__tab--active {
  color: #6366f1;
  border-bottom-color: #6366f1;
}

.prot-dashboard__content {
  min-height: 400px;
}

/* ───────────────────────────── RULES PANEL ──────────────────────────── */

.rules-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rules-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rules-panel__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.rules-panel__save-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.rules-panel__save-btn:hover {
  background: #4f46e5;
}

.rules-panel__save-btn:disabled {
  background: #475569;
  cursor: not-allowed;
}

.rules-panel__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rules-panel__row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  transition: border-color 0.15s;
}

.rules-panel__row:hover {
  border-color: #475569;
}

/* Toggle switch */
.rules-panel__toggle {
  position: relative;
  width: 38px;
  height: 20px;
  min-width: 38px;
  background: #475569;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.rules-panel__toggle--on {
  background: #6366f1;
}

.rules-panel__toggle::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.rules-panel__toggle--on::after {
  transform: translateX(18px);
}

.rules-panel__toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rules-panel__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.rules-panel__check-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
}

.rules-panel__check-desc {
  font-size: 0.72rem;
  color: #94a3b8;
}

.rules-panel__weight-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.rules-panel__slider {
  width: 100px;
  accent-color: #6366f1;
  cursor: pointer;
}

.rules-panel__slider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rules-panel__weight-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  min-width: 28px;
  text-align: right;
}

.rules-panel__dirty-hint {
  font-size: 0.78rem;
  color: #fbbf24;
  margin: 0;
}

/* ───────────────────────────── BLOCKLIST (shared) ───────────────────── */

.blocklist {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blocklist__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.blocklist__search {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.75rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.82rem;
}

.blocklist__search:focus {
  outline: none;
  border-color: #6366f1;
}

.blocklist__add-btn,
.blocklist__bulk-btn {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.blocklist__add-btn:hover,
.blocklist__bulk-btn:hover {
  background: #4f46e5;
}

.blocklist__bulk-btn {
  background: transparent;
  border: 1px solid #475569;
  color: #cbd5e1;
}

.blocklist__bulk-btn:hover {
  background: #334155;
}

/* Inline form */

.blocklist__form {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.blocklist__input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.82rem;
  box-sizing: border-box;
}

.blocklist__input:focus {
  outline: none;
  border-color: #6366f1;
}

.blocklist__textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.82rem;
  font-family: monospace;
  resize: vertical;
  box-sizing: border-box;
}

.blocklist__textarea:focus {
  outline: none;
  border-color: #6366f1;
}

.blocklist__select {
  padding: 0.45rem 0.65rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.82rem;
}

.blocklist__form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blocklist__form-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}

.blocklist__form-actions {
  display: flex;
  gap: 0.5rem;
}

.blocklist__form-save {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.blocklist__form-save:hover {
  background: #4f46e5;
}

.blocklist__form-cancel {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
}

.blocklist__form-cancel:hover {
  background: #334155;
}

/* Table */

.blocklist__table {
  width: 100%;
  border-collapse: collapse;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
}

.blocklist__th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #334155;
  background: #0f172a;
}

.blocklist__th--sortable {
  cursor: pointer;
  user-select: none;
}

.blocklist__th--sortable:hover {
  color: #e2e8f0;
}

.blocklist__tr {
  transition: background 0.1s;
}

.blocklist__tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.blocklist__td {
  font-size: 0.82rem;
  color: #e2e8f0;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.blocklist__tr:last-child .blocklist__td {
  border-bottom: none;
}

.blocklist__td--muted {
  color: #94a3b8;
}

.blocklist__td--empty {
  text-align: center;
  color: #64748b;
  padding: 1.5rem;
}

.blocklist__scope-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.blocklist__delete-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 4px;
  background: transparent;
  color: #f87171;
  cursor: pointer;
  transition: background 0.15s;
}

.blocklist__delete-btn:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* ───────────────────────────── TEST FORM ─────────────────────────────── */

.test-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.test-form__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  margin: 0;
}

.test-form__subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
}

.test-form__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.test-form__group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.test-form__group:last-child {
  grid-column: 1 / -1;
}

.test-form__label {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
}

.test-form__input {
  padding: 0.5rem 0.7rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.85rem;
}

.test-form__input:focus {
  outline: none;
  border-color: #6366f1;
}

.test-form__textarea {
  padding: 0.5rem 0.7rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 0.85rem;
  resize: vertical;
  font-family: inherit;
}

.test-form__textarea:focus {
  outline: none;
  border-color: #6366f1;
}

.test-form__run-btn {
  align-self: flex-start;
  padding: 0.6rem 1.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.test-form__run-btn:hover {
  background: #4f46e5;
}

.test-form__run-btn:disabled {
  background: #475569;
  cursor: not-allowed;
}

/* ───────────────────────────── VERDICT RESULT ───────────────────────── */

.verdict {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.verdict__summary {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.verdict__score-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.verdict__score-badge--green {
  background: #22c55e;
}

.verdict__score-badge--orange {
  background: #f59e0b;
}

.verdict__score-badge--red {
  background: #ef4444;
}

.verdict__status-chip {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.3rem 1rem;
  border-radius: 999px;
}

.verdict__status-chip--accepted {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.verdict__status-chip--review {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.verdict__status-chip--blocked {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.verdict__flags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.verdict__flags-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.verdict__flag-tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  font-weight: 500;
}

.verdict__table {
  width: 100%;
  border-collapse: collapse;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
}

.verdict__th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #334155;
  background: #0f172a;
}

.verdict__tr {
  transition: background 0.1s;
}

.verdict__tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.verdict__td {
  font-size: 0.82rem;
  color: #e2e8f0;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  vertical-align: top;
}

.verdict__tr:last-child .verdict__td {
  border-bottom: none;
}

.verdict__td--name {
  text-transform: capitalize;
  font-weight: 500;
}

.verdict__td--desc {
  font-size: 0.75rem;
  color: #94a3b8;
}

.verdict__check-score {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.78rem;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.verdict__check-score--hit {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.verdict__none {
  color: #64748b;
  font-size: 0.75rem;
}

/* ───────────────────────────── FRAUD STATS PANEL ────────────────────── */

.fraud-stats-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.fraud-stats-panel__kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.fraud-stats-panel__kpi {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.fraud-stats-panel__kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f1f5f9;
}

.fraud-stats-panel__kpi-value--green {
  color: #22c55e;
}

.fraud-stats-panel__kpi-value--orange {
  color: #fbbf24;
}

.fraud-stats-panel__kpi-value--red {
  color: #ef4444;
}

.fraud-stats-panel__kpi-label {
  font-size: 0.72rem;
  color: #94a3b8;
}

.fraud-stats-panel__section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 0 0 0.5rem;
}

.fraud-stats-panel__chart-wrap {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1rem;
}

.fraud-stats-panel__canvas {
  width: 100%;
  height: 220px;
  display: block;
}

.fraud-stats-panel__table-wrap {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1rem;
}

.fraud-stats-panel__table {
  width: 100%;
  border-collapse: collapse;
}

.fraud-stats-panel__th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #334155;
}

.fraud-stats-panel__tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

.fraud-stats-panel__td {
  font-size: 0.82rem;
  color: #cbd5e1;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.fraud-stats-panel__tr:last-child .fraud-stats-panel__td {
  border-bottom: none;
}

.fraud-stats-panel__td--empty {
  text-align: center;
  color: #64748b;
  padding: 1.25rem;
}

/* ───────────────────────────── RESPONSIVE ────────────────────────────── */

@media (max-width: 700px) {
  .test-form__fields {
    grid-template-columns: 1fr;
  }

  .fraud-stats-panel__kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .rules-panel__row {
    flex-wrap: wrap;
  }

  .rules-panel__weight-wrap {
    width: 100%;
    justify-content: flex-end;
  }

  .blocklist__header {
    flex-direction: column;
    align-items: stretch;
  }

  .prot-dashboard__tabs {
    gap: 0;
  }

  .prot-dashboard__tab {
    padding: 0.5rem 0.7rem;
    font-size: 0.75rem;
  }
}
