/* web/style.css - Painel do Servidor PreçoRadar */

:root {
  --bg-dark: #070a12;
  --bg-nav: #0c1222;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --bg-input: #151e33;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #06b6d4;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --cyan: #06b6d4;
  --emerald: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* Header */
.top-nav {
  background-color: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  padding: 16px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-hub {
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 2px 8px;
  border-radius: 9999px;
}

.brand-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Botão de Download */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.15s ease;
}

.btn-download:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #0284c7);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

/* Main Content */
.main-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

/* Grid de Métricas */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin: 6px 0 2px;
  letter-spacing: -0.5px;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.text-emerald { color: var(--emerald); }
.text-cyan { color: var(--cyan); }
.text-amber { color: var(--amber); }

/* Seções */
.content-section {
  margin-bottom: 36px;
}

.section-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Grid de Monitores */
.monitors-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.product-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-link {
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.product-link:hover {
  color: var(--cyan);
}

.price-display-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.current-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--emerald);
  letter-spacing: -0.5px;
}

.initial-price {
  font-size: 12px;
  color: var(--text-muted);
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 10px;
  margin-top: auto;
}

.card-btn-group {
  display: flex;
  gap: 6px;
}

.btn-tool {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-tool.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Empty State */
.empty-box {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* Card de Configurações */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.flex-1 { flex: 1; }

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-group input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.alert-box {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
}
.alert-box.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.alert-box.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-modal-box,
.chart-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 640px;
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: #fff;
}

.guide-steps {
  padding-left: 20px;
  color: var(--text-muted);
  line-height: 1.8;
}

.guide-steps code {
  background: #1e293b;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cyan);
}

.chart-svg-container {
  background: #090e1a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.chart-logs-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}

