:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-subtle: #eff6ff;
  --success: #16a34a;
  --success-subtle: #f0fdf4;
  --danger: #dc2626;
  --danger-subtle: #fef2f2;
  --warning: #f59e0b;
  --warning-subtle: #fffbeb;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px -2px rgba(15,23,42,0.08);
  --shadow-lg: 0 12px 30px -4px rgba(15,23,42,0.12);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }
body { background: var(--surface-alt); color: var(--text-main); line-height: 1.5; -webkit-font-smoothing: antialiased; }

/* Layout Geral */
.app-container { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px 16px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; padding: 0 8px; }
.brand-icon { width: 38px; height: 38px; background: linear-gradient(135deg, var(--primary), #3b82f6); color: white; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.brand-text { font-size: 17px; font-weight: 700; color: var(--text-main); }
.brand-text span { color: var(--primary); font-size: 11px; background: var(--primary-subtle); padding: 2px 6px; border-radius: 4px; margin-left: 4px; vertical-align: middle; }

.nav-links { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; border-radius: var(--radius-sm); transition: var(--transition); cursor: pointer; }
.nav-link:hover, .nav-link.active { background: var(--primary-subtle); color: var(--primary); font-weight: 600; }
.nav-link .icon { font-size: 18px; }

.main-content { flex: 1; padding: 32px 40px 100px 40px; overflow-y: auto; max-width: 1400px; margin: 0 auto; width: 100%; }

/* Mobile Bottom Navigation */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { padding: 20px 16px 80px 16px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 65px; background: var(--surface);
    border-top: 1px solid var(--border); justify-content: space-around; align-items: center; z-index: 1000;
  }
  .bottom-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-muted); font-size: 11px; text-decoration: none; cursor: pointer; }
  .bottom-item.active { color: var(--primary); font-weight: 600; }
}

/* Dashboard Header */
.dashboard-header { margin-bottom: 28px; }
.dashboard-header h1 { font-size: 26px; font-weight: 700; color: var(--text-main); }
.dashboard-header p { color: var(--text-muted); font-size: 15px; margin-top: 4px; }

/* Scanner Hero Box */
.scanner-card {
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8); color: white; border-radius: var(--radius-lg);
  padding: 36px; margin-bottom: 36px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.scanner-card::after {
  content: ''; position: absolute; top: -50%; right: -20%; width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%); border-radius: 50%; pointer-events: none;
}
.scanner-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.scanner-subtitle { font-size: 14px; opacity: 0.9; margin-bottom: 24px; }
.scanner-input-group { display: flex; background: white; border-radius: 12px; padding: 6px; box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.scanner-input-group input {
  flex: 1; border: none; outline: none; padding: 12px 18px; font-size: 15px; color: var(--text-main); border-radius: 8px;
}
.btn-scan {
  background: var(--primary); color: white; border: none; padding: 12px 28px; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 8px;
}
.btn-scan:hover { background: #1e40af; transform: translateY(-1px); }

/* Feedback Progress Bar */
.scan-feedback {
  margin-top: 20px; background: rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 16px; backdrop-filter: blur(8px);
}
.progress-bar { height: 8px; background: rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress-fill { height: 100%; width: 0%; background: #38bdf8; transition: width 0.3s ease; }
.steps-list { list-style: none; display: flex; justify-content: space-between; font-size: 12px; opacity: 0.95; }
.steps-list li { display: flex; align-items: center; gap: 6px; }

/* Metrics Row */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 36px; }
.metric-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px;
}
.metric-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.metric-value { font-size: 26px; font-weight: 700; color: var(--text-main); }
.metric-badge { font-size: 12px; color: var(--success); background: var(--success-subtle); padding: 2px 8px; border-radius: 20px; align-self: flex-start; }

/* Preview Modal / Drawer */
.preview-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px;
  box-shadow: var(--shadow-md); margin-bottom: 36px; display: grid; grid-template-columns: 320px 1fr; gap: 28px;
}
@media (max-width: 850px) { .preview-card { grid-template-columns: 1fr; } }
.product-image-box { position: relative; border-radius: var(--radius-md); overflow: hidden; background: #fff; border: 1px solid var(--border); }
.product-image-box img { width: 100%; height: 320px; object-fit: contain; padding: 14px; }
.badge-discount {
  position: absolute; top: 12px; left: 12px; background: var(--danger); color: white; padding: 4px 10px;
  border-radius: 6px; font-size: 13px; font-weight: 700;
}
.product-details { display: flex; flex-direction: column; gap: 14px; }
.platform-pill {
  align-self: flex-start; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 12px;
  background: var(--border-light); color: var(--text-muted);
}
.pricing-row { display: flex; align-items: baseline; gap: 12px; }
.old-price { font-size: 15px; color: var(--text-muted); text-decoration: line-through; }
.current-price { font-size: 32px; font-weight: 800; color: var(--primary); }

/* Copy Generator Controls */
.copy-box { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin: 12px 0; }
.copy-textarea {
  width: 100%; height: 160px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px;
  font-family: monospace; font-size: 13px; resize: vertical; outline: none; background: white;
}
.style-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip {
  padding: 6px 14px; font-size: 12px; font-weight: 600; border-radius: 20px; background: white;
  border: 1px solid var(--border); cursor: pointer; transition: var(--transition);
}
.chip.active, .chip:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Share Buttons */
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn-share {
  padding: 10px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer;
  border: none; display: flex; align-items: center; gap: 8px; transition: var(--transition); text-decoration: none; color: white;
}
.btn-wa { background: #25d366; }
.btn-wa:hover { background: #20ba59; }
.btn-tg { background: #0088cc; }
.btn-tg:hover { background: #0077b5; }
.btn-ig { background: #e1306c; }
.btn-ig:hover { background: #c1275b; }
.btn-copy { background: var(--text-main); }
.btn-copy:hover { background: #334155; }
.btn-card-gen { background: #8b5cf6; }
.btn-card-gen:hover { background: #7c3aed; }

/* Offers Grid */
.offers-section { margin-top: 40px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 14px; }
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; }
.filter-select, .search-input {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; background: white; outline: none;
}
.offers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.offer-item-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: var(--transition); display: flex; flex-direction: column;
}
.offer-item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.offer-item-card img { width: 100%; height: 200px; object-fit: contain; padding: 12px; background: white; border-bottom: 1px solid var(--border-light); }
.offer-item-body { padding: 16px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.offer-item-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; height: 40px; overflow: hidden; }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius-sm); background: #0f172a; color: white; font-size: 14px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
