/* ===== Select Screen ===== */

.select-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-bottom: var(--space-md);
}

.select-title {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xs);
}

.select-subtitle {
  font-family: var(--font-gothic);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: var(--space-md);
}

/* Category list container */
.category-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
  overflow-y: auto;
  margin-bottom: var(--space-md);
  padding-right: var(--space-xs);
}

/* Category section */
.category-section {
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

/* Category header */
.category-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}

.category-header:active {
  background: rgba(255, 255, 255, 0.15);
}

.category-chevron {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  width: 1em;
  text-align: center;
  flex-shrink: 0;
}

.category-name {
  font-family: var(--font-primary);
  font-size: var(--font-size-md);
  font-weight: 700;
  flex: 1;
}

/* Category badge (selected count) */
.category-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-button);
  color: var(--color-button-text);
  font-family: var(--font-gothic);
  font-size: var(--font-size-xs);
  font-weight: 700;
  flex-shrink: 0;
}

/* Category body (collapsible) */
.category-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm);
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.category-body.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* Kotodama item */
.kotodama-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.kotodama-item:active {
  transform: scale(0.98);
}

.kotodama-item.selected {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--color-button);
}

.kotodama-item.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* Checkbox */
.kotodama-checkbox {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--color-border);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.kotodama-item.selected .kotodama-checkbox {
  background: var(--color-button);
  border-color: var(--color-button);
}

.kotodama-item.selected .kotodama-checkbox::after {
  content: '\2713';
  color: var(--color-button-text);
  font-size: var(--font-size-md);
  font-weight: 700;
  line-height: 1;
}

/* Kotodama text */
.kotodama-text {
  font-family: var(--font-primary);
  font-size: var(--font-size-md);
  flex: 1;
}

/* Delete button for custom kotodama */
.kotodama-delete {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--radius-full);
  background: rgba(196, 30, 58, 0.3);
  color: #FF6B6B;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(196, 30, 58, 0.4);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.kotodama-delete:hover {
  background: rgba(196, 30, 58, 0.5);
}

/* Custom add row */
.custom-add {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.custom-add input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-text-primary);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  outline: none;
}

.custom-add input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.custom-add input:focus {
  border-color: var(--color-button);
}

.custom-add button {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-text-primary);
  font-family: var(--font-gothic);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.2s;
}

.custom-add button:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Warning */
.select-warning {
  color: var(--color-accent);
  font-family: var(--font-gothic);
  font-size: var(--font-size-sm);
  text-align: center;
  min-height: 1.2em;
  margin-bottom: var(--space-sm);
}

/* Footer */
.select-footer {
  padding-top: var(--space-sm);
}

.select-footer .btn:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
