/**
 * 🎯 Estilos do RouteLocationTrackerComponent - Rastreamento de Rotas
 * 
 * Estilos otimizados para exibição de informações de localização de rotas
 * com layout responsivo, badges coloridos e elementos visuais modernos.
 */

// ========================================
// 🎨 VARIÁVEIS DE CORES
// ========================================

:root {
  --route-primary: #2563eb;
  --route-secondary: #64748b;
  --route-success: #059669;
  --route-warning: #d97706;
  --route-danger: #dc2626;
  --route-info: #0891b2;
  
  --origin-color: #059669;
  --current-color: #2563eb;
  --destination-color: #dc2626;
  
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

// ========================================
// 🎯 CONTAINER PRINCIPAL
// ========================================

.route-location-container {
  padding: 1.5rem;
  background: #f8fafc;
  min-height: 100vh;
  
  @media (max-width: 768px) {
    padding: 1rem;
  }
}

// ========================================
// 🎯 HEADER DA ROTA
// ========================================

.route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  border: 1px solid var(--card-border);
  
  @media (max-width: 768px) {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

.route-info {
  flex: 1;
}

.route-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--route-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  
  i {
    color: var(--route-secondary);
  }
  
  @media (max-width: 768px) {
    justify-content: center;
    font-size: 1.25rem;
  }
}

.route-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  
  @media (max-width: 768px) {
    justify-content: center;
    flex-wrap: wrap;
  }
}

.route-type {
  background: var(--route-info);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.route-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-refresh {
  background: var(--route-primary);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  
  &:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
  }
  
  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  i {
    font-size: 1rem;
  }
}

// ========================================
// 🎯 GRID DE CONTEÚDO
// ========================================

.route-content-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  
  @media (max-width: 1200px) {
    grid-template-columns: repeat(2, 1fr);
  }
  
  @media (max-width: 768px) {
    grid-template-columns: 1fr;
  }
}

// ========================================
// 🎯 CARDS DE INFORMAÇÃO
// ========================================

.info-card,
.location-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  }
  
  h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--route-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    i {
      font-size: 1rem;
    }
  }
}

.info-item {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  
  &:last-child {
    margin-bottom: 0;
  }
  
  strong {
    color: var(--route-secondary);
    font-weight: 600;
  }
}

.timestamp {
  color: var(--route-info);
  font-weight: 500;
}

// ========================================
// 🎯 CARDS DE LOCALIZAÇÃO
// ========================================

.location-card {
  position: relative;
  
  &.origin-card {
    border-left: 4px solid var(--origin-color);
    
    .origin-icon {
      color: var(--origin-color);
    }
  }
  
  &.current-card {
    border-left: 4px solid var(--current-color);
    
    .current-icon {
      color: var(--current-color);
    }
  }
  
  &.destination-card {
    border-left: 4px solid var(--destination-color);
    
    .destination-icon {
      color: var(--destination-color);
    }
  }
}

.location-address {
  font-weight: 600;
  color: var(--route-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.location-city {
  color: var(--route-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.location-zipcode {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.location-coordinates {
  color: #64748b;
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  margin-top: 0.5rem;
}

.location-status {
  margin-top: 1rem;
}

.loading-address {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--route-secondary);
  font-size: 0.875rem;
  
  i {
    color: var(--route-info);
  }
}

// ========================================
// 🎯 BADGES DE STATUS
// ========================================

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  
  &.status-pending {
    background: #fef3c7;
    color: #92400e;
  }
  
  &.status-progress {
    background: #dbeafe;
    color: #1e40af;
  }
  
  &.status-completed {
    background: #d1fae5;
    color: #065f46;
  }
  
  &.status-delayed {
    background: #fed7d7;
    color: #c53030;
  }
  
  &.status-cancelled {
    background: #f3f4f6;
    color: #374151;
  }
  
  // Status do histórico
  &.history-status-moving {
    background: #dbeafe;
    color: #1e40af;
  }
  
  &.history-status-stopped {
    background: #fef3c7;
    color: #92400e;
  }
  
  &.history-status-delivering {
    background: #d1fae5;
    color: #065f46;
  }
  
  &.history-status-loading {
    background: #e0e7ff;
    color: #3730a3;
  }
}

// ========================================
// 🎯 SEÇÃO DO MAPA
// ========================================

.map-section {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  margin-bottom: 2rem;
  
  h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--route-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    i {
      color: var(--route-info);
    }
  }
}

.map-container {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  
  iframe {
    display: block;
    width: 100%;
  }
}

// ========================================
// 🎯 SEÇÃO DO HISTÓRICO
// ========================================

.history-section {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--card-border);
  
  h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--route-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    i {
      color: var(--route-warning);
    }
  }
}

.history-container {
  max-height: 400px;
  overflow-y: auto;
  
  &::-webkit-scrollbar {
    width: 6px;
  }
  
  &::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    
    &:hover {
      background: #94a3b8;
    }
  }
}

.history-item {
  padding: 1rem;
  border-left: 3px solid #e2e8f0;
  margin-bottom: 1rem;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  transition: all 0.2s ease;
  
  &:hover {
    background: #f1f5f9;
    border-left-color: var(--route-info);
  }
  
  &.current-location {
    border-left-color: var(--route-primary);
    background: #eff6ff;
    
    &::before {
      content: 'ATUAL';
      position: absolute;
      top: 0.5rem;
      right: 0.5rem;
      background: var(--route-primary);
      color: white;
      padding: 0.125rem 0.5rem;
      border-radius: 10px;
      font-size: 0.625rem;
      font-weight: 700;
      letter-spacing: 0.5px;
    }
  }
  
  &:last-child {
    margin-bottom: 0;
  }
  
  position: relative;
}

.history-time {
  font-size: 0.875rem;
  color: var(--route-info);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.history-status {
  margin-bottom: 0.75rem;
}

.history-address {
  font-weight: 500;
  color: var(--route-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.history-details {
  margin-bottom: 0.5rem;
}

.speed-info {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--route-info);
  font-size: 0.875rem;
  font-weight: 500;
  
  i {
    font-size: 0.75rem;
  }
}

.history-description {
  color: #64748b;
  font-size: 0.875rem;
  font-style: italic;
}

.loading-history {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  color: var(--route-secondary);
  
  i {
    color: var(--route-info);
  }
}

// ========================================
// 🎯 AÇÕES DO HISTÓRICO
// ========================================

.history-actions {
  margin-top: 1.5rem;
  text-align: center;
}

.btn-load-more {
  background: transparent;
  color: var(--route-primary);
  border: 2px solid var(--route-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  
  &:hover {
    background: var(--route-primary);
    color: white;
    transform: translateY(-1px);
  }
  
  i {
    font-size: 0.875rem;
  }
}

// ========================================
// 🎯 ANIMAÇÕES
// ========================================

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

.route-content-grid > *,
.map-section,
.history-section {
  animation: fadeIn 0.5s ease-out;
}

// ========================================
// 🎯 RESPONSIVIDADE AVANÇADA
// ========================================

@media (max-width: 480px) {
  .route-location-container {
    padding: 0.75rem;
  }
  
  .route-header,
  .info-card,
  .location-card,
  .map-section,
  .history-section {
    padding: 1rem;
  }
  
  .route-content-grid {
    gap: 1rem;
  }
  
  .history-item {
    padding: 0.75rem;
  }
} 