/* ========================================
   BUILDINGS & BUILDING CARDS
   ======================================== */

/* Building Tabs */
.building-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px 15px 8px;
  background: linear-gradient(180deg, rgba(17, 24, 44, 0.96) 0%, rgba(11, 16, 31, 0.96) 100%);
  border-bottom: 1px solid rgba(96, 120, 188, 0.16);
}

.building-tabs .resource-tab-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
  vertical-align: -9px;
}

/* Buildings Container */
.buildings-container {
  flex: 1;
  padding: 12px 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#mining-page {
  background:
    radial-gradient(circle at top, rgba(93, 129, 229, 0.12) 0%, rgba(93, 129, 229, 0) 26%),
    linear-gradient(180deg, #101526 0%, #0a0f1d 100%);
}

/* ========== BUILDING CARD ==========*/
.building-card {
  background: linear-gradient(180deg, rgba(21, 29, 52, 0.98) 0%, rgba(14, 20, 38, 0.98) 100%);
  border: 1px solid rgba(93, 118, 184, 0.22);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease;
}

.building-card-mine {
  background:
    radial-gradient(circle at top right, rgba(230, 200, 120, 0.14) 0%, rgba(230, 200, 120, 0) 34%),
    linear-gradient(180deg, rgba(24, 31, 58, 0.98) 0%, rgba(12, 18, 35, 0.98) 100%);
  border-color: rgba(230, 200, 120, 0.22);
}

.building-card-quarry {
  background:
    radial-gradient(circle at top right, rgba(205, 210, 220, 0.12) 0%, rgba(205, 210, 220, 0) 34%),
    linear-gradient(180deg, rgba(34, 37, 48, 0.98) 0%, rgba(18, 21, 29, 0.98) 100%);
  border-color: rgba(188, 194, 206, 0.22);
}

.building-card-lumber_mill {
  background:
    radial-gradient(circle at top right, rgba(120, 204, 146, 0.13) 0%, rgba(120, 204, 146, 0) 34%),
    linear-gradient(180deg, rgba(21, 46, 33, 0.98) 0%, rgba(10, 25, 18, 0.98) 100%);
  border-color: rgba(120, 204, 146, 0.22);
}

.building-card-farm {
  background:
    radial-gradient(circle at top right, rgba(238, 175, 149, 0.13) 0%, rgba(238, 175, 149, 0) 34%),
    linear-gradient(180deg, rgba(58, 29, 29, 0.98) 0%, rgba(31, 16, 16, 0.98) 100%);
  border-color: rgba(238, 175, 149, 0.22);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.building-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.24);
  border-color: rgba(212, 175, 55, 0.3);
}

.building-card:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

/* ========== BUILDING CARD HEADER ==========*/
.building-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.building-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.building-icon {
  width: 47px;
  height: 47px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.building-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.building-name {
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  margin: 0;
}

/* ========== BUILDING STATS ==========*/
.building-card-stats {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 13px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border-left: 3px solid rgba(212, 175, 55, 0.45);
}

.stat-label {
  color: rgba(255, 255, 255, 0.66);
  font-weight: 500;
}

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

.stat-value .resource-inline-icon,
.stat-value .resource-inline-icon-lg {
  width: 26px;
  height: 26px;
  vertical-align: -7px;
}

.stat-time {
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  text-align: center;
  width: 100%;
}

/* ========== CAPACITY PROGRESS BAR ==========*/
.capacity-progress-container {
  width: 100%;
  margin-bottom: 12px;
}

.capacity-progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.16);
}

.capacity-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f74c8 0%, #d4af37 100%);
  transition: width 0.5s ease;
  position: relative;
}

.capacity-progress-fill.full {
  background: linear-gradient(90deg, #d4af37 0%, #f3de8a 100%);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.38);
}

.capacity-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ========== BUILDING ACTIONS ==========*/
.building-card-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.mine-card {
  border-color: rgba(212, 175, 55, 0.24);
  background: linear-gradient(180deg, rgba(36, 31, 12, 0.98) 0%, rgba(18, 17, 10, 0.98) 100%);
}

.mine-worker-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.mine-worker-badge.is-active {
  background: rgba(76, 175, 80, 0.12);
  border-color: rgba(76, 175, 80, 0.22);
  color: #8fe39c;
}

.mine-helper-row {
  align-items: flex-start;
}

.mine-actions-grid {
  grid-template-columns: 1fr;
}

.mine-action-wide {
  grid-column: 1 / -1;
}

.mine-upgrade-full {
  grid-column: 1 / -1;
}

/* Base button styles */
.btn {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Activate Button */
.btn-activate {
  background: linear-gradient(135deg, #4c6fa6 0%, #356b8d 100%);
  color: #fff;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.btn-activate:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a7cb8 0%, #3f789f 100%);
  box-shadow: 0 4px 12px rgba(76, 111, 166, 0.5);
}

/* Collect Button */
.btn-collect {
  background: linear-gradient(135deg, #d4af37 0%, #f0e68c 100%);
  color: #222;
  border: 1px solid rgba(240, 230, 140, 0.6);
  font-weight: 700;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
  }
  50% {
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.7);
  }
}

.btn-collect:hover:not(:disabled) {
  background: linear-gradient(135deg, #f0e68c 0%, #fff8dc 100%);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.8) !important;
  transform: scale(1.02);
}

/* Upgrade Button */
.btn-upgrade {
  background: linear-gradient(135deg, #5a7cb8 0%, #4c6fa6 100%);
  color: #fff;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.btn-upgrade:hover:not(:disabled) {
  background: linear-gradient(135deg, #6b8dc8 0%, #5a7cb8 100%);
  box-shadow: 0 4px 12px rgba(90, 124, 184, 0.5);
}

/* Maxed Button */
.btn-maxed {
  background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
  color: #999;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
  .building-card-stats {
    font-size: 12px;
  }

  .stat-row {
    padding: 6px 8px;
  }

  .stat-value {
    font-size: 13px;
  }

  .building-card-actions {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 10px 12px;
    font-size: 12px;
  }
}
