/* =========================================================================
   APPLETS E COMPONENTES INTERATIVOS
   ========================================================================= */

/* Container genérico para applets */
.applet-wrapper {
  background: var(--bg-card, #fff);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color, #e5e7eb);
  width: 100%;
  max-width: 800px;
  padding: 30px;
  margin: 20px auto;
}

.applet-title {
  text-align: center;
  color: var(--color-text-main, #333);
  margin-bottom: 5px;
  font-family: var(--font-title, inherit);
  font-weight: 800;
  font-size: 22px;
}

.applet-subtitle {
  text-align: center;
  color: var(--color-text-muted, #7f8c8d);
  font-size: 14px;
  margin-bottom: 30px;
}

/* =========================================================================
   APPLET: LINHA DO TEMPO (HISTÓRIA)
   ========================================================================= */

.timeline-container {
  position: relative;
  margin: 40px 0;
  padding: 20px 0;
}

.timeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 6px;
  background: var(--bg-card-subtle, #dfe6e9);
  transform: translateY(-50%);
  border-radius: 3px;
  z-index: 1;
}

.timeline-nodes {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
  width: 60px;
}

.timeline-node:hover {
  transform: scale(1.1);
}

.node-year {
  font-weight: bold;
  font-size: 14px;
  color: var(--color-text-main, #34495e);
  margin-bottom: 8px;
}

.node-dot {
  width: 24px;
  height: 24px;
  background: var(--bg-card, #fff);
  border: 4px solid var(--border-color, #b2bec3);
  border-radius: 50%;
  transition: all 0.3s;
}

/* Cores das Fases (Dinâmicas via classe ou inline style) */
.timeline-node.active .node-dot {
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* Painel de Informações */
.timeline-info-panel {
  background: var(--bg-card-subtle, #f8f9fa);
  border-left: 5px solid var(--border-color, #b2bec3);
  padding: 20px;
  border-radius: 0 8px 8px 0;
  min-height: 180px;
  transition: border-color 0.3s;
}

.fase-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.info-title {
  margin: 0 0 10px 0;
  color: var(--color-text-main, #2c3e50);
}

.info-desc {
  color: var(--color-text-muted, #555);
  line-height: 1.6;
  font-size: 15px;
  margin-bottom: 15px;
}

/* Tags de Conceitos (High-Yield para ENEM) */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.applet-tag {
  background: var(--bg-secondary, #e0e6ed);
  color: var(--color-text-main, #34495e);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: bold;
}

/* =========================================================================
   APPLET: SIMULADOR DE FÍSICA 2D
   ========================================================================= */

.canvas-area {
  position: relative;
  width: 100%;
  height: 350px;
  background: var(--bg-card-subtle, #e9ecef);
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-color, #dee2e6);
}

.physics-ball {
  position: absolute;
  width: 30px;
  height: 30px;
  background: var(--color-accent, #e74c3c);
  border-radius: 50%;
  left: 50%;
  transform: translateX(-50%);
  bottom: 300px; /* Dinâmico */
}

.physics-ground {
  position: absolute;
  width: 100%;
  height: 20px;
  background: #10b981;
  bottom: 0;
  left: 0;
}

.physics-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 15px;
  background: var(--bg-card-subtle, #f8f9fa);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.physics-controls button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.physics-btn-drop { background: var(--color-primary, #3498db); color: white; }
.physics-btn-drop:hover { background: var(--color-primary-glow, #2980b9); }
.physics-btn-reset { background: var(--color-text-muted, #95a5a6); color: white; }
.physics-btn-reset:hover { filter: brightness(0.9); }

/* Painel de Energias (Gráficos de Barras) */
.physics-dashboard {
  margin-top: 20px;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.bar-label {
  width: 160px;
  font-weight: bold;
  font-size: 13px;
  color: var(--color-text-main, #444);
}

.bar-container {
  flex-grow: 1;
  background: var(--bg-secondary, #ecf0f1);
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.1s linear;
}

.bar-value {
  position: absolute;
  right: 10px;
  top: 0;
  line-height: 20px;
  font-size: 11.5px;
  font-weight: bold;
  color: #333;
}

#bar-ep .bar-fill { background: var(--color-primary, #3498db); }
#bar-ec .bar-fill { background: #10b981; }
#bar-em .bar-fill { background: var(--color-secondary, #9b59b6); }
