/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  padding: 24px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 32px;
}

.app-title {
  font-weight: 300;
  font-size: 2rem;
  color: #555;
  letter-spacing: 0.05em;
}

.info-link {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  text-decoration: none;
  font-size: 1.2rem;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.info-link:hover {
  opacity: 1;
}

/* Layout */
.app-layout {
  display: flex;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

.list-panel {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

.list-panel--center {
  flex: 2;
}

.list-title {
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.btn-compact {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
  line-height: 1;
}

.btn-compact:hover {
  background: #f0f0f0;
}

/* Empty Trash Button */
.empty-trash-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #888;
  cursor: pointer;
  transition: background 0.15s;
}

.empty-trash-btn:hover {
  background: #e8e8e8;
}

/* List Containers */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 40px;
}

/* List Items */
.list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fafafa;
  border: 1px solid #eee;
  cursor: grab;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
  user-select: none;
}

.list-item:active {
  cursor: grabbing;
}

.list-item:hover {
  background: #f0f0f0;
}

.list-item.dragging {
  opacity: 0.4;
}

/* Drag-over indicator */
.list-item.drag-over {
  border-bottom: 2px solid #4a90d9;
}

/* Empty slot (focus list) */
.list-item--empty {
  border: 2px dashed #ddd;
  background: transparent;
  cursor: default;
  color: #bbb;
}

.list-item--empty:active {
  cursor: default;
}

.list-item--empty .item-text {
  color: #ccc;
  font-style: italic;
}

.list-item--empty .item-text:focus {
  color: #333;
  font-style: normal;
}

/* Focus list — first item (main focus) */
.list-item--focus-1 {
  background: #d4edda;
  border-color: #b7dfb9;
}

.list-item--focus-1 .item-text {
  color: #1a3a1a;
  font-weight: 600;
}

/* Focus list — items 2-5 */
.list-item--focus-2,
.list-item--focus-3,
.list-item--focus-4,
.list-item--focus-5 {
  background: #eaf7ec;
  border-color: #d0e8d2;
}

.list-item--focus-2 .item-text,
.list-item--focus-3 .item-text,
.list-item--focus-4 .item-text,
.list-item--focus-5 .item-text {
  color: #1a3a1a;
  font-weight: 500;
}

/* Deemed items (beyond position 5 in focus) */
.list-item--deemed {
  opacity: 0.5;
}

.list-item--deemed .btn-remove {
  opacity: 0.6;
}

/* Item text */
.item-text {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: #222;
  outline: none;
  border-radius: 4px;
  cursor: text;
}

.item-text:focus {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.3);
}

.item-text::placeholder {
  color: #ccc;
  font-style: italic;
}

/* Noise list — more text contrast */
#noise-list .item-text {
  color: #111;
  font-weight: 500;
}

/* Buttons */
.btn-remove,
.btn-add {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.btn-remove {
  background: transparent;
  color: #e57373;
}

.btn-remove:hover {
  background: #ffeaea;
  color: #d32f2f;
}

.btn-add {
  background: transparent;
  color: #81c784;
}

.btn-add:hover {
  background: #e8f5e9;
  color: #388e3c;
}

/* Drop zones (trash & noise top) */
.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 2px dashed #ddd;
  border-radius: 6px;
  color: #ccc;
  font-size: 0.85rem;
  margin-bottom: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.drop-zone.drag-over {
  background: #e3f2fd;
  border-color: #4a90d9;
  color: #4a90d9;
}

/* Drag placeholder while dragging over lists */
.list-container.drag-over .drop-zone {
  background: #e3f2fd;
  border-color: #4a90d9;
}

/* Responsive */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .list-panel {
    flex: 1;
  }

  .list-panel--center {
    flex: 1;
  }

  body {
    padding: 12px;
  }
}