/* MODULE: Campaigns | FILE: styles.css */

/* ─── Layout ──────────────────────────────────────────────────────── */
.campaigns-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  max-width: 1440px;
  margin: 0 auto;
}

.campaigns-page__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.campaigns-page__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
}

.campaigns-page__filters {
  display: flex;
  gap: 0.75rem;
}

.filter-select {
  background: #1e2443;
  color: #c4c7d4;
  border: 1px solid #2a2f4e;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  outline: none;
}

.filter-select:focus {
  border-color: #635bff;
}

/* ─── Campaign Table ──────────────────────────────────────────────── */
.campaign-table-wrap {
  background: #1e2443;
  border-radius: 0.75rem;
  overflow-x: auto;
}

.campaign-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.campaign-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b8fa3;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #2a2f4e;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.campaign-table th:hover {
  color: #635bff;
}

.campaign-table th--active {
  color: #635bff;
}

.sort-arrow {
  margin-left: 0.25rem;
  font-size: 0.625rem;
}

.campaign-table td {
  font-size: 0.8125rem;
  color: #c4c7d4;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid #1a1f36;
  white-space: nowrap;
}

.campaign-table tbody tr {
  cursor: pointer;
}

.campaign-table tbody tr:hover td {
  background: rgba(99, 91, 255, 0.04);
}

.campaign-name-cell {
  font-weight: 600;
  color: #ffffff;
}

.platform-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.platform-badge--meta { background: rgba(24, 119, 242, 0.15); color: #1877f2; }
.platform-badge--google { background: rgba(234, 67, 53, 0.15); color: #ea4335; }
.platform-badge--tiktok { background: rgba(0, 0, 0, 0.15); color: #ffffff; }
.platform-badge--linkedin { background: rgba(10, 102, 194, 0.15); color: #0a66c2; }

.efficiency-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.efficiency-badge--green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.efficiency-badge--amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.efficiency-badge--red   { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ─── Campaign Detail ─────────────────────────────────────────────── */
.campaign-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  max-width: 1440px;
  margin: 0 auto;
}

.campaign-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.campaign-detail__name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.campaign-detail__back {
  background: none;
  border: none;
  color: #635bff;
  font-size: 0.875rem;
  cursor: pointer;
}

.campaign-detail__back:hover {
  text-decoration: underline;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* ─── Metrics Chart ───────────────────────────────────────────────── */
.metrics-chart-card {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1.25rem;
  grid-column: 1 / -1;
}

.metrics-chart-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.metrics-chart-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.metric-selector {
  background: #2a2f4e;
  color: #c4c7d4;
  border: none;
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  outline: none;
}

.metrics-canvas-wrap {
  width: 100%;
  height: 240px;
  position: relative;
}

.metrics-canvas-wrap canvas {
  width: 100%;
  height: 100%;
}

/* ─── Efficiency Gauge ────────────────────────────────────────────── */
.efficiency-card {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.efficiency-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.gauge-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.gauge-ring svg {
  transform: rotate(-90deg);
}

.gauge-ring__bg {
  fill: none;
  stroke: #2a2f4e;
  stroke-width: 10;
}

.gauge-ring__fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.gauge-ring__fill--green  { stroke: #22c55e; }
.gauge-ring__fill--amber  { stroke: #f59e0b; }
.gauge-ring__fill--red    { stroke: #ef4444; }

.gauge-ring__label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-ring__score {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
}

.gauge-ring__trend {
  font-size: 0.75rem;
  font-weight: 600;
}

.gauge-ring__trend--up   { color: #22c55e; }
.gauge-ring__trend--down { color: #ef4444; }

.efficiency-breakdown {
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: #8b8fa3;
}

.efficiency-breakdown span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.efficiency-breakdown strong {
  color: #c4c7d4;
}

/* ─── AI Insight Card ─────────────────────────────────────────────── */
.ai-insight-card {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.ai-insight-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.ai-insight-card__summary {
  font-size: 0.875rem;
  color: #c4c7d4;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.insight-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 0;
}

.insight-list li {
  font-size: 0.8125rem;
  color: #c4c7d4;
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
}

.insight-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.insight-list--strengths li::before { background: #22c55e; }
.insight-list--weaknesses li::before { background: #ef4444; }

.ai-insight-card__rec {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #635bff;
  margin-top: 0.5rem;
}

/* ─── Budget Recommendation ───────────────────────────────────────── */
.budget-card {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.budget-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.budget-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 0.375rem 0;
}

.budget-row__label {
  color: #8b8fa3;
}

.budget-row__value {
  color: #c4c7d4;
  font-weight: 600;
}

.budget-row__value--positive { color: #22c55e; }
.budget-row__value--negative { color: #ef4444; }

.budget-card__reasoning {
  font-size: 0.8125rem;
  color: #8b8fa3;
  margin-top: 0.75rem;
  line-height: 1.5;
  font-style: italic;
}

/* ─── Loading / Error ─────────────────────────────────────────────── */
.campaigns-loading {
  color: #8b8fa3;
  font-size: 0.875rem;
  text-align: center;
  padding: 3rem;
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .campaigns-page { padding: 1rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .campaigns-page__header { flex-direction: column; align-items: flex-start; }
}
