/* =============================================
 * Traffic Page — Styles bổ sung
 * ============================================= */

/* Form group */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  padding-left: 2px;
}

/* Route card */
.route-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.route-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  transition: var(--transition);
}

.route-card[data-level="smooth"]::before { background: #2ed573; }
.route-card[data-level="normal"]::before { background: #ffc107; }
.route-card[data-level="moderate"]::before { background: #ff9f43; }
.route-card[data-level="heavy"]::before { background: #ff4757; }
.route-card[data-level="severe"]::before { background: #ff0000; }
.route-card[data-level="unknown"]::before { background: #a0a0a0; }

/* Route header */
.route-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.route-card__name {
  font-size: 1.1rem;
  font-weight: 700;
}

.route-card__delete {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  opacity: 0.5;
  transition: var(--transition);
}

.route-card__delete:hover {
  opacity: 1;
  background: rgba(255, 71, 87, 0.2);
}

/* Route addresses */
.route-card__addresses {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.route-card__addr {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.route-card__addr-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.route-card__addr-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin: 6px auto;
  display: block;
}

/* Traffic info row */
.route-card__traffic {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-sm);
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.traffic-stat {
  text-align: center;
}

.traffic-stat__value {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.traffic-stat__label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Traffic badge */
.traffic-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.traffic-badge.smooth { background: rgba(46, 213, 115, 0.2); color: #2ed573; }
.traffic-badge.normal { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.traffic-badge.moderate { background: rgba(255, 159, 67, 0.2); color: #ff9f43; }
.traffic-badge.heavy { background: rgba(255, 71, 87, 0.2); color: #ff4757; }
.traffic-badge.severe { background: rgba(255, 0, 0, 0.2); color: #ff0000; }
.traffic-badge.unknown { background: rgba(160, 160, 160, 0.2); color: #a0a0a0; }

/* Alternative routes */
.alt-routes {
  margin-top: var(--space-md);
}

.alt-routes__title {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.alt-route {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

.alt-route__name {
  color: var(--text-secondary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: var(--space-sm);
}

.alt-route__time {
  font-weight: 600;
  white-space: nowrap;
}

/* Traffic legend */
.traffic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

.legend-item {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

/* Route loading skeleton */
.route-card--loading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-card--loading::after {
  content: '⏳ Đang kiểm tra giao thông...';
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Route error */
.route-card--error {
  border-color: rgba(255, 71, 87, 0.3);
}

.route-card__error {
  font-size: 0.85rem;
  color: #ff6b81;
  padding: var(--space-sm);
  background: rgba(255, 71, 87, 0.1);
  border-radius: var(--radius-sm);
}

/* Delay badge */
.delay-badge {
  font-size: 0.75rem;
  color: #ff6b81;
  font-weight: 500;
}

/* Quick result */
.quick-result {
  animation: slideIn 0.3s ease;
}
