:root {
  --bg-color: #030712;
  --glass-bg: rgba(15, 23, 42, 0.4);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-highlight: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #a3e635; /* Verde Neon Lumpic */
  --accent-glow: rgba(163, 230, 53, 0.4);
  --success-color: #10b981;
  --danger-color: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 2rem;
  /* Gradiente escuro hiper moderno animado */
  background: 
    radial-gradient(circle at 0% 0%, rgba(30, 58, 138, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(163, 230, 53, 0.08) 0%, transparent 50%),
    #030712;
  background-size: cover;
}

.dashboard-container {
  width: 100%;
  max-width: 1300px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 40px rgba(255,255,255,0.1);
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-highlight);
  border-radius: 1.25rem;
  padding: 1.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.premium-glow {
  position: relative;
}
.premium-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(163, 230, 53, 0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  padding: 2rem;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
  border-color: rgba(163, 230, 53, 0.2);
}

.stat-info h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.stat-info .value {
  font-size: 2.5rem;
  font-weight: 800;
  margin-top: 0.5rem;
  color: #fff;
}

.status-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}

.status-indicator.working {
  background-color: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-color);
  animation: pulse 2s infinite;
}

.status-indicator.paused {
  background-color: var(--danger-color);
  box-shadow: 0 0 15px var(--danger-color);
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 15px rgba(163, 230, 53, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

.console-container {
  display: flex;
  flex-direction: column;
  height: 550px;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1rem;
}

.console-header h3 {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.console-output {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 0.75rem;
  padding: 1.5rem;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #a7f3d0;
  box-shadow: inset 0 2px 20px rgba(0,0,0,0.8);
}

.scanlines {
  position: relative;
}
.scanlines::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

.console-line {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  animation: fadeIn 0.3s ease;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.system { color: #facc15; font-style: italic; }
.error { color: #ef4444; font-weight: bold; }
.success { color: #10b981; font-weight: bold; }

/* ======== RESPONSIVIDADE (MOBILE & TABLET) ======== */

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

@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  header p {
    font-size: 0.9rem;
    letter-spacing: 1px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1.5rem;
  }
  
  .glass-panel {
    padding: 1.25rem 1rem;
  }
  
  .console-container {
    height: 400px;
  }

  /* Modal de Configuração no Mobile vira 1 coluna */
  #config-modal .glass-panel > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  /* Ajusta SVG do mascote para não quebrar telas pequenas */
  #robot-mascot {
    width: 120px !important;
    height: 120px !important;
  }
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.mascot-container {
  width: 200px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
}

#robot-mascot {
  transition: all 0.3s ease;
}

/* Estado: Trabalhando */
#robot-mascot.working #robot-arm-l {
  animation: typeLeft 0.3s infinite alternate;
}
#robot-mascot.working #robot-arm-r {
  animation: typeRight 0.4s infinite alternate;
}
#robot-mascot.working #robot-glasses {
  transform-origin: 50px 30px;
  animation: thugLifeDrop 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Estado: Pausado */
#robot-mascot.paused #robot-eyes {
  transform: scaleY(0.1);
  transform-origin: center 30px;
}
#robot-mascot.paused #robot-glasses {
  opacity: 0;
  transform: translateY(-50px);
}

/* Animações Keyframes */
@keyframes thugLifeDrop {
  0% { transform: translateY(-50px) rotate(15deg); opacity: 0; }
  30% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(0) rotate(0deg); opacity: 1; }
}
@keyframes typeLeft {
  0% { transform: translateY(0) rotate(0); }
  100% { transform: translateY(3px) rotate(3deg); }
}
@keyframes typeRight {
  0% { transform: translateY(0) rotate(0); }
  100% { transform: translateY(2px) rotate(-3deg); }
}

.btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-start {
  background: linear-gradient(135deg, var(--accent-color), #2563eb);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.7);
}

.btn-start:active {
  transform: translateY(0);
}

.btn-stop {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-stop:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-stop:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
