/* Phase 50 -- Multi-Campaign Management UI styles.
   All values resolve to --crm-* tokens defined in portal/styles/crm.css.
   Do NOT introduce new color hex or pixel values here. */

/* Root container */
.gc-view {
  padding: var(--crm-space-xl);
  font-family: var(--crm-font-body);
  color: var(--crm-text-primary);
  background: var(--crm-bg-page);
  min-height: 100vh;
}

/* Page header row */
.gc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--crm-space-md);
  padding-bottom: var(--crm-space-lg);
  border-bottom: 1px solid var(--crm-border-light);
  margin-bottom: var(--crm-space-lg);
}
.gc-page-title {
  font-family: var(--crm-font-display);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}
.gc-page-header-actions {
  display: flex;
  gap: var(--crm-space-sm);
  align-items: center;
}

/* Primary button -- + New Campaign */
.gc-btn-primary {
  background: var(--crm-accent);
  color: #ffffff;
  border: 1px solid var(--crm-accent);
  border-radius: var(--crm-radius-sm);
  padding: var(--crm-space-sm) var(--crm-space-lg);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}
.gc-btn-primary:hover { background: var(--crm-accent-hover); border-color: var(--crm-accent-hover); }
.gc-btn-primary:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }

/* Secondary button -- Compare, Edit, Cancel, Save */
.gc-btn-secondary {
  background: var(--crm-bg-card);
  color: var(--crm-text-primary);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: var(--crm-space-sm) var(--crm-space-lg);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}
.gc-btn-secondary:hover { background: var(--crm-bg-hover); }
.gc-btn-secondary:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }

/* Ghost button -- Back, Clear search, Dismiss */
.gc-btn-ghost {
  background: transparent;
  color: var(--crm-text-secondary);
  border: 0;
  padding: var(--crm-space-sm) var(--crm-space-md);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}
.gc-btn-ghost:hover { color: var(--crm-text-primary); background: var(--crm-bg-hover); border-radius: var(--crm-radius-sm); }
.gc-btn-ghost:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; border-radius: var(--crm-radius-sm); }

/* Danger button -- Delete campaign */
.gc-btn-danger {
  background: var(--crm-danger);
  color: #ffffff;
  border: 1px solid var(--crm-danger);
  border-radius: var(--crm-radius-sm);
  padding: var(--crm-space-sm) var(--crm-space-lg);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}
.gc-btn-danger:focus-visible { outline: 2px solid var(--crm-danger); outline-offset: 2px; }

/* Card grid -- campaign list */
.gc-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--crm-space-md);
}
@media (max-width: 1024px) { .gc-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .gc-card-grid { grid-template-columns: 1fr; } }

/* Campaign card */
.gc-card {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  padding: var(--crm-space-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}
.gc-card:hover { background: var(--crm-bg-hover); }
.gc-card--active { border: 2px solid var(--crm-accent); }
.gc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--crm-space-sm);
  margin-bottom: var(--crm-space-md);
}
.gc-card-name {
  font-family: var(--crm-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--crm-text-primary);
}
.gc-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--crm-space-sm);
  margin-top: var(--crm-space-md);
}
.gc-card-metric-label {
  font-family: var(--crm-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  line-height: 1.3;
}
.gc-card-metric-value {
  font-family: var(--crm-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--crm-text-primary);
  margin-top: var(--crm-space-xs);
  line-height: 1.3;
}

/* Status pill */
.gc-status-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--crm-space-xs) var(--crm-space-sm);
  border-radius: var(--crm-radius-sm);
  font-family: var(--crm-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.gc-status-pill--active { background: var(--crm-accent-light); color: var(--crm-accent); }
.gc-status-pill--paused { background: rgba(212, 148, 10, 0.12); color: var(--crm-warning); }
.gc-status-pill--draft  { background: var(--crm-border-light); color: var(--crm-text-muted); }

/* Inheritance pill -- "Using tenant default" */
.gc-inherit-pill {
  display: inline-flex;
  align-items: center;
  padding: var(--crm-space-xs) var(--crm-space-sm);
  background: var(--crm-border-light);
  color: var(--crm-text-muted);
  border-radius: var(--crm-radius-sm);
  font-family: var(--crm-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  margin-left: var(--crm-space-sm);
}

/* Budget progress bar */
.gc-progress-track {
  width: 100%;
  height: 8px;
  background: var(--crm-border-light);
  border-radius: var(--crm-radius-sm);
  overflow: hidden;
  margin: var(--crm-space-sm) 0;
}
.gc-progress-fill {
  height: 100%;
  border-radius: var(--crm-radius-sm);
  transition: width 0.3s ease;
}
.gc-progress-fill--under   { background: var(--crm-accent); }
.gc-progress-fill--warning { background: var(--crm-warning); }
.gc-progress-fill--over    { background: var(--crm-danger); }
.gc-progress-label {
  font-family: var(--crm-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--crm-text-muted);
}

/* Kebab menu */
.gc-kebab-button {
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  color: var(--crm-text-secondary);
  border-radius: var(--crm-radius-sm);
}
.gc-kebab-button:hover { background: var(--crm-bg-hover); color: var(--crm-text-primary); }
.gc-kebab-button:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }
.gc-kebab-menu {
  position: absolute;
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: var(--crm-space-xs);
  min-width: 160px;
  z-index: 100;
}
.gc-kebab-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: var(--crm-space-sm) var(--crm-space-md);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  color: var(--crm-text-primary);
  cursor: pointer;
  border-radius: var(--crm-radius-sm);
}
.gc-kebab-menu-item:hover { background: var(--crm-bg-hover); }
.gc-kebab-menu-item--danger { color: var(--crm-danger); }

/* Sort / filter row */
.gc-toolbar {
  display: flex;
  gap: var(--crm-space-md);
  align-items: center;
  margin-bottom: var(--crm-space-lg);
  flex-wrap: wrap;
}
.gc-search {
  flex: 1;
  min-width: 200px;
  padding: var(--crm-space-sm) var(--crm-space-md);
  font-size: 0.875rem;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  background: var(--crm-bg-card);
  color: var(--crm-text-primary);
  font-family: var(--crm-font-body);
}
.gc-search:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; border-color: var(--crm-accent); }
.gc-sort-select {
  padding: var(--crm-space-sm) var(--crm-space-md);
  font-size: 0.875rem;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  background: var(--crm-bg-card);
  color: var(--crm-text-primary);
  font-family: var(--crm-font-body);
  cursor: pointer;
}
.gc-sort-select:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; border-color: var(--crm-accent); }

/* Empty state */
.gc-empty {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  padding: var(--crm-space-2xl) var(--crm-space-xl);
  text-align: center;
}
.gc-empty-heading {
  font-family: var(--crm-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--crm-space-sm);
  color: var(--crm-text-primary);
}
.gc-empty-body {
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  color: var(--crm-text-secondary);
  margin: 0 0 var(--crm-space-lg);
  line-height: 1.5;
}

/* Banner -- errors, info, success */
.gc-banner {
  padding: var(--crm-space-md);
  border-radius: var(--crm-radius-sm);
  margin-bottom: var(--crm-space-md);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  line-height: 1.5;
}
.gc-banner--error   { background: rgba(197, 48, 48, 0.08); color: var(--crm-danger);  border: 1px solid rgba(197, 48, 48, 0.2); }
.gc-banner--info    { background: rgba(43, 108, 176, 0.08); color: var(--crm-info);    border: 1px solid rgba(43, 108, 176, 0.2); }
.gc-banner--success { background: rgba(45, 138, 86, 0.08);  color: var(--crm-success); border: 1px solid rgba(45, 138, 86, 0.2); }

/* Skeleton shimmer (match outbound.css pattern) */
@keyframes gc-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.gc-skeleton {
  background: var(--crm-bg-hover);
  background-image: linear-gradient(90deg, var(--crm-bg-hover) 0%, var(--crm-border-light) 50%, var(--crm-bg-hover) 100%);
  background-size: 800px 104px;
  animation: gc-shimmer 1.2s infinite linear;
  border-radius: var(--crm-radius-sm);
}
.gc-skeleton--card  { height: 180px; margin-bottom: var(--crm-space-md); }
.gc-skeleton--row   { height: 48px;  margin-bottom: var(--crm-space-md); }
.gc-skeleton--block { height: 240px; }
.gc-skeleton--form  { height: 320px; }

/* Detail view -- tabs */
.gc-detail-header {
  padding-bottom: var(--crm-space-md);
  border-bottom: 1px solid var(--crm-border-light);
  margin-bottom: var(--crm-space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--crm-space-md);
  flex-wrap: wrap;
}
.gc-detail-title {
  font-family: var(--crm-font-display);
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}
.gc-breadcrumb {
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  color: var(--crm-text-secondary);
  margin-bottom: var(--crm-space-sm);
}
.gc-breadcrumb button {
  background: transparent;
  border: 0;
  color: var(--crm-text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  font-family: var(--crm-font-body);
  padding: 0;
}
.gc-breadcrumb button:hover { color: var(--crm-accent); text-decoration: underline; }

.gc-tabs {
  display: flex;
  gap: var(--crm-space-lg);
  border-bottom: 1px solid var(--crm-border-light);
  margin-bottom: var(--crm-space-lg);
}
.gc-tab {
  background: transparent;
  border: 0;
  padding: var(--crm-space-md) 0;
  font-family: var(--crm-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--crm-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.gc-tab:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }
.gc-tab--active { color: var(--crm-text-primary); border-bottom: 2px solid var(--crm-accent); }

/* Switcher dropdown */
.gc-switcher { position: relative; }
.gc-switcher-button {
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  padding: var(--crm-space-sm) var(--crm-space-md);
  border-radius: var(--crm-radius-sm);
  cursor: pointer;
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--crm-text-primary);
  min-width: 200px;
  text-align: left;
}
.gc-switcher-button:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }
.gc-switcher-list {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: var(--crm-space-xs);
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  min-width: 240px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}
.gc-switcher-item {
  padding: var(--crm-space-sm) var(--crm-space-md);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  gap: var(--crm-space-sm);
  align-items: center;
  color: var(--crm-text-primary);
}
.gc-switcher-item:hover { background: var(--crm-bg-hover); }
.gc-switcher-item--current { background: var(--crm-accent-subtle); font-weight: 600; }

/* Comparison table */
.gc-compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--crm-bg-card);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  overflow: hidden;
}
.gc-compare-table th {
  text-align: left;
  padding: var(--crm-space-sm) var(--crm-space-md);
  font-family: var(--crm-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  border-bottom: 1px solid var(--crm-border);
  background: var(--crm-bg-card);
}
.gc-compare-table th button {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.gc-compare-table th button:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }
.gc-compare-table td {
  padding: var(--crm-space-sm) var(--crm-space-md);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--crm-border-light);
  color: var(--crm-text-primary);
}
.gc-compare-table td.numeric {
  font-family: var(--crm-font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.gc-compare-table tr:hover td { background: var(--crm-bg-hover); }
.gc-compare-table td.gc-top-performer { background: var(--crm-accent-light); font-weight: 600; }
@media (max-width: 768px) {
  .gc-compare-table { display: block; overflow-x: auto; }
  .gc-compare-table .sticky-left { position: sticky; left: 0; background: var(--crm-bg-card); }
}

/* Settings panel */
.gc-settings-form {
  display: flex;
  flex-direction: column;
  gap: var(--crm-space-md);
  max-width: 720px;
}
.gc-field {
  display: flex;
  flex-direction: column;
  gap: var(--crm-space-xs);
}
.gc-field-label {
  font-family: var(--crm-font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--crm-text-muted);
  line-height: 1.3;
}
.gc-field-input {
  padding: var(--crm-space-sm) var(--crm-space-md);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  background: var(--crm-bg-card);
  color: var(--crm-text-primary);
}
.gc-field-input:focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; border-color: var(--crm-accent); }
.gc-field-help {
  font-family: var(--crm-font-body);
  font-size: 0.75rem;
  color: var(--crm-text-muted);
  font-weight: 600;
  line-height: 1.3;
}

/* Modal -- delete confirmation */
.gc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--crm-space-md);
}
.gc-modal {
  background: var(--crm-bg-card);
  border-radius: var(--crm-radius-md);
  padding: var(--crm-space-lg);
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}
.gc-modal-title {
  font-family: var(--crm-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--crm-space-sm);
  color: var(--crm-text-primary);
}
.gc-modal-body {
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  color: var(--crm-text-secondary);
  line-height: 1.5;
  margin: 0 0 var(--crm-space-lg);
}
.gc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--crm-space-sm);
}

/* Plan 50-08: toast for pause/resume/delete feedback */
.gc-toast {
  position: fixed;
  bottom: var(--crm-space-lg);
  right: var(--crm-space-lg);
  max-width: 420px;
  padding: var(--crm-space-sm) var(--crm-space-md);
  border-radius: var(--crm-radius-sm);
  background: var(--crm-bg-card);
  color: var(--crm-text-primary);
  font-family: var(--crm-font-body);
  font-size: 0.875rem;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-left: 3px solid var(--crm-text-muted);
  z-index: 1100;
}
.gc-toast--success { border-left-color: var(--crm-success); }
.gc-toast--info    { border-left-color: var(--crm-info); }
.gc-toast--error   { border-left-color: var(--crm-danger); }

/* ===================================================================
   Phase 58 — creative velocity UI (learning-phase badge, run creative
   test button, creative test status row, compliance violation notice,
   video provider dropdown).
   =================================================================== */

/* Phase 58 — learning-phase badge */
.gc-learning-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: var(--crm-space-xs) var(--crm-space-sm);
  border-radius: var(--crm-radius-sm);
  margin-left: var(--crm-space-xs);
}
.gc-learning-badge--success  { background: rgba(45,138,86,0.12);  color: var(--crm-success); }
.gc-learning-badge--learning { background: rgba(212,148,10,0.12); color: var(--crm-warning); }
.gc-learning-badge--fail     { background: rgba(197,48,48,0.10);  color: var(--crm-danger); }
.gc-learning-badge--unknown  { background: var(--crm-border-light); color: var(--crm-text-muted); }

/* Phase 58 — run creative test button */
.gc-run-creative-test-btn {
  background: var(--crm-accent);
  color: #fff;
  padding: var(--crm-space-sm) var(--crm-space-md);
  border: none;
  border-radius: var(--crm-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.gc-run-creative-test-btn:disabled        { opacity: 0.5; cursor: not-allowed; }
.gc-run-creative-test-btn--loading        { opacity: 0.8; }
.gc-run-creative-test-btn--queued         { background: var(--crm-success); }
.gc-run-creative-test-btn--error          { border: 1px solid var(--crm-danger); }

/* Phase 58 — creative test status row */
.gc-creative-tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--crm-space-md);
  margin-bottom: var(--crm-space-md);
}
.gc-creative-test-row {
  display: flex;
  align-items: center;
  gap: var(--crm-space-md);
  padding: var(--crm-space-md);
  background: var(--crm-bg-card);
  border-radius: var(--crm-radius-sm);
  margin-top: var(--crm-space-sm);
  flex-wrap: wrap;
}
.gc-creative-test-row--empty { flex-direction: column; align-items: flex-start; }
.gc-creative-test-row__ts    { font-size: 13px; color: var(--crm-text-muted); }
.gc-creative-test-row__count { font-size: 13px; color: var(--crm-text-secondary); }
.gc-compliance-notices       { width: 100%; margin-top: var(--crm-space-sm); }
.gc-compliance-notice {
  border-left: 4px solid var(--crm-danger);
  background: #fff5f5;
  padding: var(--crm-space-md);
  border-radius: var(--crm-radius-sm);
  margin-top: var(--crm-space-sm);
  font-size: 12px;
}
.gc-compliance-notice__sub {
  color: var(--crm-text-muted);
  margin-top: var(--crm-space-xs);
}

/* Phase 58 — video provider dropdown */
.gc-video-provider-select { width: 240px; }
.gc-form-label   { font-size: 12px; font-weight: 600; color: var(--crm-text-secondary); }
.gc-form-helper  { font-size: 14px; font-weight: 400; color: var(--crm-text-muted); margin-top: var(--crm-space-xs); }
