:root {
  --bg-main: #080f1e;
  --bg-card: #0d1b2e;
  --bg-card-subtle: #13243c;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary: #38bdf8;
  --primary-dark: #0284c7;
  --primary-subtle: rgba(56, 189, 248, 0.12);
  --navy: #0f2137;
  --navy-dark: #050a14;
  --accent-samsung: #2b7fff;
  --radar-green: #10b981;
  --radar-glow: rgba(16, 185, 129, 0.4);
  --border: #1e3a5f;
  --border-focus: #38bdf8;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-text: #34d399;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --warning-text: #fbbf24;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-text: #f87171;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.6);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Header */
.dashboard-header {
  background: linear-gradient(135deg, var(--navy-dark) 0%, #0c1a2e 60%, #132a4a 100%);
  border: 1px solid var(--border);
  color: #ffffff;
  padding: 30px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.dashboard-header::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -5%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.badge-pill .dot {
  width: 8px;
  height: 8px;
  background-color: var(--radar-green);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px var(--radar-green);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px #10b981; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.header-meta {
  font-size: 0.82rem;
  color: #94a3b8;
  display: flex;
  gap: 16px;
  align-items: center;
}

.hub-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed #38bdf8;
}

.dashboard-title {
  font-size: 2.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #ffffff 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dashboard-subtitle {
  color: #cbd5e1;
  font-size: 1rem;
  max-width: 820px;
  line-height: 1.5;
}

/* Tactical Radar Hero Section */
.radar-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  box-shadow: var(--shadow-lg);
  align-items: center;
}

@media (max-width: 900px) {
  .radar-hero {
    grid-template-columns: 1fr;
  }
}

.radar-scope-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.radar-scope-container {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#radar-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.8);
  border: 2px solid #1e3a5f;
}

.radar-controls {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.ctrl-btn {
  background: #13243c;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn:hover, .ctrl-btn.active {
  background: var(--primary-dark);
  border-color: var(--primary);
  color: #ffffff;
}

/* Radar Target Lock HUD (Right Side of Hero) */
.radar-hud {
  background: #0a1424;
  border: 1px solid #1e3a5f;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid #1e3a5f;
  padding-bottom: 10px;
}

.hud-label {
  font-size: 0.75rem;
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.hud-status-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--radar-green);
  font-weight: 700;
}

.hud-target-card {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.hud-device-img {
  width: 90px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.hud-target-info {
  flex-grow: 1;
}

.hud-target-model {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
}

.hud-target-seller {
  font-size: 0.85rem;
  color: #38bdf8;
  font-weight: 600;
  margin-bottom: 8px;
}

.hud-target-price {
  font-size: 1.8rem;
  font-weight: 900;
  color: #34d399;
}

.hud-target-terms {
  font-size: 0.85rem;
  color: #cbd5e1;
  background: #13243c;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  line-height: 1.5;
}

.hud-actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Nav & Filter Toolbar */
.toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: #ffffff;
  background: var(--bg-card-subtle);
}

.tab-btn.active {
  background: var(--primary-dark);
  color: #ffffff;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  min-width: 200px;
  outline: none;
  background: #0a1424;
  color: #ffffff;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
}

.filter-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.85rem;
  background: #0a1424;
  color: var(--text-main);
  cursor: pointer;
}

/* Sections */
.radar-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
}

.section-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Weekly Briefing */
.briefing-box {
  background: #0a1424;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.briefing-box p {
  color: #e2e8f0;
  font-size: 0.98rem;
  line-height: 1.6;
}

.takeaways-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.takeaway-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  background: #0a1424;
  display: flex;
  flex-direction: column;
}

.takeaway-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--primary-subtle);
  color: var(--primary);
  margin-bottom: 10px;
}

.takeaway-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.takeaway-detail {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 14px;
  flex-grow: 1;
}

.evidence-box {
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  margin-bottom: 8px;
  color: #94a3b8;
}

.implication-box {
  background: rgba(43, 127, 255, 0.1);
  border-left: 3px solid var(--accent-samsung);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #bfdbfe;
}

/* Offers Grid with Device Visuals */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 22px;
}

.offer-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0a1424;
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.offer-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.offer-top-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.offer-device-preview {
  width: 58px;
  height: 90px;
  object-fit: contain;
  flex-shrink: 0;
}

.offer-meta-group {
  flex-grow: 1;
}

.offer-model {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.offer-storage {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.offer-seller-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.offer-seller-badge.operator {
  background: #0284c7;
  color: #ffffff;
}

.offer-seller-badge.retailer {
  background: #ea580c;
  color: #ffffff;
}

.offer-pricing {
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.promo-price {
  font-size: 1.5rem;
  font-weight: 900;
  color: #34d399;
}

.official-price {
  font-size: 0.95rem;
  text-decoration: line-through;
  color: var(--text-light);
}

.discount-tag {
  background: var(--success-bg);
  color: var(--success-text);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.offer-specs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  flex-grow: 1;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.spec-key {
  color: var(--text-muted);
}

.spec-val {
  text-align: right;
  color: #f1f5f9;
  font-weight: 600;
}

.offer-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Campaign Gallery with Real Extracted Creatives */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 22px;
}

.campaign-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0a1424;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease;
}

.campaign-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}

.banner-img-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: #020617;
}

.campaign-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  flex-grow: 1;
}

.campaign-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.campaign-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  background: var(--bg-card-subtle);
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

/* Reviews Grid with Thumbnails */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 22px;
}

.review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: #0a1424;
  display: flex;
  flex-direction: column;
}

.review-thumb-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.review-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.review-summary {
  font-size: 0.88rem;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.feedback-lists {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.82rem;
}

.feedback-praise {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #34d399;
}

.feedback-praise ul, .feedback-critique ul {
  padding-left: 18px;
  margin-top: 4px;
}

.feedback-critique {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #f87171;
}

/* Opportunities */
.opportunities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 22px;
}

.opportunity-card {
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent-samsung);
  border-radius: var(--radius-md);
  padding: 24px;
  background: #0a1424;
  display: flex;
  flex-direction: column;
}

.opp-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.opp-box {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.opp-hypothesis {
  background: var(--bg-card-subtle);
  color: #cbd5e1;
}

.opp-evidence {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
}

.opp-action {
  background: rgba(43, 127, 255, 0.12);
  border: 1px solid rgba(43, 127, 255, 0.35);
  color: #bfdbfe;
}

.opp-action b {
  color: #60a5fa;
}

/* Sources Table */
.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.sources-table th, .sources-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.sources-table th {
  background: #0a1424;
  color: var(--text-muted);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.lightbox-content {
  max-width: 900px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.lightbox-img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  background: #020617;
}

.lightbox-meta {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Footer */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-style: italic;
}
