/**
 * Dashboard Timeline - Estilos CSS
 * Estilos para o dashboard com ApexCharts
 */

/* ===== RESET E CONFIGURAÇÕES BÁSICAS ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== VARIÁVEIS CSS ===== */
:root {
  --primary-bg: #1a1a2e;
  --secondary-bg: #16213e;
  --accent-bg: #0f3460;
  --card-bg: #2a2a40;
  --text-primary: #ffffff;
  --text-secondary: #b8b8d1;
  --text-muted: #8a8a9e;
  --success-color: #00d4aa;
  --warning-color: #ffa726;
  --error-color: #f44336;
  --info-color: #29b6f6;
  --border-color: #3a3a5c;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ===== LAYOUT PRINCIPAL ===== */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== HEADER ===== */
.dashboard-header {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.dashboard-header h1 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  text-align: center;
  background: linear-gradient(45deg, var(--info-color), var(--success-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== INDICADORES DE STATUS ===== */
.status-indicators {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  background: var(--accent-bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  min-width: 150px;
}

.status-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.status-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.status-value.connected {
  color: var(--success-color);
}

.status-value.disconnected {
  color: var(--error-color);
}

/* ===== BOTÃO DE ATUALIZAÇÃO ===== */
.refresh-button {
  background: linear-gradient(45deg, var(--info-color), var(--success-color));
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  margin: 0 auto;
}

.refresh-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.refresh-button:active {
  transform: translateY(0);
}

/* ===== CONTEÚDO PRINCIPAL ===== */
.dashboard-content {
  display: block;
  margin-bottom: 24px;
}

/* ===== CONTAINER DO GRÁFICO ===== */
.chart-container {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  width: 100%;
  overflow: hidden;
}

.chart-container h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--text-primary);
  text-align: center;
}

/* ===== ÁREA DO GRÁFICO ===== */
.chart-area {
  background: var(--accent-bg);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border-color);
}

#chart {
  width: 100%;
  height: 520px;
}

/* ===== CONSOLE DE LOGS ===== */
.console-log {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.console-log h3 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

#log-content {
  background: var(--primary-bg);
  border-radius: 8px;
  padding: 16px;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

.log-entry {
  margin-bottom: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-timestamp {
  color: var(--text-muted);
  margin-right: 8px;
}

.log-info {
  color: var(--info-color);
}

.log-success {
  color: var(--success-color);
}

.log-warning {
  color: var(--warning-color);
}

.log-error {
  color: var(--error-color);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
  .status-indicators {
    flex-direction: column;
    align-items: center;
  }
  
  .status-item {
  width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 12px;
  }
  
  .dashboard-header h1 {
    font-size: 1.8rem;
  }
  
  .chart-container, .console-log {
    padding: 16px;
  }
  
  #chart {
    height: 400px;
  }
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.dashboard-container > * {
  animation: fadeIn 0.6s ease-out;
}

/* ===== SCROLLBAR PERSONALIZADA ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--accent-bg);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
