/**
 * /assets/css/world-race-modal.css
 *
 * Purpose:  Styles fuer Voelker-Karten + Create/Edit Modal
 * Deps:     app.css, create_wizard_modal.css (wizard-step, wizard-input etc.)
 * Load:     index.php
 * Version:  1.2.0 - z-index entfernt (lebt jetzt zentral in spa-fixes.css)
 */

/* ============================================================
   RACE CARDS GRID
   ============================================================ */

.race-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .race-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.race-card {
  position: relative;
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.race-card:hover {
  border-color: var(--race-accent, #20c997);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
              0 0 0 1px var(--race-accent, #20c997);
}

.race-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--race-accent, #20c997);
  border-radius: 12px 0 0 12px;
}

.race-card-body {
  padding: 16px 16px 12px 20px;
}

.race-card-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: color-mix(in srgb, var(--race-accent, #20c997) 15%, transparent);
  color: var(--race-accent, #20c997);
  border: 1px solid color-mix(in srgb, var(--race-accent, #20c997) 30%, transparent);
}

.race-card-name {
  color: #e6edf3;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.race-card-subtitle {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.78rem;
  font-style: italic;
  margin-top: 1px;
}

.race-card-desc {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.race-card-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.race-trait-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.race-trait-badge i {
  font-size: 0.65rem;
  opacity: 0.7;
}

.race-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.race-stat-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.race-card-align {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}

.race-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.race-card:hover .race-card-actions {
  opacity: 1;
}

.race-card-actions .btn {
  padding: 3px 8px;
  font-size: 0.75rem;
  backdrop-filter: blur(6px);
  background: rgba(0, 0, 0, 0.5);
}


/* ============================================================
   RACE MODAL (Styles only, z-index in spa-fixes.css)
   ============================================================ */

.race-modal-content {
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.race-modal-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(32, 201, 151, 0.12) 0%,
    rgba(13, 110, 253, 0.08) 25%,
    rgba(13, 17, 23, 0.95) 50%,
    rgba(111, 66, 193, 0.06) 75%,
    rgba(32, 201, 151, 0.06) 100%
  );
  background-size: 400% 400%;
  animation: raceModalGradient 18s ease infinite;
  z-index: 1;
  pointer-events: none;
}

@keyframes raceModalGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* z-index fuer #raceUpsertModal lebt in spa-fixes.css
   NICHT hier setzen! */


/* ============================================================
   ALIGNMENT GRID (3x3)
   ============================================================ */

.race-alignment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  max-width: 240px;
}

.race-align-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.race-align-cell:hover {
  border-color: var(--align-color, #6c757d);
  color: var(--align-color, #6c757d);
  background: color-mix(in srgb, var(--align-color, #6c757d) 15%, transparent);
}

.race-align-cell.active {
  border-color: var(--align-color, #6c757d);
  background: color-mix(in srgb, var(--align-color, #6c757d) 25%, transparent);
  color: #fff;
  box-shadow: 0 0 10px color-mix(in srgb, var(--align-color, #6c757d) 40%, transparent);
}


/* ============================================================
   TRAITS LIST
   ============================================================ */

.race-trait-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  animation: traitSlideIn 0.2s ease;
}

@keyframes traitSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.race-trait-row input {
  background: rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  font-size: 0.85rem;
}

.race-trait-row input::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
}

.race-trait-row .btn-remove-trait {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.race-trait-row .btn-remove-trait:hover {
  color: #dc3545;
}


/* ============================================================
   STAT SPINNERS
   ============================================================ */

.race-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (min-width: 576px) {
  .race-stats-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.race-stat-cell {
  text-align: center;
  padding: 6px 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.race-stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
}

.race-stat-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.race-stat-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
}

.race-stat-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.race-stat-btn:active {
  transform: scale(0.9);
}

.race-stat-value {
  display: inline-block;
  width: 28px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e6edf3;
  font-family: 'Courier New', monospace;
}

.race-stat-value.positive { color: #20c997; }
.race-stat-value.negative { color: #dc3545; }
