/* ===============================
   ITEM CREATOR — Narrator-only guided item creation popup
   =============================== */

/* --- Overlay --- */
.item-creator-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

/* --- Panel --- */
.item-creator-panel {
  background: #0a0e1c;
  border: 1px solid rgba(0, 200, 255, 0.2);
  border-radius: 8px;
  width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 16px 18px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 12px rgba(0, 200, 255, 0.08);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 200, 255, 0.2) transparent;
}

.item-creator-panel::-webkit-scrollbar { width: 5px; }
.item-creator-panel::-webkit-scrollbar-track { background: transparent; }
.item-creator-panel::-webkit-scrollbar-thumb { background: rgba(0, 200, 255, 0.2); border-radius: 4px; }

/* --- Title --- */
.ic-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 210, 255, 0.9);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 0 0 12px;
  text-align: center;
}

/* --- Form Row --- */
.ic-row { margin-bottom: 10px; }

.ic-row-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.ic-row-inline > .ic-row { flex: 1; margin-bottom: 0; }

.ic-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: rgba(180, 200, 220, 0.7);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* --- Inputs --- */
.ic-input, .ic-select, .ic-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #e0e8f0;
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
  transition: border-color 0.15s;
}
.ic-input:focus, .ic-select:focus, .ic-textarea:focus {
  border-color: rgba(0, 200, 255, 0.45);
}
.ic-input::placeholder, .ic-textarea::placeholder {
  color: rgba(180, 200, 220, 0.3);
}
.ic-select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%234a5568'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.ic-select option { background: #0a0e1c; color: #e0e8f0; }
.ic-select option:disabled { color: rgba(100, 110, 120, 0.4); }
.ic-textarea {
  min-height: 48px;
  resize: vertical;
  font-family: inherit;
}
.ic-input-sm { width: 60px; }
.ic-input-med { width: 80px; }

/* --- Conditional Sections --- */
.ic-conditional { display: none; }
.ic-conditional.visible { display: block; }

/* --- Properties Checkboxes --- */
.ic-prop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin-top: 2px;
}
.ic-prop-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(200, 210, 220, 0.7);
  cursor: pointer;
  user-select: none;
}
.ic-prop-label input[type="checkbox"] {
  accent-color: rgba(0, 200, 255, 0.7);
  width: 13px; height: 13px; margin: 0;
}

/* --- Hands Radio --- */
.ic-radio-group { display: flex; gap: 10px; margin-top: 2px; }
.ic-radio-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: rgba(200, 210, 220, 0.75);
  cursor: pointer;
  user-select: none;
}
.ic-radio-label input[type="radio"] {
  accent-color: rgba(0, 200, 255, 0.7);
  width: 13px; height: 13px; margin: 0;
}

/* --- Divider --- */
.ic-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: 12px 0 10px;
}

/* --- Section Subtitle --- */
.ic-subtitle {
  font-size: 10px;
  font-weight: 600;
  color: rgba(0, 210, 255, 0.55);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 0 0 8px;
}

/* --- Stackable Rows (static bonus + rolled damage) --- */
.ic-stackable-list { margin-bottom: 4px; }

.ic-stackable-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.ic-stackable-row .ic-input { flex: 0 0 auto; }
.ic-stackable-row .ic-select { flex: 1; min-width: 0; }

/* --- Add / Remove Buttons --- */
.ic-btn-add {
  display: inline-block;
  padding: 4px 10px;
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: rgba(0, 200, 255, 0.7);
  background: rgba(0, 200, 255, 0.06);
  border: 1px dashed rgba(0, 200, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
}
.ic-btn-add:hover {
  background: rgba(0, 200, 255, 0.12);
  border-color: rgba(0, 200, 255, 0.4);
}

.ic-btn-remove {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 100, 100, 0.7);
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
}
.ic-btn-remove:hover {
  background: rgba(255, 80, 80, 0.2);
  color: rgba(255, 120, 120, 0.95);
}

/* --- Bottom Buttons --- */
.ic-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.ic-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: filter 0.15s;
}
.ic-btn:hover { filter: brightness(1.15); }
.ic-btn-create {
  background: linear-gradient(135deg, rgba(0, 180, 220, 0.8), rgba(0, 140, 200, 0.8));
  color: #fff;
}
.ic-btn-manual {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(200, 210, 220, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ic-btn-cancel {
  background: rgba(255, 80, 80, 0.15);
  color: rgba(255, 120, 120, 0.85);
  border: 1px solid rgba(255, 80, 80, 0.2);
  flex: 0.6;
}

/* --- Custom Item Indicator (on held rows) --- */
.held-row[data-custom="true"] .held-item {
  box-shadow: inset 3px 0 0 rgba(0, 200, 255, 0.45);
}
.general-inventory-row[data-custom="true"] .general-inventory-item {
  box-shadow: inset 3px 0 0 rgba(0, 200, 255, 0.45);
}

/* --- Optgroup styling in template dropdown --- */
.ic-select optgroup {
  color: rgba(0, 200, 255, 0.7);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3px;
  background: #0d1220;
  padding: 4px 0;
}

/* --- Optional damage type chips --- */
.ic-opt-types-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  align-items: center;
}

.ic-opt-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(0, 200, 255, 0.12);
  border: 1px solid rgba(0, 200, 255, 0.35);
  color: rgba(0, 220, 255, 0.9);
}

.ic-opt-type-remove {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 100, 100, 0.7);
  line-height: 1;
  margin-left: 2px;
}
.ic-opt-type-remove:hover {
  color: rgba(255, 140, 140, 1);
}

.ic-opt-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.ic-opt-add-row .ic-select {
  flex: 1;
}
.ic-opt-add-btn {
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(0, 200, 255, 0.7);
  background: rgba(0, 200, 255, 0.08);
  border: 1px solid rgba(0, 200, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.ic-opt-add-btn:hover {
  background: rgba(0, 200, 255, 0.15);
}

/* --- Additional Cost Upon Use --- */
.ic-cost-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ic-cost-value {
  margin-left: auto;
}

.ic-cost-skill-types {
  display: flex;
  gap: 12px;
  margin-left: 22px;
  margin-bottom: 8px;
}

/* --- Shared Skill Picker Popup (runtime) --- */
.cc-skill-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.cc-skill-picker-panel {
  background: #0a0e1c;
  border: 1px solid rgba(0, 200, 255, 0.25);
  border-radius: 8px;
  width: 340px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.cc-skill-picker-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 210, 255, 0.85);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-align: center;
}

.cc-skill-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s;
}

.cc-skill-picker-item:hover {
  background: rgba(0, 200, 255, 0.1);
  border-color: rgba(0, 200, 255, 0.35);
}

.cc-skill-picker-name {
  font-size: 12px;
  color: #e0e8f0;
  font-weight: 500;
  flex: 1;
}

.cc-skill-picker-source {
  font-size: 10px;
  color: rgba(180, 200, 220, 0.5);
  margin-right: 4px;
}

.cc-skill-picker-cap {
  font-size: 11px;
  font-weight: 600;
  color: rgba(0, 210, 255, 0.8);
  white-space: nowrap;
}

.cc-skill-picker-cancel {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px 0;
  background: rgba(255, 80, 80, 0.12);
  color: rgba(255, 120, 120, 0.8);
  border: 1px solid rgba(255, 80, 80, 0.2);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.cc-skill-picker-cancel:hover {
  background: rgba(255, 80, 80, 0.2);
}

/* --- Option Package Panels --- */
.ic-option-package-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}

.ic-option-package-panel {
  border: 1px solid rgba(0, 200, 255, 0.15);
  border-radius: 6px;
  padding: 10px 12px;
  background: rgba(0, 200, 255, 0.03);
}

.ic-option-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ic-option-name {
  flex: 1;
  font-weight: 600;
}

.ic-option-section-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(0, 210, 255, 0.6);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 8px 0 4px;
}

.ic-btn-add-sm {
  font-size: 10px;
  padding: 3px 8px;
  margin-top: 2px;
}

.ic-textarea-sm {
  min-height: 40px;
  font-size: 11px;
}

/* --- Option Picker (runtime fire-time popup) --- */
.cc-option-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.cc-option-effects {
  font-size: 11px;
  color: rgba(0, 210, 255, 0.8);
  font-style: italic;
}

.cc-option-cost {
  font-size: 10px;
  color: rgba(255, 180, 80, 0.8);
}