/**
 * 📍 RouteStops Component Styles
 * Layout responsivo conforme especificação aprovada
 */

// ========================================
// 🎯 COMPONENTE HOST (para inserção dinâmica)
// ========================================

:host {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 600px !important; /* ✅ CORREÇÃO: Garante altura quando inserido dinamicamente */
  flex: 1 !important;
}

// ========================================
// 🎬 ANIMAÇÕES
// ========================================

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 🗺️ CONTAINER PRINCIPAL */
.route-stops-container {
  display: flex;
  height: 100%;
  min-height: 600px; /* ✅ CORREÇÃO: Altura mínima garantida para componentes dinâmicos */
  width: 100%;
  background: #f5f5f5;
  gap: 0;
  position: relative;
  overflow: hidden;
}

/* 🗺️ ÁREA PRINCIPAL DO MAPA */
.map-main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 6px 0 0 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 5px 0 5px 5px;
  min-height: 0; /* Importante para flex */
  min-width: 0; /* Importante para flex */
  
  /* Garante que o componente filho ocupe todo o espaço */
  app-route-map {
    display: flex !important;
    flex: 1 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }
}

/* 🔄 ESTADO DE LOADING DO MAPA */
.map-loading-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  min-height: 400px;
  
  .text-center {
    p {
      margin: 0;
      color: #6c757d;
      font-size: 14px;
    }
    
    .spinner-border {
      width: 3rem;
      height: 3rem;
    }
  }
}

/* 📋 SIDEBAR DIREITA - VERSÃO COMPACTA */
.sidebar-right {
  width: 350px;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 0 6px 6px 0;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
  margin: 5px 5px 5px 0;
  overflow: hidden;
  max-height: 100%; /* Garante que não exceda a altura do container */
}

/* 📝 CONTEÚDO DA SIDEBAR - OTIMIZADO */
.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0; /* Importante para flex funcionar */
}

/* 🎯 HEADER DA SIDEBAR - COMPACTO */
.sidebar-header {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  padding: 8px 12px; /* Reduzido de 12px 16px */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0; /* Não permite encolher */

  h3 {
    margin: 0;
    font-size: 14px; /* Reduzido de 16px */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px; /* Reduzido de 6px */

    i {
      font-size: 12px; /* Reduzido de 14px */
    }
  }

  .sidebar-stats {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduzido de 10px */

    .badge {
      background: rgba(255, 255, 255, 0.2);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.3);
      font-weight: 500;
      font-size: 10px; /* Reduzido de 11px */
      padding: 1px 4px; /* Reduzido de 2px 6px */
    }

    .connection-status {
      display: flex;
      align-items: center;
      gap: 2px; /* Reduzido de 3px */
      font-size: 10px; /* Reduzido de 11px */
      opacity: 0.9;

      i {
        font-size: 5px; /* Reduzido de 6px */
      }
    }
  }
}

/* 📋 CORPO DA SIDEBAR - OTIMIZADO */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #fafbfc;
  min-height: 0; /* Importante para flex */
}

/* 📋 LISTA DE PARADAS NA SIDEBAR */
.stops-list-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stop-card-sidebar {
  background: white;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #e9ecef;

  &:hover {
    background: #f8f9fa;
    transform: translateX(2px);
  }

  &.selected {
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.15);
  }
}

/* 🔢 NÚMERO DA SEQUÊNCIA NA SIDEBAR */
.stop-sequence-sidebar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
  flex-shrink: 0;
}

/* ℹ️ INFORMAÇÕES DA PARADA NA SIDEBAR */
.stop-info-sidebar {
  flex: 1;
  min-width: 0;

  .stop-address-sidebar {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  .stop-location-sidebar {
    margin-bottom: 4px;

    small {
      font-size: 11px;
      color: #6c757d;
      line-height: 1.1;
    }
  }

  .stop-badges-sidebar {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;

    .badge {
      font-size: 9px;
      padding: 1px 4px;
      border-radius: 10px;
      font-weight: 500;
      line-height: 1.2;

      &.badge-sm {
        font-size: 8px;
        padding: 1px 3px;
      }
    }
  }
}

/* 🎮 AÇÕES DA PARADA NA SIDEBAR */
.stop-actions-sidebar {
  display: flex;
  gap: 3px;
  flex-shrink: 0;

  .btn {
    padding: 3px 5px;
    font-size: 9px;
    border-radius: 3px;
    transition: all 0.2s ease;
    line-height: 1;

    &.btn-xs {
      padding: 2px 4px;
      font-size: 8px;
    }

    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    i {
      font-size: 8px;
    }
  }
}

/* 📋 ESTADO VAZIO NA SIDEBAR */
.empty-state-sidebar {
  padding: 30px 16px;
  text-align: center;
  color: #6c757d;

  i {
    margin-bottom: 10px;
    color: #dee2e6;
  }

  h6 {
    margin-bottom: 6px;
    color: #495057;
    font-size: 14px;
  }

  p {
    margin-bottom: 12px;
    font-size: 12px;
  }
}

/* 📊 FOOTER DA SIDEBAR - COMPACTO */
.sidebar-footer {
  background: white;
  padding: 8px 12px; /* Reduzido de 12px 16px */
  border-top: 1px solid #e9ecef;
  flex-shrink: 0; /* Não permite encolher */

  .sidebar-summary {
    margin-bottom: 6px; /* Reduzido de 8px */
    text-align: center;

    small {
      font-size: 10px; /* Reduzido de 11px */
    }
  }

  .btn {
    font-size: 11px; /* Reduzido de 12px */
    font-weight: 500;
    padding: 4px 8px; /* Reduzido de 6px 12px */
    border-radius: 4px; /* Reduzido de 5px */
    transition: all 0.2s ease;

    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3); /* Reduzido */
    }
  }
}

/* 📝 PAINEL DE DETALHES EXPANSÍVEL - COMPACTO */
.details-panel {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  transition: all 0.3s ease;
  max-height: 120px; /* Reduzido de 150px */
  overflow: hidden;
  flex-shrink: 0; /* Não permite encolher */

  &.expanded {
    max-height: 200px; /* Reduzido de 300px */
  }

  .details-header {
    background: white;
    padding: 6px 10px; /* Reduzido de 8px 12px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;

    h5 {
      margin: 0;
      font-size: 12px; /* Reduzido de 13px */
      font-weight: 600;
      color: #495057;
      display: flex;
      align-items: center;
      gap: 4px; /* Reduzido de 5px */

      i {
        color: #007bff;
        font-size: 10px; /* Reduzido de 11px */
      }
    }

    .btn {
      padding: 2px 4px; /* Reduzido de 3px 6px */
      font-size: 9px; /* Reduzido de 10px */
    }
  }

  .details-body {
    padding: 8px 10px; /* Reduzido de 12px */
    background: white;
    max-height: 180px; /* Reduzido de 250px */
    overflow-y: auto;

    .detail-item {
      display: flex;
      gap: 6px; /* Reduzido de 8px */
      margin-bottom: 8px; /* Reduzido de 12px */
      padding-bottom: 6px; /* Reduzido de 8px */
      border-bottom: 1px solid #f1f3f4;

      &:last-child {
        border-bottom: none;
        margin-bottom: 0;
      }

      i {
        font-size: 11px; /* Reduzido de 12px */
        margin-top: 1px;
        flex-shrink: 0;
      }

      > div {
        flex: 1;
        font-size: 11px; /* Reduzido de 12px */
        line-height: 1.3;

        strong {
          color: #212529;
          font-weight: 600;
        }

        small {
          color: #6c757d;
          font-size: 10px; /* Reduzido de 11px */
        }
      }
    }

    .detail-actions {
      display: flex;
      gap: 4px; /* Reduzido de 6px */
      margin-top: 8px; /* Reduzido de 12px */
      padding-top: 8px; /* Reduzido de 12px */
      border-top: 1px solid #f1f3f4;

      .btn {
        flex: 1;
        font-size: 10px; /* Reduzido de 11px */
        padding: 4px 6px; /* Reduzido de 5px 8px */
      }
    }
  }
}

/* 📝 PAINEL DE FORMULÁRIO - COMPACTO */
.form-panel {
  background: white;
  border-top: 1px solid #e9ecef;
  flex-shrink: 0; /* Não permite encolher */
  max-height: 200px; /* Adiciona limite de altura */

  .form-header {
    background: #f8f9fa;
    padding: 6px 10px; /* Reduzido de 8px 12px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;

    h5 {
      margin: 0;
      font-size: 12px; /* Reduzido de 13px */
      font-weight: 600;
      color: #495057;
      display: flex;
      align-items: center;
      gap: 4px; /* Reduzido de 5px */

      i {
        color: #28a745;
        font-size: 10px; /* Reduzido de 11px */
      }
    }

    .btn {
      padding: 2px 4px; /* Reduzido de 3px 6px */
      font-size: 9px; /* Reduzido de 10px */
    }
  }

  .form-body {
    padding: 8px 10px; /* Reduzido de 12px */
    max-height: 150px; /* Reduzido de 250px */
    overflow-y: auto;
  }
}

/* 📐 AJUSTES FINOS DE LAYOUT */
.map-main-area {
  min-width: 0; /* Previne overflow em flex */
}

.sidebar-right {
  min-width: 300px; /* Largura mínima */
  max-width: 400px; /* Largura máxima */
}

@media (max-width: 1200px) and (min-width: 1025px) {
  .sidebar-right {
    width: 320px;
  }
}

@media (min-width: 1400px) {
  .sidebar-right {
    width: 380px;
  }
}

// ========================================
// 🗺️ SEÇÃO DO MAPA (40% da altura)
// ========================================

.map-section {
  height: 40%;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  app-route-map {
    display: block;
    width: 100%;
    height: 100%;
  }
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;

  h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    i {
      color: #007bff;
    }
  }
}

.connectivity-indicator {
  .badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
}

// 🎛️ CONTROLES DO MAPA
.map-controls {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
  z-index: 1000;
  
  .map-controls-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
  }
  
  .controls-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
  }
  
  .control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;
    
    &:hover {
      color: #007bff;
      transform: translateY(-1px);
    }
    
    .form-check-input {
      margin: 0;
      cursor: pointer;
      
      &:checked {
        background-color: #007bff;
        border-color: #007bff;
      }
      
      &:focus {
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
      }
    }
    
    .control-label {
      display: flex;
      align-items: center;
      gap: 0.375rem;
      cursor: pointer;
      
      i {
        font-size: 1rem;
        
        &.text-primary {
          color: #007bff !important;
        }
        
        &.text-danger {
          color: #dc3545 !important;
        }
      }
    }
  }
  
  .controls-info {
    display: flex;
    align-items: center;
    
    small {
      display: flex;
      align-items: center;
      gap: 0.375rem;
      font-size: 0.75rem;
      color: #6c757d;
      
      i {
        color: #007bff;
      }
    }
  }
}

.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border: 2px dashed #90caf9;

  .map-info {
    text-align: center;
    color: #495057;

    h4 {
      margin: 0.5rem 0;
      color: #007bff;
    }

    p {
      margin: 0.5rem 0;
      color: #6c757d;
    }
  }

  .pins-preview {
    margin-top: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0.25rem;
  }
}

// ========================================
// 📋 SEÇÃO DE CONTEÚDO (60% da altura)
// ========================================

.content-section {
  height: 60%;
  padding: 1rem;
  overflow: hidden;

  .row {
    height: 100%;
    margin: 0;

    .col-md-6 {
      height: 100%;
      padding: 0 0.5rem;
    }
  }
}

// 📋 Lista de Paradas
.stops-list-container {
  height: 100%;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 0.5rem 0.5rem 0 0;

  h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    i {
      color: #007bff;
    }

    .badge {
      background: #007bff;
      color: white;
      font-size: 0.75rem;
      padding: 0.25rem 0.5rem;
      border-radius: 50%;
      min-width: 1.5rem;
      text-align: center;
    }
  }
}

.list-status {
  font-size: 0.8rem;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stops-list-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.loading-state {
  padding: 2rem;
  text-align: center;
  color: #6c757d;
}

.stops-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stop-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;

  &:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
    transform: translateY(-1px);
  }

  &.selected {
    border-color: #007bff;
    background: #f8f9ff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
  }
}

.stop-sequence {
  width: 2.5rem;
  height: 2.5rem;
  background: #007bff;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  flex-shrink: 0;
}

.stop-info {
  flex: 1;
  min-width: 0;

  .stop-address {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: #212529;
  }

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

  .stop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;

    .badge {
      font-size: 0.7rem;
      padding: 0.25rem 0.5rem;
    }
  }
}

.stop-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;

  .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.25rem;
  }
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: #6c757d;

  i {
    opacity: 0.5;
  }

  h5 {
    color: #495057;
    margin-bottom: 0.5rem;
  }

  p {
    margin-bottom: 1.5rem;
  }
}

.list-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 0 0 0.5rem 0.5rem;
}

// 📝 Formulário
.form-container {
  height: 100%;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.instructions-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: #6c757d;

  .instructions-content {
    max-width: 300px;

    h4 {
      color: #495057;
      margin-bottom: 1.5rem;
    }

    ul {
      list-style: none;
      padding: 0;
      margin: 0;

      li {
        padding: 0.5rem 0;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        text-align: left;

        i {
          width: 1.25rem;
          text-align: center;
        }
      }
    }
  }
}

.form-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 0.5rem 0.5rem 0 0;

  h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    i {
      color: #28a745;
    }
  }
}

.form-body {
  flex: 1;
  padding: 1.5rem;
}

.stop-details-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.stop-details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 0.5rem 0.5rem 0 0;

  h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    i {
      color: #17a2b8;
    }
  }
}

.stop-details-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.detail-section {
  margin-bottom: 1.5rem;

  h6 {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  p {
    margin-bottom: 0.25rem;
    color: #212529;
  }

  .d-flex {
    margin-top: 0.5rem;
  }
}

// ========================================
// 🔄 LOADING OVERLAY
// ========================================

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-content {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  
  p {
    margin: 0;
    color: #6c757d;
    font-weight: 500;
  }
}

// ========================================
// 📱 RESPONSIVIDADE
// ========================================

// Tablet
@media (max-width: 991.98px) {
  .route-stops-container {
    height: auto;
    min-height: 100vh;
  }
  
  .map-section {
    flex: 0 0 300px;
  }
  
  .content-section {
    .row {
      height: auto;
    }
    
    .col-md-8, .col-md-4 {
      margin-bottom: 1rem;
    }
  }
  
  .stops-list-container,
  .form-container,
  .instructions-container {
    min-height: 400px;
  }
}

// Mobile
@media (max-width: 767.98px) {
  .map-section {
    flex: 0 0 250px;
  }
  
  .map-header {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.75rem;
    
    h2 {
      font-size: 1.1rem;
    }
  }
  
  .map-controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .content-section {
    padding: 1rem;
  }
  
  .instructions-content {
    padding: 1.5rem;
    
    ul {
      max-width: none;
    }
  }
  
  .stats-grid {
    gap: 1rem;
  }
}

// Mobile pequeno
@media (max-width: 575.98px) {
  .map-controls {
    .btn {
      font-size: 0.8rem;
      padding: 0.25rem 0.5rem;
    }
  }
  
  .instructions-content {
    h4 {
      font-size: 1.1rem;
    }
    
    ul li {
      font-size: 0.85rem;
    }
  }
}

// ========================================
// 🎨 ANIMAÇÕES E TRANSIÇÕES
// ========================================

.route-stops-container {
  animation: fadeIn 0.3s ease-out;
}

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

.stops-list-container,
.form-container,
.instructions-container {
  transition: all 0.3s ease;
  
  &:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  }
}

// Transições suaves para mudanças de estado
.col-md-4 {
  transition: all 0.3s ease;
}

// ========================================
// 🔧 UTILITÁRIOS
// ========================================

.text-muted {
  color: #6c757d !important;
}

.text-info {
  color: #17a2b8 !important;
}

.text-primary {
  color: #007bff !important;
}

.text-warning {
  color: #ffc107 !important;
}

/* 📊 STATUS COLORS */
.text-success { color: #28a745 !important; }
.text-warning { color: #ffc107 !important; }
.text-danger { color: #dc3545 !important; }
.text-info { color: #17a2b8 !important; }
.text-primary { color: #007bff !important; }
.text-muted { color: #6c757d !important; }

.bg-success { background-color: #28a745 !important; }
.bg-warning { background-color: #ffc107 !important; }
.bg-danger { background-color: #dc3545 !important; }
.bg-info { background-color: #17a2b8 !important; }
.bg-primary { background-color: #007bff !important; }
.bg-secondary { background-color: #6c757d !important; }

/* 🔄 Overlay de Reconexão */
.reconnect-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  padding: 1rem;
}

.reconnect-panel {
  max-width: 500px;
  margin: 0 auto;

  .alert {
    margin: 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
}

/* 🎨 ANIMAÇÕES */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stop-card {
  animation: fadeIn 0.3s ease;
}

.form-content,
.stop-details-container,
.instructions-container {
  animation: fadeIn 0.4s ease;
}

/* 🔧 UTILITÁRIOS */
.spinner-border {
  width: 1.5rem;
  height: 1.5rem;
}

.badge {
  font-weight: 500;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
}

// 📱 RESPONSIVIDADE DOS CONTROLES
@media (max-width: 768px) {
  .map-controls {
    padding: 0.5rem;
    
    .map-controls-content {
      flex-direction: column;
      gap: 0.5rem;
      align-items: flex-start;
    }
    
    .controls-group {
      gap: 1rem;
    }
    
    .control-item {
      font-size: 0.8rem;
      
      .control-label i {
        font-size: 0.875rem;
      }
    }
    
    .controls-info small {
      font-size: 0.7rem;
    }
  }
}

// 🎛️ CONTROLES DA ROTA ATUAL
.route-controls {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  
  .route-controls-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
  }
  
  .route-inputs {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    
    .input-group {
      flex: 1;
      min-width: 200px;
      
      .input-group-text {
        background: #f8f9fa;
        border-color: #ced4da;
        
        i {
          font-size: 0.875rem;
        }
      }
      
      .form-control {
        border-color: #ced4da;
        font-size: 0.875rem;
        
        &:focus {
          border-color: #28a745;
          box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
        }
        
        &::placeholder {
          color: #6c757d;
          font-style: italic;
        }
      }
    }
  }
  
  .btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    
    &:hover:not(:disabled) {
      transform: translateY(-1px);
      box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    }
    
    i {
      margin-right: 0.375rem;
    }
  }
}

// 📱 RESPONSIVIDADE DOS CONTROLES DA ROTA
@media (max-width: 768px) {
  .route-controls {
    padding: 0.5rem;
    
    .route-controls-content {
      flex-direction: column;
      gap: 0.75rem;
      align-items: stretch;
    }
    
    .route-inputs {
      flex-direction: column;
      gap: 0.5rem;
      
      .input-group {
        min-width: auto;
        
        .form-control {
          font-size: 0.8rem;
        }
      }
    }
    
    .btn {
      padding: 0.5rem;
      font-size: 0.875rem;
    }
  }
}

/* 🗺️ FORÇA O MAPA A OCUPAR TODO O ESPAÇO */
:host {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

/* Garante que o Google Maps ocupe todo o container */
:host ::ng-deep {
  .route-map-container {
    height: 100% !important;
  }
  
  .map-container {
    height: 100% !important;
  }
  
  .google-map {
    height: 100% !important;
    width: 100% !important;
  }
  
  /* Força o Google Maps a ocupar todo o espaço */
  .gm-style {
    height: 100% !important;
    width: 100% !important;
  }
} 