/* ========================================
   MODALES - Modals
   ======================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid #667eea;
  position: relative;
}

.modal-content h2 {
  color: #ffd700;
  margin-bottom: 20px;
  text-align: center;
  font-size: 24px;
}

.close-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  width: 100%;
  margin-top: 20px;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.close-btn:hover {
  background: #c0392b;
}

/* Modal de recherche */
#researchModal .modal-content {
  max-width: 800px;
}

.research-tree {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.research-item {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #555;
  border-radius: 10px;
  padding: 15px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.research-item:hover:not(.researched):not(.locked) {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.research-item.researched {
  background: rgba(39, 174, 96, 0.2);
  border-color: #27ae60;
}

.research-item.locked {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.3);
}

.research-icon {
  font-size: 36px;
  text-align: center;
  margin-bottom: 10px;
  display: block;
}

.research-name {
  color: white;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  margin-bottom: 8px;
  display: block;
}

.research-description {
  color: #aaa;
  font-size: 12px;
  text-align: center;
  margin-bottom: 10px;
  display: block;
  line-height: 1.4;
}

.research-cost-display {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  color: #ffd700;
  font-weight: bold;
  font-size: 13px;
  margin-top: 10px;
}

.research-badges {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}

.research-badge {
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid #ffd700;
  color: #ffd700;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
}

.research-badge.researched {
  background: rgba(39, 174, 96, 0.3);
  border-color: #27ae60;
  color: #27ae60;
}

/* Modal de gestion des tours */
#towersModal .modal-content {
  max-width: 900px;
}

.towers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.tower-list-item {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid #555;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  gap: 15px;
  align-items: center;
}

.tower-list-icon {
  font-size: 36px;
  min-width: 50px;
  text-align: center;
}

.tower-list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tower-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tower-list-name {
  color: white;
  font-weight: bold;
  font-size: 16px;
}

.tower-list-level {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
}

.tower-list-stats {
  display: flex;
  gap: 15px;
  color: #aaa;
  font-size: 13px;
}

.tower-list-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}

.tower-list-targeting {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tower-list-targeting label {
  color: #aaa;
  font-size: 11px;
  text-transform: uppercase;
}

.tower-list-targeting select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #555;
  color: white;
  padding: 6px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.tower-list-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.2s;
  color: white;
}

.tower-list-btn:hover {
  transform: translateY(-1px);
}

.tower-list-btn.upgrade {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.tower-list-btn.upgrade:hover {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.tower-list-btn.augment {
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.tower-list-btn.augment:hover {
  background: linear-gradient(135deg, #af7ac5 0%, #9b59b6 100%);
}

.tower-list-btn.sell {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.tower-list-btn.sell:hover {
  background: linear-gradient(135deg, #ec7063 0%, #e74c3c 100%);
}

.no-towers-message {
  text-align: center;
  color: #aaa;
  padding: 40px 20px;
  font-size: 16px;
}
