/**
 * Route Editor UI Styles
 */

/* ============================================
   Edit Mode Toggle Button
   ============================================ */
.edit-mode-toggle {
  position: fixed;
  top: 140px;
  right: 20px;
  z-index: 98;
  padding: 12px 20px;
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.edit-mode-toggle:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.edit-mode-toggle.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

/* ============================================
   Edit Actions Bar
   ============================================ */
.edit-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: white;
  border-top: 2px solid var(--border-color);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease;
}

.edit-actions-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.edit-mode-indicator {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

.edit-actions-buttons {
  display: flex;
  gap: 12px;
}

/* ============================================
   Add Day Button
   ============================================ */
.add-day-button {
  padding: 20px;
  text-align: center;
}

.add-day-button .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.add-day-button .btn-primary span {
  font-size: 20px;
  font-weight: bold;
}

/* ============================================
   Day Edit Controls
   ============================================ */
.day-edit-controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.edit-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.edit-btn.danger:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.edit-btn span {
  font-size: 18px;
  font-weight: bold;
}

/* ============================================
   Activity Edit Controls
   ============================================ */
.activity-item {
  position: relative;
}

.activity-edit-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.activity-item:hover .activity-edit-controls {
  opacity: 1;
}

/* Always show on mobile devices (touch screens) */
@media (hover: none) and (pointer: coarse) {
  .activity-edit-controls {
    opacity: 1;
  }
}

.edit-btn-small {
  width: 28px;
  height: 28px;
  padding: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.edit-btn-small:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.edit-btn-small.danger:hover {
  background: #ef4444;
  border-color: #ef4444;
}

/* ============================================
   Info Message
   ============================================ */
.info-message {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  animation: slideInRight 0.3s ease;
}

.info-message.fade-out {
  animation: fadeOut 0.3s ease;
}

.info-message .message-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #3b82f6;
}

.info-message .message-text,
.error-message .message-text,
.warning-message .message-text,
.success-message .message-text {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
}

/* ============================================
   Modal for Activity/Day Editor
   ============================================ */
.activity-editor-modal {
  /* Reuse existing modal styles */
}

/* ============================================
   Form Fields for Activity Editor
   ============================================ */
.form-group-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.location-input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.location-input-group input {
  padding: 10px 14px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
}

.location-search-btn {
  grid-column: span 2;
  padding: 10px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.location-search-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ============================================
   Drag Handle (for reordering activities)
   ============================================ */
.drag-handle {
  cursor: grab;
  padding: 4px;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.activity-item:hover .drag-handle {
  opacity: 0.6;
}

.drag-handle:active {
  cursor: grabbing;
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  .edit-mode-toggle {
    top: auto;
    bottom: 80px;
    right: 20px;
  }

  .edit-actions-content {
    flex-direction: column;
    gap: 12px;
  }

  .edit-actions-buttons {
    width: 100%;
    justify-content: flex-end;
  }

  .day-edit-controls {
    flex-wrap: wrap;
  }

  .form-group-inline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .edit-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .edit-actions-buttons {
    flex-direction: column;
  }

  .edit-actions-buttons button {
    width: 100%;
  }
}
