/**
 * Comment Security Layer - Settings tab styles
 * Designed to match the existing Polanger admin UI.
 */

.pdt-cs-section {
  margin-top: 0;
}

.pdt-cs-intro {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin: 0 0 18px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pdt-cs-intro .dashicons {
  font-size: 28px;
  width: 28px;
  height: 28px;
  color: #4f46e5;
  flex-shrink: 0;
}

.pdt-cs-intro h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.3;
  color: #0f172a;
}

.pdt-cs-intro .description {
  margin: 0;
  color: #475569;
}

.pdt-cs-state {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pdt-cs-mode-badge {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.pdt-cs-mode-badge-custom {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.pdt-cs-state.is-on {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.pdt-cs-state.is-off {
  background: rgba(148, 163, 184, 0.15);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Sub-tabs */
.pdt-cs-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  margin: 0 0 18px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.pdt-cs-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.pdt-cs-subtab .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.pdt-cs-subtab:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.pdt-cs-subtab.is-active {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.18);
}

.pdt-cs-subtab.is-active:hover {
  background: #4338ca;
  color: #fff;
}

/* Form bits */
.pdt-cs-form .pdt-form-row hr,
.pdt-cs-section .pdt-form-row hr {
  border: 0;
  border-top: 1px dashed #e5e7eb;
  margin: 12px 0;
}

.pdt-cs-form .pdt-settings-section {
  margin-bottom: 18px;
}

.pdt-cs-quick-modes {
  margin: 0 0 22px;
  padding: 18px;
  background: linear-gradient(180deg, #fafbff 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
  border-radius: 12px;
}

.pdt-cs-quick-modes__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.pdt-cs-quick-modes__header h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #0f172a;
}

.pdt-cs-quick-modes__active {
  flex-shrink: 0;
  padding: 6px 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #4338ca;
  font-size: 12px;
  font-weight: 600;
}

.pdt-cs-presets-compact {
  margin-top: 0;
}

.pdt-cs-tip-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin: 14px 0 18px;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
}

.pdt-cs-tip-notice.is-subtle {
  margin-top: 12px;
  background: #f8fafc;
  border-color: #e2e8f0;
  border-left-color: #94a3b8;
}

.pdt-cs-tip-notice .dashicons {
  color: #2563eb;
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pdt-cs-tip-notice.is-subtle .dashicons {
  color: #64748b;
}

.pdt-cs-tip-notice strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
}

.pdt-cs-tip-notice p {
  margin: 0;
  color: #475569;
}

.pdt-cs-form input[type="number"],
.pdt-cs-form input[type="text"],
.pdt-cs-form select,
.pdt-cs-form textarea {
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  font-size: 13px;
  background: #fff;
}

.pdt-cs-form input[type="number"] {
  width: 110px;
}

.pdt-cs-form textarea {
  width: 100%;
  max-width: 720px;
  min-height: 120px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
}

.pdt-cs-form input[type="text"] {
  min-width: 240px;
}

.pdt-cs-inline-fields {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.pdt-cs-inline-fields > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdt-cs-inline-fields label {
  font-weight: 500;
  font-size: 13px;
  color: #334155;
}

.pdt-cs-actions {
  margin-top: 18px;
}

/* Presets */
.pdt-cs-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.pdt-cs-preset-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdt-cs-preset-card.is-active {
  border-color: #4f46e5;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.12);
}

.pdt-cs-preset-card h3 {
  margin: 0;
  font-size: 15px;
  color: #0f172a;
}

.pdt-cs-preset-card .description {
  flex: 1;
  margin: 0;
  color: #475569;
  font-size: 13px;
}

.pdt-cs-preset-card .button {
  align-self: flex-start;
}

/* Stats */
.pdt-cs-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.pdt-cs-stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdt-cs-stat-card.is-allow {
  border-left: 4px solid #22c55e;
}

.pdt-cs-stat-card.is-spam {
  border-left: 4px solid #f59e0b;
}

.pdt-cs-stat-card.is-trash {
  border-left: 4px solid #ef4444;
}

.pdt-cs-stat-card.is-drop {
  border-left: 4px solid #6366f1;
}

.pdt-cs-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
}

.pdt-cs-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

/* Logs table */
.pdt-cs-log-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 12px;
}

.pdt-cs-log-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pdt-cs-log-filter select {
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
}

.pdt-cs-log-table {
  border-radius: 10px;
  overflow: hidden;
}

.pdt-cs-log-table th {
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.pdt-cs-log-table code {
  font-size: 12px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #334155;
}

.pdt-cs-decision {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pdt-cs-decision-allow { background: rgba(34, 197, 94, 0.1);  color: #15803d; }
.pdt-cs-decision-spam  { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.pdt-cs-decision-trash { background: rgba(239, 68, 68, 0.12);  color: #b91c1c; }
.pdt-cs-decision-drop  { background: rgba(99, 102, 241, 0.12); color: #4338ca; }

.pdt-cs-notice {
  border-left-color: #4f46e5 !important;
}

/* Responsive */
@media (max-width: 720px) {
  .pdt-cs-intro {
    flex-direction: column;
    align-items: flex-start;
  }
  .pdt-cs-quick-modes__header,
  .pdt-cs-mode-badge,
  .pdt-cs-state {
    margin-left: 0;
  }
  .pdt-cs-quick-modes__header {
    flex-direction: column;
  }
}
