/* styles.css - Folha de Estilos do Estudo Aplicado de Arduino */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700;800&family=Orbitron:wght@600;800;900&display=swap');

/* --- VARIÁVEIS / DESIGN SYSTEM --- */
:root {
  --bg-main: #0b0f19;
  --bg-sidebar: #111827;
  --bg-card: rgba(30, 41, 59, 0.5);
  --bg-card-hover: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 242, 254, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Cores Neon & Destaques */
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  
  --gradient-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-dark: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  
  --shadow-neon: 0 0 15px rgba(0, 242, 254, 0.35);
  --shadow-neon-green: 0 0 15px rgba(16, 185, 129, 0.35);
  --shadow-neon-yellow: 0 0 15px rgba(245, 158, 11, 0.5);
  
  --font-main: 'Inter', sans-serif;
  --font-display: 'Orbitron', sans-serif;
  --font-code: 'Fira Code', monospace;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --sidebar-width: 280px;
}

/* --- RESET & ESTRUTURA BÁSICA --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* --- LAYOUT DO APLICATIVO --- */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* --- SIDEBAR --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 24px 16px;
  transition: var(--transition-normal);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: 10px;
  box-shadow: var(--shadow-neon);
}

.brand-logo svg {
  width: 22px;
  height: 22px;
  fill: #000;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: #000;
  font-weight: 600;
  background: var(--gradient-primary);
  border: 1px solid rgba(0, 242, 254, 0.3);
  box-shadow: var(--shadow-neon);
}

.nav-item.active svg {
  fill: #000;
  stroke: #000;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- CONTEÚDO PRINCIPAL --- */
.main-content {
  flex-grow: 1;
  margin-left: var(--sidebar-width);
  padding: 40px;
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
}

.content-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.content-section.active {
  display: block;
}

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

/* Cabeçalhos de Seção */
.section-header {
  margin-bottom: 32px;
}

.section-tag {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  margin-bottom: 6px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 800px;
}

/* --- ESTILO DE CARTÃO GLASSMORPHIC --- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg {
  color: var(--accent-cyan);
}

/* --- TAB: CARACTERÍSTICAS (INTERATIVO) --- */
.explorer-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: start;
}

.hardware-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 480px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0b0f19 100%);
  border: 1px solid var(--border-color);
  border-radius: 20px;
}

/* Painel de detalhes lateral */
.details-panel {
  position: sticky;
  top: 40px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.info-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  flex-grow: 1;
  color: var(--text-muted);
}

.info-placeholder svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: var(--accent-cyan);
  opacity: 0.6;
  animation: pulse-slow 2s infinite ease-in-out;
}

.info-content {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.info-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  align-self: flex-start;
  margin-bottom: 12px;
}

.info-name {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.info-description {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.info-tip {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid var(--accent-yellow);
  padding: 14px;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: #fbbf24;
}

/* SVG interativo */
.arduino-svg {
  width: 100%;
  max-width: 580px;
  height: auto;
}

/* Interatividade nas partes do SVG */
.svg-interactive {
  cursor: pointer;
  transition: all var(--transition-fast);
}

/* Destaque ao passar o mouse */
.svg-interactive:hover {
  stroke: var(--accent-cyan) !important;
  stroke-width: 1.5px !important;
  filter: drop-shadow(0 0 6px var(--accent-cyan));
}

.svg-interactive.active {
  stroke: var(--accent-cyan) !important;
  stroke-width: 2px !important;
  fill-opacity: 0.25 !important;
  filter: drop-shadow(0 0 10px var(--accent-cyan));
}

/* Tabela de especificações técnicas rápida */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.spec-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

.spec-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.spec-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 4px;
}

/* --- TAB: DESENVOLVIMENTO --- */
.dev-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.badge-dev {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  margin-left: auto;
  text-transform: uppercase;
}

.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-yellow { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.features-list {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.features-list li svg {
  width: 16px;
  height: 16px;
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 3px;
}

.step-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.step-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 12px;
  position: relative;
}

.step-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.8;
  margin-bottom: 12px;
}

.step-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 6px;
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- TAB: PROGRAMAÇÃO --- */
.code-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media(max-width: 1024px) {
  .code-split, .explorer-layout {
    grid-template-columns: 1fr;
  }
}

/* Code block styles */
.code-container {
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-code);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.code-header {
  background: #111827;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.code-lang {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-size: 0.9rem;
}

code {
  font-family: var(--font-code);
  color: #e2e8f0;
}

.syntax-keyword { color: #f43f5e; }
.syntax-type { color: #3b82f6; }
.syntax-comment { color: #64748b; font-style: italic; }
.syntax-string { color: #10b981; }
.syntax-number { color: #fbbf24; }
.syntax-func { color: #60a5fa; }

/* Grid de Funções */
.functions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.func-card {
  padding: 16px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
  border-radius: 10px;
  transition: all var(--transition-fast);
}

.func-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(0, 242, 254, 0.2);
}

.func-name {
  font-family: var(--font-code);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.func-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.func-example {
  background: #06090f;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-code);
  font-size: 0.8rem;
  color: #c8d0e0;
}

/* --- TAB: ACESSÓRIOS & SENSORES --- */
.catalog-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #000;
  font-weight: 600;
  box-shadow: var(--shadow-neon);
}

.accessories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.accessory-card {
  display: flex;
  flex-direction: column;
}

.accessory-img-container {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.3) 0%, rgba(15, 23, 42, 0.5) 100%);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.accessory-card:hover .accessory-img-container {
  background: radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
  border-color: rgba(0, 242, 254, 0.2);
}

.accessory-card-img {
  height: 90px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-normal);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.accessory-card:hover .accessory-card-img {
  transform: scale(1.08) translateY(-2px);
}

.accessory-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.accessory-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.12);
  padding: 3px 8px;
  border-radius: 10px;
}

.accessory-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

.accessory-pins {
  margin-bottom: 16px;
}

.accessory-pins-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 6px;
}

.pin-tags-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pin-tag {
  font-size: 0.72rem;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  color: #e2e8f0;
}

.btn-view-code {
  background: transparent;
  border: 1px solid rgba(0, 242, 254, 0.3);
  color: var(--accent-cyan);
  padding: 10px;
  border-radius: 8px;
  width: 100%;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-view-code:hover {
  background: var(--gradient-primary);
  color: #000;
  border-color: transparent;
  box-shadow: var(--shadow-neon);
}

/* --- MODAL PARA EXIBIR CÓDIGO DO ACESSÓRIO --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  z-index: 95;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 680px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header {
  background: #1e293b;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 20px;
}

/* --- TAB: PROJETOS (COM SIMULAÇÃO INTERATIVA) --- */
.projects-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media(max-width: 1024px) {
  .projects-layout {
    grid-template-columns: 1fr;
  }
}

.project-select-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.project-option {
  padding: 16px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-option:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.project-option.active {
  border-color: rgba(0, 242, 254, 0.4);
  background: rgba(0, 242, 254, 0.05);
}

.project-option-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.project-option-diff {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #334155;
  color: var(--text-muted);
}

.project-option.active .project-option-diff {
  background: var(--gradient-primary);
  color: #000;
}

.bullet-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.bullet-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bullet-list li svg {
  color: var(--accent-cyan);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Painel de Simulação */
.simulation-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.simulation-view {
  background: #090e1a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

.sim-controls {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

.btn-sim {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-sim-start {
  background: var(--gradient-green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-sim-start:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon-green);
}

.btn-sim-stop {
  background: var(--accent-red);
  color: #fff;
}

.btn-sim-stop:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.45);
}

/* Elementos do Circuito Virtual Simulados */
.virtual-circuit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  margin: auto;
  position: relative;
  z-index: 10;
}

/* Mini LED Virtual no painel */
.virtual-led {
  width: 40px;
  height: 40px;
  border-radius: 50% 50% 20% 20%;
  background: #475569;
  border: 2px solid #64748b;
  position: relative;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.virtual-led::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

/* Estados acesos dos leds virtuais */
.virtual-led.red.on {
  background: #ef4444;
  border-color: #f87171;
  box-shadow: 0 0 25px #ef4444, inset 0 0 8px rgba(255,255,255,0.6);
}
.virtual-led.yellow.on {
  background: #fbbf24;
  border-color: #fcd34d;
  box-shadow: 0 0 25px #fbbf24, inset 0 0 8px rgba(255,255,255,0.6);
}
.virtual-led.green.on {
  background: #10b981;
  border-color: #34d399;
  box-shadow: 0 0 25px #10b981, inset 0 0 8px rgba(255,255,255,0.6);
}

/* Semáforo Virtual */
.virtual-traffic-light {
  background: #111827;
  border: 3px solid #374151;
  padding: 14px 10px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.virtual-traffic-light .virtual-led {
  width: 32px;
  height: 32px;
}

.pedestrian-button-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.pedestrian-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #f87171;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  transition: transform 0.1s;
}

.pedestrian-btn:active {
  transform: scale(0.9);
}

/* Sonar Virtual */
.sonar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ultrasonic-sensor {
  display: flex;
  gap: 8px;
}

.sensor-eye {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #334155;
  border: 4px solid #475569;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sensor-eye::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0f172a;
  border: 1px solid #1e293b;
}

.sensor-waves {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wave-bar {
  width: 4px;
  border-radius: 2px;
  background: #1e293b;
  transition: background var(--transition-fast), height var(--transition-fast);
}

.wave-bar:nth-child(1) { height: 10px; }
.wave-bar:nth-child(2) { height: 18px; }
.wave-bar:nth-child(3) { height: 26px; }

.sonar-box.active .wave-bar {
  background: var(--accent-cyan);
  animation: pulse-waves 0.8s infinite ease-in-out alternate;
}

.sonar-box.active .wave-bar:nth-child(1) { animation-delay: 0.1s; }
.sonar-box.active .wave-bar:nth-child(2) { animation-delay: 0.3s; }
.sonar-box.active .wave-bar:nth-child(3) { animation-delay: 0.5s; }

@keyframes pulse-waves {
  0% { transform: scaleY(0.6); opacity: 0.4; }
  100% { transform: scaleY(1.1); opacity: 1; filter: drop-shadow(0 0 4px var(--accent-cyan)); }
}

.range-control-box {
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.range-val {
  font-family: var(--font-code);
  font-size: 0.9rem;
  color: var(--accent-cyan);
}

/* Custom range input slider */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: #1e293b;
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

input[type=range]::-webkit-slider-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: var(--shadow-neon);
}

/* Monitor Serial Virtual */
.virtual-serial-monitor {
  width: 100%;
  background: #05070c;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-top: 16px;
  font-family: var(--font-code);
  font-size: 0.82rem;
  overflow: hidden;
}

.serial-title {
  background: #0f172a;
  padding: 6px 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

.serial-status {
  display: flex;
  align-items: center;
  gap: 4px;
}

.serial-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #475569;
}

.serial-status-dot.online {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.serial-output {
  height: 100px;
  padding: 10px;
  overflow-y: auto;
  color: #38bdf8;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.serial-output::-webkit-scrollbar {
  width: 4px;
}

/* --- TAB: QUIZ INTERATIVO --- */
.quiz-container {
  max-width: 760px;
  margin: 0 auto;
}

.quiz-progress-bar {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width var(--transition-normal);
  box-shadow: var(--shadow-neon);
}

.question-box {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.4;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.option-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: 12px;
  color: var(--text-main);
  text-align: left;
  font-size: 0.98rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.option-btn.selected {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
}

.option-btn.correct {
  border-color: var(--accent-green) !important;
  background: rgba(16, 185, 129, 0.08) !important;
  color: #34d399 !important;
}

.option-btn.incorrect {
  border-color: var(--accent-red) !important;
  background: rgba(239, 68, 68, 0.08) !important;
  color: #f87171 !important;
}

.quiz-feedback {
  display: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  animation: slideDown 0.3s ease-out;
}

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

.feedback-title {
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-title.correct { color: var(--accent-green); }
.feedback-title.incorrect { color: var(--accent-red); }

.feedback-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.quiz-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-quiz-next {
  background: var(--gradient-primary);
  color: #000;
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-neon);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-quiz-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.5);
}

.quiz-results {
  display: none;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.results-score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid var(--accent-cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-neon);
  background: radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.1) 0%, transparent 100%);
}

.results-score {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
}

.results-total {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.results-msg {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.results-desc {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 28px;
}

.btn-quiz-restart {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-quiz-restart:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* --- RESPONSIVIDADE GERAL --- */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    height: auto;
  }
  
  .main-content {
    margin-left: 0;
    padding: 24px;
    width: 100%;
  }
  
  .brand-section {
    margin-bottom: 16px;
  }
  
  .nav-menu {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }
  
  .nav-item {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .section-title {
    font-size: 1.7rem;
  }
}

/* Animações Auxiliares */
@keyframes pulse-slow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.03); }
}

/* --- ADICIONAL: SIMULADOR CANVAS LAB --- */
#simulator-header {
  max-height: 180px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s ease, margin-bottom 0.8s ease, padding 0.8s ease;
  margin-bottom: 20px;
}

#simulator-header.hide-header {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.canvas-simulator-container {
  height: 580px;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1), border var(--transition-normal), background var(--transition-normal);
}

@media (min-width: 993px) {
  body:has(#simulator-header.hide-header) .canvas-simulator-container {
    height: calc(100vh - 120px) !important;
  }
}

@media (max-width: 992px) {
  .canvas-simulator-container {
    height: auto !important;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: none !important;
    border: none !important;
    overflow: visible !important;
  }
  #circuit-canvas {
    height: 420px !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #06090f;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0), radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
  }
  .hud-card {
    position: static !important;
    width: 100% !important;
    box-shadow: none !important;
  }
  .canvas-analysis-panel.hud-card {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 16px;
  }
  .canvas-analysis-panel.hud-card > div {
    flex: 1 1 calc(50% - 8px);
  }
}

@media (max-width: 576px) {
  .canvas-analysis-panel.hud-card > div {
    flex: 1 1 100%;
  }
}

.canvas-toolbar {
  width: 250px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: 20px;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 242, 254, 0.3);
  transform: translateY(-1px);
}

.btn-tool.active {
  background: rgba(0, 242, 254, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.tool-badge {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 44px;
  text-align: center;
  letter-spacing: 0.5px;
}

.tool-badge.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.tool-badge.dark { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.tool-badge.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.tool-badge.yellow { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.tool-badge.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.tool-badge.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }

.btn-canvas-action {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 8px;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.btn-run-canvas {
  background: var(--gradient-green);
  color: #000;
  border-color: transparent;
  font-weight: 700;
}

.btn-run-canvas:hover {
  box-shadow: var(--shadow-neon-green);
  transform: translateY(-1px);
}

.btn-run-canvas.simulating {
  background: var(--accent-red) !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-clear-canvas:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.05);
}

.canvas-holder {
  background-color: #06090f;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0),
    radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 0);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.osc-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(0, 242, 254, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.05) 1px, transparent 1px);
  background-size: 14px 14px;
  background-position: center;
}

/* Event lines classes for Event Log panel */
.log-line {
  margin-bottom: 4px;
  line-height: 1.3;
}
.log-line.info { color: var(--accent-cyan); }
.log-line.success { color: var(--accent-green); }
.log-line.warn { color: var(--accent-yellow); }
.log-line.danger { color: var(--accent-red); }

/* Sub-menu Navigation */
.nav-sub-menu {
  margin-bottom: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--transition-normal) ease, opacity var(--transition-normal) ease, margin-top var(--transition-normal) ease;
}
.nav-sub-menu.active {
  max-height: 240px;
  opacity: 1;
  margin-top: 2px;
}
.nav-sub-item {
  color: var(--text-muted) !important;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 6px 12px 6px 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background-color var(--transition-fast) ease, color var(--transition-fast) ease;
}
.nav-sub-menu.active .nav-sub-item {
  opacity: 1;
  transform: translateY(0);
}
.nav-sub-menu.active .nav-sub-item:nth-child(1) {
  transition-delay: 0.10s, 0.10s, 0s, 0s;
}
.nav-sub-menu.active .nav-sub-item:nth-child(2) {
  transition-delay: 0.24s, 0.24s, 0s, 0s;
}
.nav-sub-menu.active .nav-sub-item:nth-child(3) {
  transition-delay: 0.38s, 0.38s, 0s, 0s;
}
.nav-sub-menu.active .nav-sub-item:nth-child(4) {
  transition-delay: 0.52s, 0.52s, 0s, 0s;
}
.nav-sub-menu.active .nav-sub-item:nth-child(5) {
  transition-delay: 0.66s, 0.66s, 0s, 0s;
}
.nav-sub-menu.active .nav-sub-item:nth-child(6) {
  transition-delay: 0.80s, 0.80s, 0s, 0s;
}
.nav-sub-item:hover {
  color: var(--text-main) !important;
  background-color: rgba(255, 255, 255, 0.04);
}
.nav-sub-item:hover .sub-dot {
  background-color: var(--accent-cyan) !important;
}
.nav-sub-item.active {
  color: var(--accent-cyan) !important;
  font-weight: 600;
  background-color: rgba(0, 242, 254, 0.08) !important;
}
.nav-sub-item.active .sub-dot {
  background-color: var(--accent-cyan) !important;
  box-shadow: 0 0 6px var(--accent-cyan);
}

.nav-item.active .chevron-icon {
  transform: rotate(180deg);
}

  . e d i t a b l e - c o d e - c a r d : h o v e r   . e d i t - o v e r l a y   {   o p a c i t y :   1   ! i m p o r t a n t ;   }  
 