/* css/components/keyword-chips.css — Ключевые слова в виде «фишек» с крестиком и их цветовые подсветки.
   Порядок подключения всех стилей задан в layout/head.php — он важен. */
/* ===== KEYWORDS CHIP EDITOR (кнопки-теги с крестиком удаления) ===== */
.kw-chip-editor {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kw-chip-editor:focus-within {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
}

.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 5px;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: #e6e6e6;
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
  animation: kwChipIn 0.12s ease;
}

@keyframes kwChipIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.kw-chip-text {
  white-space: nowrap;
}

.kw-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.kw-chip-remove:hover {
  background: rgba(255, 92, 122, 0.25);
  color: #ff5c7a;
}

.kw-chip-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 11px;
  outline: none;
  padding: 4px 2px;
}

.kw-chip-input::placeholder {
  color: var(--text-dim);
}

button.kw-chip-remove{
	width: auto;
	height:auto;
	padding:2px 6px 5px 6px;
	border-radius:4px;
	background: #471d67;
}

.kw-chip {
  cursor: grab;
}

.kw-chip:active {
  cursor: grabbing;
}

.kw-chip-dragging {
  opacity: 0.9;
}

.kw-chip-just-moved {
  animation: kwChipHighlight 0.9s ease;
}

@keyframes kwChipHighlight {
  0%   { background: rgba(0, 229, 255, 0.35); border-color: rgba(0, 229, 255, 0.7); }
  100% { background: rgba(124, 92, 255, 0.14); border-color: rgba(124, 92, 255, 0.3); }
}

.kw-chip-drop-before {
  box-shadow: -3px 0 0 0 #00e5ff;
}

.kw-chip-drop-after {
  box-shadow: 3px 0 0 0 #00e5ff;
}

/* ===== KEYWORD CHIP — тематические подсветки ===== */
.kw-chip-top {
  position: relative;
  padding-left: 22px;
}

.kw-chip-top::before {
  content: attr(data-rank);
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 170, 68, 0.2);
  color: #ffaa44;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.kw-chip-duplicate {
  box-shadow: 0 0 0 2px rgba(255, 170, 68, 0.55) inset;
}

.kw-chip-flagged {
  outline: 2px solid rgba(255, 92, 122, 0.75);
  outline-offset: -1px;
}

.kw-chip-included {
  border-color: #00e5a0;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 160, 0.4);
}

.kw-chip-edit-input {
  min-width: 50px;
  max-width: 220px;
  padding: 1px 4px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}

/* *********** */

/* Убираем фиксированное позиционирование у одиночной кнопки —
   теперь обе кнопки лежат внутри .side-tools-tabs и позиционируются
   через него, поэтому здесь только внешний вид самой кнопки. */
.batch-tools-tab {
  writing-mode: vertical-rl;
  padding: 14px 5px;
  border-radius: 10px 0 0 10px;
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-right: none;
  background: rgba(20, 28, 45, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-link);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: -4px 0 20px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
}

.batch-tools-tab:hover {
  color: #ffffff;
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(20, 28, 45, 0.65);
  box-shadow: -4px 0 24px rgba(124, 92, 255, 0.2);
}

/* Контейнер держит обе кнопки друг под другом без наложения */
.side-tools-tabs {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

