/**
 * Inventory Modals — item detail panel and spell cast confirmation modal
 * Floating panels with backdrops, field layouts, and action buttons.
 */

/* =============================================================================
   Modal Backdrop — darkens page during modal display
   ============================================================================= */

.item-detail-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

.cast-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

/* =============================================================================
   Item Detail Modal — generic item inspection and move dialog
   ============================================================================= */

.item-detail-modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary, #1a1a1a);
  border: 1px solid var(--border-primary, #2a2a2a);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Modal close button */
.item-detail-modal-panel .modal-close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-secondary, #b0b0b0);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s;
}

.item-detail-modal-panel .modal-close-button:hover {
  color: var(--text-primary, #e8e8e8);
}

/* =============================================================================
   Item Detail Rows — label-value pairs within modal
   ============================================================================= */

.item-detail-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-primary, #2a2a2a);
  align-items: flex-start;
}

.item-detail-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.item-detail-row__label {
  font-weight: 600;
  color: var(--text-secondary, #b0b0b0);
  min-width: 100px;
  flex-shrink: 0;
}

.item-detail-row__value {
  color: var(--text-primary, #e8e8e8);
  flex: 1;
}

.item-detail-row__description {
  margin-top: 0.75rem;
  color: var(--text-secondary, #b0b0b0);
  line-height: 1.5;
  font-size: 0.9rem;
}

/* =============================================================================
   Move to Container Buttons — action buttons for relocation
   ============================================================================= */

.move-to-container-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-primary, #2a2a2a);
}

.move-to-container-buttons .button {
  flex: 0 1 auto;
}

/* =============================================================================
   Spell Cast Modal — confirmation dialog with save rolls and ill effects
   ============================================================================= */

.cast-modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary, #1a1a1a);
  border: 1px solid var(--border-primary, #2a2a2a);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Modal close button */
.cast-modal-panel .modal-close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-secondary, #b0b0b0);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.15s;
}

.cast-modal-panel .modal-close-button:hover {
  color: var(--text-primary, #e8e8e8);
}

/* =============================================================================
   Cast Modal — specific elements (power picker, saves, fatigue, ill effects)
   ============================================================================= */

.cast-modal-power-picker {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.cast-modal-power-picker .button {
  flex: 0 1 auto;
}

/* Fatigue warning banner */
.cast-modal-fatigue-notice {
  padding: 0.6rem;
  background: var(--bg-secondary, #0a0a0a);
  border-left: 3px solid var(--warning, #fbbf24);
  margin: 1rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary, #b0b0b0);
  line-height: 1.5;
}

/* Will save section */
.cast-modal-wil-save {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-secondary, #0a0a0a);
  border-radius: 4px;
  border-left: 3px solid var(--info, #60a5fa);
}

.cast-modal-wil-save-label {
  font-weight: 600;
  color: var(--text-primary, #e8e8e8);
  margin-bottom: 0.5rem;
}

.cast-modal-wil-save-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.cast-modal-wil-save-result {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 3px;
  font-size: 0.9rem;
}

.cast-modal-wil-save-result.passed {
  background: rgba(74, 222, 128, 0.2);
  border-left: 3px solid var(--success, #4ade80);
  color: var(--success, #4ade80);
}

.cast-modal-wil-save-result.failed {
  background: rgba(248, 113, 113, 0.2);
  border-left: 3px solid var(--error, #f87171);
  color: var(--error, #f87171);
}

/* Ill effects checklist */
.cast-modal-ill-effects {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.cast-modal-ill-effects label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  cursor: pointer;
  color: var(--text-secondary, #b0b0b0);
  font-size: 0.9rem;
}

.cast-modal-ill-effects input[type="checkbox"] {
  cursor: pointer;
}

.cast-modal-ill-effects label:hover {
  color: var(--text-primary, #e8e8e8);
}
