/**
 * HIRED SWORDS CSS
 * Styles für Hired Swords im Trading Post und Roster Editor
 * Bronze/Kupfer-Farbschema zur Unterscheidung von regulären Einheiten
 */

/* ============================================
   CSS VARIABLES - Hired Swords Farben
   ============================================ */
:root {
  --hs-bronze: #cd7f32;
  --hs-bronze-light: #d4a574;
  --hs-bronze-dark: #8b5a2b;
  --hs-copper: #b87333;
  --hs-gold-accent: #c9a959;
  --hs-bg-dark: #2a2218;
  --hs-bg-light: #3d3225;
  --hs-border: rgba(205, 127, 50, 0.4);
  --hs-border-hover: rgba(205, 127, 50, 0.7);
  --hs-glow: rgba(205, 127, 50, 0.3);
}

/* ============================================
   TRADING POST - HIRED SWORDS TAB
   ============================================ */

.hired-swords-tab {
  padding: 0;
}

.hired-swords-info {
  padding: 15px 20px;
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.1) 0%, rgba(139, 90, 43, 0.1) 100%);
  border-bottom: 1px solid var(--hs-border);
}

.hired-swords-info .tab-intro {
  margin: 0 0 10px 0;
  color: var(--hs-bronze-light);
}

.hired-swords-rules {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.hired-swords-rules span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Category Title für Hired Swords */
.category-title.hired-title {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(139, 90, 43, 0.15) 100%);
  border-left-color: var(--hs-bronze);
  color: var(--hs-bronze-light);
}

/* ============================================
   HIRED SWORDS GRID
   ============================================ */

.hired-swords-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 15px;
  padding: 0 20px 20px;
}

/* ============================================
   HIRED SWORD CARD (Trading Post)
   ============================================ */

.hired-sword-card {
  position: relative;
  padding: 0;
  background: linear-gradient(145deg, var(--hs-bg-light) 0%, var(--hs-bg-dark) 100%);
  border: 2px solid var(--hs-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}

.hired-sword-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--hs-bronze), transparent);
  opacity: 0.5;
}

.hired-sword-card:hover {
  border-color: var(--hs-border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px var(--hs-glow);
}

.hired-sword-card:hover::before {
  opacity: 1;
}

/* Unavailable Card */
.hired-sword-card.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

.hired-sword-card.unavailable:hover {
  transform: none;
  box-shadow: none;
}

/* Too Expensive Card */
.hired-sword-card.too-expensive {
  opacity: 0.6;
}

.hired-sword-card.too-expensive .hs-cost {
  color: #e57373;
}

/* Currently Hired Card */
.hired-sword-card.current {
  border-color: var(--hs-bronze);
  background: linear-gradient(145deg, rgba(205, 127, 50, 0.15) 0%, var(--hs-bg-dark) 100%);
}

.hired-sword-card.current::before {
  opacity: 1;
  background: linear-gradient(90deg, var(--hs-bronze), var(--hs-gold-accent), var(--hs-bronze));
}

/* Card Header */
.hs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 14px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(205, 127, 50, 0.2);
}

.hs-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--hs-bronze-light);
  line-height: 1.2;
}

.hs-type {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

.hs-grade {
  padding: 2px 8px;
  background: rgba(205, 127, 50, 0.2);
  border: 1px solid var(--hs-border);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--hs-bronze);
  text-transform: uppercase;
}

/* Card Costs */
.hs-costs {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.2);
}

.hs-cost {
  color: var(--hs-gold-accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.hs-upkeep-preview {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* Stats Preview */
.hs-stats-preview {
  padding: 8px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.15);
  letter-spacing: 0.5px;
}

.hs-stats-mini {
  padding: 6px 14px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Upkeep Status */
.hs-upkeep {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
}

.hs-upkeep.paid {
  color: #81c784;
  background: rgba(76, 175, 80, 0.1);
}

.hs-upkeep.due {
  color: #e57373;
  background: rgba(229, 115, 115, 0.1);
}

/* Unavailable Reason */
.hs-unavailable-reason {
  padding: 8px 14px;
  font-size: 0.8rem;
  color: #e57373;
  background: rgba(229, 115, 115, 0.1);
  font-style: italic;
}

/* Card Actions */
.hs-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(205, 127, 50, 0.15);
}

.hs-actions .btn {
  flex: 1;
}

/* ============================================
   HIRED SWORD DETAILS MODAL
   ============================================ */

.hired-sword-details {
  padding: 0;
}

.hs-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--hs-bg-light) 0%, var(--hs-bg-dark) 100%);
  border-bottom: 2px solid var(--hs-bronze);
}

.hs-detail-header h3 {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--hs-bronze-light);
}

.hs-source {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* Cost Boxes */
.hs-detail-costs {
  display: flex;
  gap: 15px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(205, 127, 50, 0.2);
}

.hs-cost-box {
  flex: 1;
  text-align: center;
  padding: 10px;
  background: rgba(205, 127, 50, 0.1);
  border: 1px solid var(--hs-border);
  border-radius: 8px;
}

.hs-cost-box .label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hs-cost-box .value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hs-gold-accent);
}

/* Stats Table */
.hs-stats-table {
  width: 100%;
  margin: 15px 20px;
  width: calc(100% - 40px);
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.hs-stats-table th,
.hs-stats-table td {
  padding: 10px 8px;
  text-align: center;
  border: 1px solid rgba(205, 127, 50, 0.2);
}

.hs-stats-table th {
  background: rgba(205, 127, 50, 0.15);
  color: var(--hs-bronze-light);
  font-weight: 700;
  font-size: 0.85rem;
}

.hs-stats-table td {
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

/* Detail Sections */
.hs-detail-section {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hs-detail-section strong {
  color: var(--hs-bronze-light);
}

.hs-detail-section.hs-may-hire {
  background: rgba(205, 127, 50, 0.05);
  font-size: 0.9rem;
}

/* Rules List */
.hs-rules-list {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.hs-rules-list li {
  margin-bottom: 8px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
}

.hs-rules-list li strong {
  color: var(--hs-gold-accent);
}

/* Detail Actions */
.hs-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(205, 127, 50, 0.2);
}

/* ============================================
   HIRE CONFIRMATION MODAL
   ============================================ */

.hire-confirm-modal {
  padding: 10px 0;
}

.hire-confirm-modal input {
  width: 100%;
  padding: 12px 15px;
  margin: 10px 0;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--hs-border);
  border-radius: 8px;
  color: white;
  font-size: 1rem;
}

.hire-confirm-modal input:focus {
  outline: none;
  border-color: var(--hs-bronze);
  box-shadow: 0 0 10px var(--hs-glow);
}

.hire-confirm-info {
  padding: 15px;
  background: rgba(205, 127, 50, 0.1);
  border: 1px solid var(--hs-border);
  border-radius: 8px;
  margin: 15px 0;
}

.hire-confirm-info p {
  margin: 5px 0;
  color: rgba(255, 255, 255, 0.8);
}

.hire-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}

/* ============================================
   DISMISS CONFIRMATION MODAL
   ============================================ */

.dismiss-confirm-modal {
  text-align: center;
  padding: 10px 0;
}

.dismiss-confirm-modal .warning-text {
  color: #e57373;
  font-weight: 600;
  margin: 15px 0;
}

.dismiss-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

/* ============================================
   ROSTER EDITOR - HIRED SWORD CARDS
   Bronze-Styling für Henchmen-Section
   ============================================ */

/* Hired Sword Card im Roster */
.unit-card.hired-sword {
  border: 2px solid var(--hs-border);
  background: linear-gradient(145deg, var(--hs-bg-light) 0%, var(--hs-bg-dark) 100%);
  position: relative;
}

.unit-card.hired-sword::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hs-bronze), var(--hs-gold-accent), var(--hs-bronze));
}

.unit-card.hired-sword:hover {
  border-color: var(--hs-border-hover);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), 0 0 15px var(--hs-glow);
}

/* Hired Sword Label */
.hired-sword-label {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--hs-bronze) 0%, var(--hs-bronze-dark) 100%);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Upkeep Badge im Roster */
.upkeep-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.upkeep-badge.paid {
  background: rgba(76, 175, 80, 0.2);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.upkeep-badge.due {
  background: rgba(229, 115, 115, 0.2);
  color: #e57373;
  border: 1px solid rgba(229, 115, 115, 0.3);
  animation: upkeepPulse 2s ease-in-out infinite;
}

@keyframes upkeepPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(229, 115, 115, 0.4);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(229, 115, 115, 0);
  }
}

/* Card Header für Hired Swords */
.unit-card.hired-sword .card-header {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, transparent 100%);
}

.unit-card.hired-sword .card-name {
  color: var(--hs-bronze-light);
}

.unit-card.hired-sword .card-type {
  color: rgba(205, 127, 50, 0.8);
}

/* XP Badge für Hired Swords */
.unit-card.hired-sword .xp-badge {
  background: var(--hs-bronze);
  color: white;
}

/* Cost Badge für Hired Swords */
.unit-card.hired-sword .cost-badge {
  background: rgba(205, 127, 50, 0.2);
  border-color: var(--hs-border);
  color: var(--hs-bronze-light);
}

/* ============================================
   SHARED MERCENARY CARD (HS + DP in Trading Post)
   Stats Table, Equipment Pills, Rule Pills
   ============================================ */

.merc-card {
  position: relative;
  padding: 0;
  background: linear-gradient(145deg, var(--hs-bg-light) 0%, var(--hs-bg-dark) 100%);
  border: 2px solid var(--hs-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
}

.merc-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--hs-bronze), transparent);
  opacity: 0.5;
}

.merc-card:hover { border-color: var(--hs-border-hover); transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 20px var(--hs-glow); }
.merc-card:hover::before { opacity: 1; }
.merc-card.unavailable { opacity: 0.5; cursor: not-allowed; }
.merc-card.unavailable:hover { transform: none; box-shadow: none; }
.merc-card.too-expensive { opacity: 0.6; }
.merc-card.current { border-color: var(--hs-bronze); background: linear-gradient(145deg, rgba(205,127,50,0.15) 0%, var(--hs-bg-dark) 100%); }
.merc-card.current::before { opacity: 1; background: linear-gradient(90deg, var(--hs-bronze), var(--hs-gold-accent), var(--hs-bronze)); }

/* DP Gold Variant */
.merc-card.dp-card { border-color: rgba(255,215,0,0.3); }
.merc-card.dp-card::before { background: linear-gradient(90deg, transparent, #ffd700, transparent); }
.merc-card.dp-card:hover { border-color: rgba(255,215,0,0.6); box-shadow: 0 8px 25px rgba(0,0,0,0.4), 0 0 20px rgba(255,215,0,0.2); }
.merc-card.dp-card.current { border-color: #ffd700; background: linear-gradient(145deg, rgba(255,215,0,0.1) 0%, var(--hs-bg-dark) 100%); }

/* Header */
.merc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px 8px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(205,127,50,0.15);
}

.merc-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--hs-bronze-light);
  line-height: 1.2;
}

.dp-card .merc-name { color: #ffd700; }

.merc-source {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  font-style: italic;
  margin-top: 1px;
}

.merc-grade {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.merc-grade.hs-color { background: rgba(205,127,50,0.2); border: 1px solid var(--hs-border); color: var(--hs-bronze); }
.merc-grade.dp-color { background: rgba(255,215,0,0.15); border: 1px solid rgba(255,215,0,0.3); color: #ffd700; }

/* Stats Table */
.merc-stats-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0,0,0,0.15);
}

.merc-stats-table th, .merc-stats-table td {
  padding: 4px 0;
  text-align: center;
  font-size: 0.72rem;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.merc-stats-table th:last-child, .merc-stats-table td:last-child { border-right: none; }

.merc-stats-table th {
  color: rgba(201,169,89,0.6);
  font-weight: 600;
  font-size: 0.65rem;
  background: rgba(0,0,0,0.2);
  padding: 3px 0;
}

.merc-stats-table td {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 0.82rem;
}

/* Equipment Pills */
.merc-equip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px;
}

.merc-equip-pill {
  padding: 2px 8px;
  background: rgba(139,90,43,0.15);
  border: 1px solid rgba(205,127,50,0.2);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--hs-bronze-light);
  cursor: pointer;
  transition: all 0.15s;
}

.merc-equip-pill:hover { background: rgba(205,127,50,0.25); border-color: var(--hs-bronze); }

/* Special Rule Pills */
.merc-rules-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 10px 6px;
}

.merc-rule-pill {
  padding: 2px 8px;
  background: rgba(147,112,219,0.1);
  border: 1px solid rgba(147,112,219,0.25);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #b39ddb;
  cursor: pointer;
  transition: all 0.15s;
}

.merc-rule-pill:hover { background: rgba(147,112,219,0.2); border-color: rgba(147,112,219,0.5); }

/* Skill Pills */
.merc-skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 10px 6px;
  align-items: center;
}

.merc-skills-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  margin-right: 2px;
}

.merc-skill-pill {
  padding: 2px 7px;
  background: rgba(76,175,80,0.08);
  border: 1px solid rgba(76,175,80,0.2);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #81c784;
  cursor: pointer;
  transition: all 0.15s;
}

.merc-skill-pill:hover { background: rgba(76,175,80,0.15); border-color: rgba(76,175,80,0.4); }

/* Costs Row */
.merc-costs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.04);
}

.merc-cost { color: var(--hs-gold-accent); font-weight: 700; font-size: 0.85rem; }
.merc-card.too-expensive .merc-cost { color: #e57373; }
.merc-upkeep { color: rgba(255,255,255,0.5); font-size: 0.78rem; }
.merc-rating { color: rgba(201,169,89,0.6); font-size: 0.75rem; font-weight: 600; }

/* Tagline */
.merc-tagline {
  padding: 6px 12px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
}

/* Unavailable */
.merc-unavailable {
  padding: 6px 12px;
  font-size: 0.75rem;
  color: #e57373;
  background: rgba(229,115,115,0.08);
  font-style: italic;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .hired-swords-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 15px 15px;
  }

  .hs-header, .merc-header {
    flex-direction: column;
    gap: 5px;
  }

  .hs-grade, .merc-grade {
    align-self: flex-start;
  }

  .hs-detail-costs {
    flex-direction: column;
    gap: 10px;
  }

  .hired-swords-rules {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .hired-swords-grid {
    grid-template-columns: 1fr;
  }

  .merc-equip-row, .merc-rules-row, .merc-skills-row {
    padding: 4px 8px;
  }

  .hs-stats-preview {
    font-size: 0.7rem;
  }
}
