/* ========================================
   BARRACKS PAGE STYLES
   ======================================== */

.barracks-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 15px 10px;
  background: linear-gradient(180deg, rgba(16, 21, 40, 0.98) 0%, rgba(10, 14, 27, 0.98) 100%);
  border-bottom: 1px solid rgba(95, 120, 190, 0.14);
}

.barracks-tab-btn {
  padding: 12px 8px;
  background: rgba(59, 74, 117, 0.2);
  border: 1px solid rgba(95, 120, 190, 0.18);
  color: #fff;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  background-clip: padding-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.barracks-tab-btn.active {
  background: linear-gradient(135deg, #4f73b8 0%, #2b3d66 100%);
  border-color: #d4af37;
  box-shadow: none;
}

.barracks-tab-btn[data-type="attacker"].active {
  background: linear-gradient(135deg, rgba(160, 52, 67, 0.98) 0%, rgba(84, 26, 34, 0.98) 100%);
  border-color: rgba(255, 168, 94, 0.95);
  color: #fff3e7;
}

.barracks-tab-btn[data-type="defender"].active {
  background: linear-gradient(135deg, rgba(55, 92, 168, 0.98) 0%, rgba(32, 50, 102, 0.98) 100%);
  border-color: rgba(134, 197, 255, 0.95);
  color: #eef7ff;
}

.barracks-tab-btn[data-type="my-soldiers"].active {
  background: linear-gradient(135deg, #4f73b8 0%, #2b3d66 100%);
  border-color: #d4af37;
}

.barracks-tab-btn:focus,
.barracks-tab-btn:focus-visible,
.barracks-tab-btn:focus-within,
.barracks-tab-btn:active {
  outline: none !important;
  box-shadow: none !important;
  border-color: rgba(95, 120, 190, 0.18) !important;
}

.barracks-tab-btn.active:focus,
.barracks-tab-btn.active:focus-visible,
.barracks-tab-btn.active:focus-within,
.barracks-tab-btn.active:active {
  border-color: #d4af37 !important;
  box-shadow: none !important;
}

.barracks-tab-btn[data-type="attacker"].active:focus,
.barracks-tab-btn[data-type="attacker"].active:focus-visible,
.barracks-tab-btn[data-type="attacker"].active:focus-within,
.barracks-tab-btn[data-type="attacker"].active:active {
  border-color: rgba(255, 168, 94, 0.95) !important;
}

.barracks-tab-btn[data-type="defender"].active:focus,
.barracks-tab-btn[data-type="defender"].active:focus-visible,
.barracks-tab-btn[data-type="defender"].active:focus-within,
.barracks-tab-btn[data-type="defender"].active:active {
  border-color: rgba(134, 197, 255, 0.95) !important;
}

.barracks-container {
  padding: 14px 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Troop Card */
.troop-card {
  background: linear-gradient(180deg, rgba(27, 34, 63, 0.98) 0%, rgba(16, 22, 40, 0.98) 100%);
  border: 1px solid rgba(95, 120, 190, 0.22);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.troop-card:hover {
  transform: translateY(-2px);
}

.troop-card:active {
  transform: translateY(0) scale(0.995);
}

.troop-card-attacker {
  border-color: rgba(255, 107, 107, 0.22);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24), inset 0 0 24px rgba(255, 107, 107, 0.04);
}

.troop-card-attacker:hover {
  border-color: rgba(255, 107, 107, 0.38);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26), inset 0 0 28px rgba(255, 107, 107, 0.06);
}

.troop-card-defender {
  border-color: rgba(79, 115, 184, 0.24);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24), inset 0 0 24px rgba(79, 115, 184, 0.04);
}

.troop-card-defender:hover {
  border-color: rgba(79, 115, 184, 0.4);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.26), inset 0 0 28px rgba(79, 115, 184, 0.07);
}

.troop-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
  padding-bottom: 12px;
}

.troop-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.troop-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.troop-title {
  font-size: 26px;
  font-weight: bold;
  color: #fff;
}

.troop-title-level {
  color: #d4af37;
  font-size: 14px;
  font-weight: 700;
}

.troop-hero-icon {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.troop-hero-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.5);
  transform-origin: center;
}

.troop-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.troop-stat-item {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.troop-stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  display: block;
  margin-bottom: 4px;
}

.troop-stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #d4af37;
}

.troop-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-hire {
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  color: #fff;
  box-shadow: 0 10px 20px rgba(76, 175, 80, 0.22);
}

.btn-upgrade-troop {
  background: linear-gradient(135deg, #d4af37 0%, #a8860e 100%);
  color: #000;
  box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.cost-info-small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  display: block;
}

/* My Soldiers List */
.my-soldiers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.soldier-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid #4c6fa6;
  border: 1px solid rgba(95, 120, 190, 0.14);
  position: relative;
  overflow: hidden;
}

.soldier-item-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}

.soldier-item-accent-attacker {
  background: linear-gradient(180deg, rgba(255, 107, 107, 0.95) 0%, rgba(255, 146, 43, 0.95) 100%);
}

.soldier-item-accent-defender {
  background: linear-gradient(180deg, rgba(79, 115, 184, 0.95) 0%, rgba(90, 185, 255, 0.95) 100%);
}

.soldier-item-attacker {
  border-color: rgba(255, 107, 107, 0.22);
  background: linear-gradient(180deg, rgba(66, 24, 34, 0.32) 0%, rgba(29, 17, 24, 0.22) 100%);
}

.soldier-item-defender {
  border-color: rgba(79, 115, 184, 0.24);
  background: linear-gradient(180deg, rgba(24, 36, 66, 0.3) 0%, rgba(17, 22, 36, 0.22) 100%);
}

.soldier-item-survivor {
  padding-left: 14px;
}

.soldier-info-main {
  display: flex;
  flex-direction: column;
}

.soldier-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.soldier-name {
  font-weight: bold;
  color: #fff;
}

.troop-list-icon {
  width: 51px;
  height: 51px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.troop-list-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.5);
  transform-origin: center;
}

.soldier-item-attacker .troop-list-icon,
.troop-card-attacker .troop-hero-icon,
.troop-card-attacker .troop-hire-icon {
  box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.16);
}

.soldier-item-defender .troop-list-icon,
.troop-card-defender .troop-hero-icon,
.troop-card-defender .troop-hire-icon {
  box-shadow: 0 0 0 1px rgba(79, 115, 184, 0.18);
}

.soldier-count {
  font-size: 18px;
  font-weight: bold;
  color: #d4af37;
}

/* Attack Modal Styles */
.target-card {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 15px;
}

.target-name {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  text-align: center;
  margin-bottom: 15px;
}

.target-resources {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.target-defenders {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
}

.target-defenders h4 {
  margin-bottom: 10px;
  color: #ff6b6b;
}

/* Hire Troops Modal Styles */
.troop-hire-info {
  background: linear-gradient(180deg, rgba(26, 34, 60, 0.96) 0%, rgba(16, 21, 39, 0.98) 100%);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.troop-type-header {
  font-size: 20px;
  font-weight: bold;
  color: #d4af37;
  margin-bottom: 15px;
  text-align: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 10px;
}

.troop-type-header-rich {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.troop-hire-icon {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.troop-hire-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.5);
  transform-origin: center;
}

.troop-badge-icon {
  width: 33px;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  vertical-align: -10px;
  margin-right: 8px;
}

.troop-badge-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.5);
  transform-origin: center;
}

.attack-survivor-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.troop-hire-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
}

.stat-name {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.stat-value {
  color: #d4af37;
  font-weight: bold;
  font-size: 14px;
}

.cost-per-unit {
  background: rgba(76, 111, 166, 0.14);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.cost-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin: 0 0 8px 0;
}

.cost-display {
  color: #fff;
  font-size: 13px;
  font-weight: bold;
}

.available-resources {
  background: rgba(76, 111, 166, 0.12);
  padding: 10px;
  border-radius: 12px;
  border-left: 3px solid #4caf50;
}

.available-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  margin: 0;
}

.hire-troops-cost {
  background: rgba(255, 255, 255, 0.04);
  padding: 15px;
  border-radius: 14px;
}

.hire-troops-cost p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  margin: 0 0 8px 0;
}

.cost-items-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cost-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  color: #d4af37;
  font-weight: bold;
  font-size: 13px;
}
