/* FB Policy Censor Stylesheet v2.8.0 */
:root {
  --c-bg: #0f0a19;
  --c-card: #181126;
  --c-card-border: #31234a;
  --c-box-bg: #140d21;
  --c-pink: #ec4899;
  --c-pink-hover: #db2777;
  --c-pink-light: #fbcfe8;
  --c-text: #f8fafc;
  --c-muted: #94a3b8;
  --c-rose: #f43f5e;
  --c-fuchsia: #d946ef;
  --c-emerald: #059669;
  --c-emerald-hover: #047857;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.fb-censor-body, .fb-censor-wrapper {
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background-color: var(--c-card);
  border-bottom: 1px solid var(--c-card-border);
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 26px;
}

.logo-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-pink-light);
  margin: 0;
}

.logo-text p {
  font-size: 12px;
  color: var(--c-muted);
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.api-pill {
  background: #2a1b3d;
  border: 1px solid var(--c-pink);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--c-pink-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.api-pill:hover {
  background: #3b2354;
  border-color: #f472b6;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
}

.status-dot.active {
  background-color: #10b981;
}

/* Toolbar */
.control-toolbar {
  background-color: var(--c-card);
  border-bottom: 1px solid var(--c-card-border);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-pink-light);
  white-space: nowrap;
}

.tool-select, .tool-input {
  background-color: var(--c-box-bg);
  color: #fbcfe8;
  border: 1px solid var(--c-card-border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.tool-select:focus, .tool-input:focus {
  border-color: var(--c-pink);
}

/* Buttons */
.btn-pink {
  background-color: var(--c-pink);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s, transform 0.1s;
}

.btn-pink:hover {
  background-color: var(--c-pink-hover);
}

.btn-pink:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #831843;
  color: #fbcfe8;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #9d174d;
}

.btn-emerald {
  background-color: var(--c-emerald);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-emerald:hover {
  background-color: var(--c-emerald-hover);
}

.btn-fuchsia {
  background-color: var(--c-fuchsia);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-fuchsia:hover {
  background-color: #c026d3;
}

.btn-rose {
  background-color: var(--c-rose);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-rose:hover {
  background-color: #e11d48;
}

.btn-danger {
  background-color: #4c0519;
  color: #fda4af;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-danger:hover {
  background-color: #881337;
}

/* Status Label */
.status-indicator {
  font-size: 12px;
  font-style: italic;
  color: #34d399;
}

/* Clean 2-Column Main Workspace Grid */
.workspace-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 18px;
  flex: 1;
  min-height: 480px;
}

@media (max-width: 900px) {
  .workspace-container {
    grid-template-columns: 1fr;
  }
}

.column-card {
  background-color: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.col-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--c-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(30, 23, 46, 0.8);
}

.col-title {
  font-size: 13px;
  font-weight: 700;
  color: #f472b6;
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.col-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--c-box-bg);
}

/* Textareas & Editable Area */
.editor-textarea {
  width: 100%;
  height: 100%;
  min-height: 400px;
  flex: 1;
  background-color: var(--c-box-bg);
  color: var(--c-text);
  border: none;
  padding: 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: none;
  outline: none;
}

/* Column 2: Editable Highlight Area */
.editor-editable {
  width: 100%;
  height: 100%;
  min-height: 400px;
  flex: 1;
  background-color: var(--c-box-bg);
  color: var(--c-text);
  border: none;
  padding: 14px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  cursor: text;
  box-sizing: border-box;
}

.editor-editable:focus {
  box-shadow: inset 0 0 0 1px var(--c-pink);
}

.editor-editable.is-empty:before {
  content: attr(data-placeholder);
  color: var(--c-muted);
  pointer-events: none;
  display: block;
}

.col-footer {
  padding: 6px 12px;
  border-top: 1px solid var(--c-card-border);
  font-size: 11px;
  color: var(--c-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--c-card);
  flex-wrap: wrap;
  gap: 6px;
}

/* Badge Direct Edit */
.badge-direct-edit {
  font-size: 11px;
  color: #f472b6;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34d399;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* Bottom History Card (Thoáng đãng, gọn gàng) */
.history-bottom-card {
  margin: 4px 18px 24px 18px;
  background-color: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.history-bottom-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(30, 23, 46, 0.9);
  flex-wrap: wrap;
  gap: 10px;
}

.history-title-wrap {
  display: flex;
  align-items: center;
}

.search-box-bottom {
  display: flex;
  align-items: center;
  background-color: var(--c-box-bg);
  border: 1px solid var(--c-pink);
  border-radius: 6px;
  padding: 4px 10px;
  min-width: 280px;
}

.search-box-bottom input {
  background: transparent;
  border: none;
  color: #fbcfe8;
  font-size: 12px;
  flex: 1;
  outline: none;
}

.history-actions-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-bottom-body {
  background-color: var(--c-box-bg);
}

.history-grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
}

.history-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  background-color: rgba(30, 23, 46, 0.6);
  border: 1px solid var(--c-card-border);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.history-item:hover {
  background-color: #2e1d44;
  border-color: var(--c-pink);
  transform: translateY(-1px);
}

.history-item.active {
  background-color: #831843;
  border-color: var(--c-pink);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.35);
}

.hist-time {
  font-size: 10px;
  color: var(--c-muted);
}

.history-item.active .hist-time {
  color: #fbcfe8;
}

.hist-title {
  font-size: 12px;
  font-weight: 600;
  margin: 3px 0;
  color: #f8fafc;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hist-meta {
  font-size: 11px;
  color: #f472b6;
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item.active .hist-meta {
  color: #fed7aa;
}

/* Highlights */
.hl-base {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 2px;
  display: inline-block;
  line-height: 1.4;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hl-bao-luc { background: #5b1522; color: #fecdd3; border-bottom-color: #f43f5e; }
.hl-tinh-duc { background: #531649; color: #f5d0fe; border-bottom-color: #d946ef; }
.hl-tre-em { background: #54370d; color: #fef08a; border-bottom-color: #eab308; }
.hl-y-te, .hl-y-te-suc-khoe { background: #064e3b; color: #a7f3d0; border-bottom-color: #10b981; }
.hl-hang-gia, .hl-hang-gia-thuong-hieu { background: #702c0b; color: #fed7aa; border-bottom-color: #f97316; }
.hl-khac, .hl-vi-pham-khac { background: #0c4a6e; color: #bae6fd; border-bottom-color: #0284c7; }

/* Legend & Stats */
.footer-panels {
  padding: 8px 18px 6px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-bar {
  background-color: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.legend-pill {
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.stats-bar {
  background-color: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-badge {
  font-weight: 700;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--c-card);
  border: 1px solid var(--c-pink);
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: modal-in 0.2s ease-out;
}

@keyframes modal-in {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #231838;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-pink-light);
  margin: 0;
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--c-card-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #231838;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #be185d;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Custom Keywords Bar & Pills */
.custom-kw-bar {
  margin: 0 18px 10px 18px;
  background-color: rgba(30, 23, 46, 0.85);
  border: 1px solid var(--c-card-border);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.kw-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.kw-bar-title {
  font-size: 12px;
  font-weight: 700;
  color: #f472b6;
  white-space: nowrap;
}

.kw-pills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-pill {
  background: rgba(244, 114, 182, 0.15);
  border: 1px solid rgba(244, 114, 182, 0.4);
  color: #fbcfe8;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.kw-pill:hover {
  background: rgba(244, 114, 182, 0.25);
  border-color: #f472b6;
}

.kw-pill .btn-remove-pill {
  cursor: pointer;
  color: #f43f5e;
  font-weight: bold;
  font-size: 11px;
  margin-left: 2px;
}

.kw-pill .btn-remove-pill:hover {
  color: #fda4af;
}

.kw-tags-cloud .kw-pill {
  background: rgba(236, 72, 153, 0.2);
  border-color: #ec4899;
}
