/* OpenClaw Dashboard - Estilos Principais */
/* Por Claw 🦞 - 16/03/2026 */

/* Importar tema primeiro */
@import url('theme.css');

/* Reset e base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.dashboard-header {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px var(--color-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Container principal */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 80px);
}

/* Tabs */
.tab-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

.tab {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem 0.5rem 0 0;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tab:hover:not(.active) {
  background-color: var(--color-bg-tab);
  opacity: 0.8;
}

.tab.active {
  position: relative;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--color-bg-tab-active);
}

/* Áreas do dashboard */
.dashboard-area {
  display: none;
  animation: fadeIn 0.3s ease;
}

.dashboard-area.active {
  display: block;
}

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

/* Cards */
.card, .service-card, .metric-card {
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.service-card {
  margin-bottom: 1rem;
}

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

.service-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.service-status {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
}

.status-up { background-color: var(--color-bg-status-up); }
.status-down { background-color: var(--color-bg-status-down); }
.status-warning { background-color: var(--color-bg-status-warning); }

.service-info p {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.service-info i {
  width: 1.25rem;
  color: var(--color-text-secondary);
}

/* Métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.metric-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--color-accent);
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.metric-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Botões */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--color-shadow);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn i {
  font-size: 0.875em;
}

/* Status global */
.global-status {
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-weight: 600;
}

.global-status i {
  font-size: 1.5rem;
}

/* Grid de sites */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Última atualização */
.last-update {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-light);
  font-size: 0.875rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .dashboard-header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .dashboard-container {
    padding: 1rem;
  }
  
  .tab-container {
    flex-wrap: wrap;
  }
  
  .tab {
    flex: 1;
    min-width: 120px;
    text-align: center;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .sites-grid {
    grid-template-columns: 1fr;
  }
  
  .theme-toggle {
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

/* Utilitários */
.mt-3 { margin-top: 1rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Animações */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}
