/* ==========================================================================
   EPT Maricá Lite - Estilos da Tela de Horários (horarios.css)
   ========================================================================== */

.horarios-container {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Seção de Busca */
.search-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-intro h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.search-intro p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 2px;
}

.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box-wrapper .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-light);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  outline: none;
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(211, 19, 30, 0.12);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  display: none;
}

.search-clear-btn.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filtros rápidos em pílula */
.quick-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.quick-filters::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  white-space: nowrap;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-pill.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(211, 19, 30, 0.25);
}

/* Lista de Linhas */
.linhas-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 2px;
}

.linhas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card Individual de Linha */
.linha-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.linha-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(211, 19, 30, 0.3);
}

.linha-card:active {
  transform: scale(0.99);
}

.linha-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.linha-code-badge {
  background: var(--color-primary);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 46px;
  height: 42px;
  padding: 0 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(211, 19, 30, 0.25);
}

.linha-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.linha-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.linha-itinerary {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.linha-action {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.linha-action .chevron {
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-light);
  transition: transform 0.2s ease;
}

.linha-card:hover .chevron {
  transform: translateX(3px);
  color: var(--color-primary);
}

/* Skeleton Screens (Loading Elegante) */
.skeleton-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.skeleton {
  background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-badge {
  width: 46px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}

.skeleton-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 14px;
  width: 80%;
}

.skeleton-line.short {
  width: 45%;
  height: 10px;
}

/* Erro e Estado Vazio */
.status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.status-card .status-icon {
  font-size: 2.5rem;
  margin-bottom: 4px;
}

.status-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.status-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  max-width: 320px;
}

/* Modal / Bottom Sheet de Horários */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--bg-surface);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  border-radius: 24px 24px 0 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.modal-backdrop.open .modal-sheet {
  transform: translateY(0);
}

.modal-drag-indicator {
  width: 40px;
  height: 4px;
  background: var(--border-focus);
  border-radius: var(--radius-full);
  margin: 0 auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.modal-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-close-btn {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Abas de Sentido e Dias no Modal */
.modal-tabs {
  display: flex;
  background: var(--bg-app);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.modal-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.modal-tab.active {
  background: var(--bg-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* Grid de Horários */
.horarios-scroll-container {
  overflow-y: auto;
  max-height: 45vh;
  padding-right: 4px;
}

.horarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  padding: 8px 0;
}

.horario-pill {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: all 0.18s ease;
}

.horario-pill.next-departure {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(211, 19, 30, 0.3);
  position: relative;
}

.horario-pill.next-departure::after {
  content: 'Próximo';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #10B981;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
}
