/* MODULE: Optimisation | FILE: styles.css */
/* Styles for the optimisation & automation page. */

.opt-page {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.opt-page__title {
  font-size: 24px;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 8px;
}

.opt-page__subtitle {
  font-size: 13px;
  color: #8b8fa3;
  margin-bottom: 24px;
}

.opt-loading {
  color: #8b8fa3;
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

/* ─── Tabs ─────────────────────────────────────────────────────────── */

.opt-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid #2a2f4e;
}

.opt-tabs__btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: #8b8fa3;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.opt-tabs__btn:hover {
  color: #c4c7d4;
}

.opt-tabs__btn--active {
  color: #635bff;
  border-bottom-color: #635bff;
}

/* ─── Recommendation Cards ─────────────────────────────────────────── */

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-card {
  background: #1e2235;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.rec-card--high {
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.rec-card--medium {
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.rec-card--low {
  border: 1px solid #2a2f4e;
}

.rec-card__badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.rec-card__badge--INCREASE_BUDGET {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.rec-card__badge--DECREASE_BUDGET {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.rec-card__badge--PAUSE_AD {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.rec-card__badge--REFRESH_CREATIVE {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.rec-card__badge--EXPAND_AUDIENCE {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.rec-card__badge--LAUNCH_AB_TEST {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.rec-card__body {
  flex: 1;
  min-width: 0;
}

.rec-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.rec-card__type {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b8fa3;
}

.rec-card__platform {
  font-size: 11px;
  color: #635bff;
  background: rgba(99, 91, 255, 0.1);
  padding: 2px 8px;
  border-radius: 8px;
}

.rec-card__action {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.rec-card__impact {
  font-size: 12px;
  color: #8b8fa3;
  margin-bottom: 10px;
}

.rec-card__actions {
  display: flex;
  gap: 8px;
}

.rec-btn {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.rec-btn:hover {
  opacity: 0.85;
}

.rec-btn--accept {
  background: #635bff;
  color: #fff;
}

.rec-btn--dismiss {
  background: transparent;
  color: #8b8fa3;
  border: 1px solid #2a2f4e;
}

.rec-card__status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 8px;
}

.rec-card__status--accepted {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.rec-card__status--dismissed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.rec-card__status--executed {
  background: rgba(99, 91, 255, 0.12);
  color: #635bff;
}

/* ─── Rules Editor ─────────────────────────────────────────────────── */

.rules-editor {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  overflow-x: auto;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rules-table th {
  text-align: left;
  padding: 12px 14px;
  color: #8b8fa3;
  font-weight: 600;
  border-bottom: 1px solid #2a2f4e;
  white-space: nowrap;
}

.rules-table td {
  padding: 12px 14px;
  color: #c4c7d4;
  border-bottom: 1px solid #2a2f4e22;
  white-space: nowrap;
}

.rules-table tr:last-child td {
  border-bottom: none;
}

.rule-enabled {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.rule-enabled--on {
  background: #22c55e;
}

.rule-enabled--off {
  background: #ef4444;
}

/* ─── Action Log ───────────────────────────────────────────────────── */

.action-log-wrap {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  overflow-x: auto;
}

.action-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.action-log-table th {
  text-align: left;
  padding: 10px 14px;
  color: #8b8fa3;
  font-weight: 600;
  border-bottom: 1px solid #2a2f4e;
  white-space: nowrap;
}

.action-log-table td {
  padding: 10px 14px;
  color: #c4c7d4;
  border-bottom: 1px solid #2a2f4e22;
  white-space: nowrap;
}

.action-log-table tr:last-child td {
  border-bottom: none;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot--success {
  background: #22c55e;
}

.status-dot--fail {
  background: #ef4444;
}

/* ─── Empty state ──────────────────────────────────────────────────── */

.opt-empty {
  text-align: center;
  color: #8b8fa3;
  font-size: 14px;
  padding: 40px 0;
}
