/* =============================================================
   ÉDITEUR DE ROUTES - STYLES
   ============================================================= */

/* Bouton d'activation de l'éditeur de routes */
.game-buttons-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.roads-button {
  background: linear-gradient(135deg, #8b7355, #6b4f3b);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  width: 50px;
  height: 50px;
}

.roads-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #a38062, #8b7355);
}

.roads-button.active {
  background: linear-gradient(135deg, #4CAF50, #45A049);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.roads-button .ui-button-icon {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Menu déroulant du bouton routes */
.roads-menu {
  position: fixed;
  top: 80px;
  right: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 1001;
  min-width: 220px;
}

.roads-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #e0e0e0;
}

.roads-menu-item:last-child {
  border-bottom: none;
}

.roads-menu-item:hover {
  background: #f5f5f5;
}

.roads-menu-item .menu-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.roads-menu-item .menu-text {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.roads-editor-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 350px;
  max-height: 75vh;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1500;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.roads-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #8b7355, #6b4f3b);
  color: white;
}

.roads-editor-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.roads-editor-header button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.roads-editor-header button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.roads-editor-info {
  padding: 12px 16px;
  background: #FFF8E1;
  border-bottom: 1px solid #FFD54F;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roads-editor-info p {
  margin: 0;
  font-size: 13px;
  color: #F57C00;
}

.points-counter {
  font-size: 12px;
  font-weight: bold;
  color: #E65100;
  background: rgba(255, 152, 0, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  text-align: center;
}

.roads-editor-types {
  padding: 16px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
}

.roads-editor-types h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #666;
}

.road-type-buttons {
  display: flex;
  gap: 8px;
}

.road-type-btn {
  flex: 1;
  padding: 10px 12px;
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
  text-align: center;
}

.road-type-btn:hover {
  background: #e8e8e8;
  border-color: #c0c0c0;
}

.road-type-btn.active {
  background: linear-gradient(135deg, #8b7355, #a38062);
  color: white;
  border-color: #6b4f3b;
  box-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
}

.roads-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 8px;
  padding: 12px 16px;
  background: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
}

.roads-editor-actions button {
  padding: 10px 12px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.roads-editor-actions button:hover {
  background: #f0f0f0;
  border-color: #c0c0c0;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.roads-editor-actions button.save-btn {
  background: linear-gradient(135deg, #4CAF50, #45A049);
  color: white;
  border-color: #388E3C;
}

.roads-editor-actions button.save-btn:hover {
  background: linear-gradient(135deg, #45A049, #388E3C);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.roads-editor-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: white;
}

.roads-editor-list-container h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #666;
}

.roads-editor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.road-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s;
}

.road-item:hover {
  background: #e9ecef;
  border-color: #c0c0c0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.road-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.road-type-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.delete-road-btn {
  background: #FF5722;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.delete-road-btn:hover {
  background: #E64A19;
  transform: scale(1.1);
}

/* Aide visuelle pour les raccourcis */
.roads-editor-actions button[title]::after {
  content: attr(title);
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.roads-editor-actions button:hover[title]::after {
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .roads-editor-panel {
    width: 90%;
    right: 5%;
    max-height: 80vh;
  }

  .road-type-buttons {
    flex-direction: column;
  }

  .roads-editor-actions {
    grid-template-columns: 1fr;
  }
}
