/* ============================================
   TECHNOCEL GR — Caminhão Interativo (Sensores)
   Componente da seção #tecnologia
   ============================================ */

.sensores-section {
  padding-top: var(--space-2xl);
  background: var(--bg-primary);
}

.sensores-head {
  max-width: 720px;
  margin-bottom: var(--space-2xl);
}

.sensores-head h2 {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.sensores-head p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* --- Layout: palco (SVG) + painel lateral --- */
.sensores-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: stretch;
}

.sensores-stage {
  flex: 1.7 1 620px;
  min-width: min(100%, 540px);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: linear-gradient(160deg, #0d1526 0%, var(--bg-card) 55%, #0c1322 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
}

.sensores-stage svg {
  width: 100%;
  height: auto;
  display: block;
}

.svg-mono,
.sensores-panel .skicker,
.sensores-alert {
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Mono', Consolas, 'Courier New', monospace;
}

/* --- Animações SVG --- */
@keyframes omPing   { 0% { transform: scale(.45); opacity: .9; } 75% { opacity: .12; } 100% { transform: scale(2.3); opacity: 0; } }
@keyframes omDash   { to { stroke-dashoffset: -72; } }
@keyframes omRoad   { to { stroke-dashoffset: -56; } }
@keyframes omSpin   { to { transform: rotate(360deg); } }
@keyframes omBlink  { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .15; } }
@keyframes omRise   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes omGlow   { 0%, 100% { opacity: .95; } 50% { opacity: .3; } }
@keyframes omWm     { 0%, 100% { opacity: .07; transform: scale(1); } 50% { opacity: .14; transform: scale(1.04); } }

.anim-spin-slow { animation: omSpin 7s linear infinite; transform-box: fill-box; transform-origin: center; }
.anim-wheel     { animation: omSpin 1.9s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
.anim-road      { animation: omRoad 1.05s linear infinite; }
.anim-road--slow{ animation-duration: 1.6s; }
.anim-wm        { animation: omWm 4.5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; opacity: .1; }
.anim-dash      { animation: omDash .8s linear infinite; }
.anim-ping-central { animation: omPing 1.3s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-blink     { animation: omBlink 1s steps(1) infinite; }

/* --- Cavalo mecânico: desloca no desengate --- */
#tractorGroup {
  transition: transform .8s cubic-bezier(.3, .7, .25, 1);
}

#tractorGroup.shift {
  transform: translateX(-30px);
}

/* --- Destaques de violação --- */
.hl { display: none; }
.hl.on { display: block; animation: omGlow 1.1s ease-in-out infinite; }

/* Jornada: linha do tempo fixa (sem pulsar; só o trecho excedido pisca) */
.hl--static.on { animation: none; }
.anim-blink--fast { animation: omBlink .9s steps(1) infinite; }

/* --- Marcadores (pontos de sensor) --- */
.marker { cursor: pointer; outline: none; }

.marker__ring {
  fill: none;
  stroke: rgba(255, 255, 255, .85);
  stroke-width: 2;
  animation: omPing 2.8s cubic-bezier(.2, .6, .4, 1) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.marker__core {
  fill: #ffffff;
  stroke: rgba(8, 24, 48, .9);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 7px rgba(170, 220, 255, .55));
  transition: fill .2s ease;
}

.marker.on .marker__ring {
  stroke: #FF4D5E;
  animation: omPing 1s cubic-bezier(.2, .6, .4, 1) infinite;
  animation-delay: 0s !important;
}

.marker.on .marker__core {
  fill: #FF4D5E;
  stroke: rgba(255, 160, 168, .95);
  filter: drop-shadow(0 0 9px rgba(255, 77, 94, .95));
}

.marker:focus-visible .marker__core {
  stroke: var(--accent-cyan);
  stroke-width: 3.5;
}

/* --- Chips (legenda clicável) --- */
.sensores-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.schip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(150, 190, 240, .28);
  background: rgba(255, 255, 255, .045);
  color: rgba(226, 238, 255, .88);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .2px;
  cursor: pointer;
  transition: border-color .25s, background .25s, color .25s;
}

.schip:hover { border-color: rgba(255, 255, 255, .55); }

.schip .schip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(190, 230, 255, .7);
  flex-shrink: 0;
}

.schip.on {
  border-color: rgba(255, 77, 94, .7);
  background: rgba(255, 77, 94, .14);
  color: #FFC9CE;
}

.schip.on .schip__dot {
  background: #FF4D5E;
  box-shadow: 0 0 8px rgba(255, 77, 94, .95);
}

.schip--tour {
  font-weight: 700;
  letter-spacing: .3px;
  border-color: rgba(6, 182, 212, .6);
  background: rgba(6, 182, 212, .12);
  color: var(--accent-cyan);
}

.schip--tour.on {
  border-color: rgba(255, 77, 94, .7);
  background: rgba(255, 77, 94, .14);
  color: #FFC9CE;
}

/* --- Painel lateral --- */
.sensores-panel {
  flex: 1 1 340px;
  min-width: 300px;
  max-width: 460px;
  box-sizing: border-box;
  min-height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
}

.sensores-panel .spanel__view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: omRise .45s ease both;
  flex: 1;
}

.sensores-panel .sbadge {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(6, 182, 212, .35);
  background: rgba(6, 182, 212, .08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sensores-panel .sbadge--alert {
  border-color: rgba(255, 77, 94, .45);
  background: rgba(255, 77, 94, .12);
}

.sensores-panel .skicker {
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(140, 200, 255, .75);
}

.sensores-panel .skicker--alert { color: rgba(255, 150, 158, .85); }

.sensores-panel h3 {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sensores-panel p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.spanel__header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.spanel__legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
}

.spanel__legend > div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.spanel__legend .sdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sdot--ok    { background: #ffffff; box-shadow: 0 0 8px rgba(180, 225, 255, .8); }
.sdot--alert { background: #FF4D5E; box-shadow: 0 0 8px rgba(255, 77, 94, .9); }

/* Caixa de alerta */
.sensores-alert {
  border: 1px solid rgba(255, 77, 94, .45);
  background: linear-gradient(180deg, rgba(255, 45, 70, .10), rgba(255, 45, 70, .05));
  border-radius: 14px;
  padding: 14px 16px;
}

.sensores-alert__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.sensores-alert__tag {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: #FF7A85;
  font-weight: 600;
}

.sensores-alert__time { font-size: 11px; color: rgba(255, 255, 255, .55); }

.sensores-alert__msg {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 235, 237, .95);
  line-height: 1.5;
}

.sensores-alert__status {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 1.2px;
  color: rgba(150, 210, 255, .85);
}

.sensores-alert__status .sdot--alert {
  width: 7px;
  height: 7px;
  animation: omBlink 1s steps(1) infinite;
}

/* Fluxo de resposta */
.spanel__flow {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.spanel__flow-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sflow {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.sflow--sensor  { border: 1px solid rgba(255, 77, 94, .55); color: #FFB3BA; background: rgba(255, 77, 94, .10); }
.sflow--central { border: 1px solid rgba(6, 182, 212, .55); color: #9FD9FF; background: rgba(6, 182, 212, .12); }
.sflow--acao    { border: 1px solid rgba(255, 255, 255, .3); color: #ffffff; background: rgba(255, 255, 255, .06); }

.spanel__flow-steps .sarrow { color: rgba(255, 255, 255, .4); font-size: 13px; }

/* Rodapé da seção */
.sensores-foot {
  margin-top: var(--space-md);
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  font-size: 11.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Responsivo --- */
@media (max-width: 1024px) {
  .sensores-panel { max-width: none; min-height: 0; }
}

@media (max-width: 768px) {
  .sensores-stage { padding: var(--space-sm); }
  .sensores-panel { padding: var(--space-md); }
}

/* --- Acessibilidade: movimento reduzido --- */
@media (prefers-reduced-motion: reduce) {
  .anim-spin-slow, .anim-wheel, .anim-road, .anim-wm,
  .anim-dash, .anim-ping-central, .anim-blink, .anim-blink--fast,
  .marker__ring, .hl.on,
  .sensores-alert__status .sdot--alert,
  .sensores-panel .spanel__view {
    animation: none !important;
  }
  #tractorGroup { transition: none; }
}
