/**
 * Meta Ads MCP — Interactive Component Styles (Dark Theme)
 */

/* ─── Form Elements ───────────────────────────────────── */
.mcp-field { margin-bottom: 10px; }
.mcp-field-label { display: block; font-size: 11px; font-weight: 500; color: #999; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.mcp-field-input {
  width: 100%; padding: 6px 8px; border: 1px solid #0f3460; border-radius: 6px;
  font-size: 12px; outline: none; transition: border-color 0.15s;
  background: #0f3460; color: #e0e0e0;
}
.mcp-field-input:focus { border-color: #e94560; box-shadow: 0 0 0 2px rgba(233,69,96,0.15); }

select.mcp-field-input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px;
}

textarea.mcp-field-input { resize: vertical; min-height: 60px; font-family: inherit; }

/* ─── Modal ───────────────────────────────────────────── */
.mcp-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex;
  align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(2px);
}
.mcp-modal {
  background: #16213e; border-radius: 10px; width: 90%; max-width: 360px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4); overflow: hidden;
}
.mcp-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid #0f3460;
}
.mcp-modal-title { font-size: 13px; font-weight: 600; color: #fff; }
.mcp-modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #999; padding: 0 4px; }
.mcp-modal-close:hover { color: #fff; }
.mcp-modal-body { padding: 12px 14px; }
.mcp-modal-footer { padding: 8px 14px; border-top: 1px solid #0f3460; display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Toast ───────────────────────────────────────────── */
.mcp-toast {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 6px 16px; border-radius: 8px; font-size: 11px; font-weight: 500;
  z-index: 2000; opacity: 0; transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3); pointer-events: none;
}
.mcp-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mcp-toast-success { background: #27ae60; color: white; }
.mcp-toast-error { background: #e74c3c; color: white; }
.mcp-toast-info { background: #16213e; color: white; border: 1px solid #0f3460; }

/* ─── Wizard Steps ────────────────────────────────────── */
.wizard-progress { height: 8px; background: #0f3460; border-radius: 4px; margin-bottom: 16px; overflow: hidden; }
.wizard-progress-fill { height: 100%; background: linear-gradient(90deg, #e94560, #ff6b9d); transition: width 0.3s; }
.wizard-steps { display: flex; justify-content: space-between; margin-bottom: 24px; }
.wizard-step { flex: 1; text-align: center; position: relative; }
.wizard-step-number {
  width: 32px; height: 32px; border-radius: 50%; background: #0f3460; color: #999;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 6px;
  font-weight: 700; font-size: 12px; border: 2px solid #0f3460; transition: all 0.2s;
}
.wizard-step.active .wizard-step-number { background: #e94560; color: #fff; border-color: #e94560; }
.wizard-step.completed .wizard-step-number { background: #27ae60; color: #fff; border-color: #27ae60; }
.wizard-step-label { font-size: 10px; color: #999; }
.wizard-step.active .wizard-step-label { color: #e94560; font-weight: 600; }

/* ─── Objective Cards ─────────────────────────────────── */
.objective-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.objective-card {
  background: #0f3460; border-radius: 10px; padding: 16px; text-align: center;
  cursor: pointer; transition: all 0.2s; border: 2px solid transparent;
}
.objective-card:hover { border-color: #e94560; transform: translateY(-2px); }
.objective-card.selected { border-color: #e94560; background: #1a2a4e; }
.objective-icon { font-size: 28px; margin-bottom: 8px; }
.objective-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.objective-desc { font-size: 11px; color: #999; line-height: 1.4; }

/* ─── Heatmap Grid ────────────────────────────────────── */
.heatmap-wrap { overflow-x: auto; }
.heatmap-grid {
  display: grid; grid-template-columns: 60px repeat(24, 1fr); gap: 2px; min-width: 900px;
}
.heatmap-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 3px; font-size: 9px; font-weight: 600; color: #fff; transition: transform 0.1s;
}
.heatmap-cell:hover { transform: scale(1.1); z-index: 1; }
.heatmap-day-label {
  display: flex; align-items: center; font-size: 11px; font-weight: 600; color: #e0e0e0;
}
.heatmap-hour-label {
  display: flex; align-items: center; justify-content: center; font-size: 9px; color: #777;
}

/* ─── Placement Cards ─────────────────────────────────── */
.placements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.placement-card {
  background: #16213e; border-radius: 10px; padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); transition: transform 0.15s;
}
.placement-card:hover { transform: translateY(-2px); }
.placement-card h3 {
  font-size: 14px; color: #e94560; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.placement-preview {
  background: #0f3460; border-radius: 8px; padding: 16px; margin-bottom: 10px;
  min-height: 120px; display: flex; align-items: center; justify-content: center;
  color: #777; font-size: 12px; overflow: hidden;
}
.placement-preview img { max-width: 100%; border-radius: 4px; }

/* ─── Variant Cards ───────────────────────────────────── */
.variants-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.variant-card {
  background: #16213e; border-radius: 12px; padding: 20px; position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.variant-card.winner { border: 2px solid #27ae60; }
.winner-badge {
  position: absolute; top: -10px; right: 16px; background: #27ae60; color: #fff;
  padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 11px; text-transform: uppercase;
}
.confidence-bar { height: 20px; background: #0f3460; border-radius: 10px; overflow: hidden; margin: 8px 0; }
.confidence-fill {
  height: 100%; background: linear-gradient(90deg, #e94560, #27ae60);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.lift-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px;
  border-radius: 20px; font-weight: 700; font-size: 12px; margin-top: 6px;
}
.lift-positive { background: rgba(39,174,96,0.2); color: #27ae60; }
.lift-negative { background: rgba(231,76,60,0.2); color: #e74c3c; }

/* ─── Health Score ────────────────────────────────────── */
.score-gauge { width: 160px; height: 160px; margin: 0 auto 16px; }
.score-circle {
  width: 160px; height: 160px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.score-inner {
  width: 130px; height: 130px; border-radius: 50%; background: #16213e;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.score-number { font-size: 36px; font-weight: 700; }
.score-label-sm { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.subscore-card {
  background: #16213e; border-radius: 10px; padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.subscore-bar { height: 10px; background: #0f3460; border-radius: 5px; overflow: hidden; margin: 8px 0; }
.subscore-fill { height: 100%; border-radius: 5px; transition: width 0.3s; }
.subscore-rec {
  background: #0f3460; border-radius: 6px; padding: 10px; font-size: 12px;
  color: #ddd; line-height: 1.5; margin-top: 6px;
}

/* ─── Ad Library Cards ────────────────────────────────── */
.ads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ad-card {
  background: #16213e; border-radius: 10px; padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3); display: flex; flex-direction: column;
}
.ad-card-body {
  background: #0f3460; border-radius: 6px; padding: 12px; margin: 8px 0;
  flex-grow: 1; font-size: 13px; line-height: 1.5; color: #ddd;
}
.platform-badge {
  display: inline-block; background: #e94560; color: #fff; padding: 2px 8px;
  border-radius: 12px; font-size: 10px; font-weight: 600;
}

/* ─── Audience Builder ────────────────────────────────── */
.age-bar-wrap { position: relative; height: 40px; background: linear-gradient(90deg, #0f3460 0%, #e94560 50%, #0f3460 100%); border-radius: 6px; margin: 12px 0; }
.age-highlight { position: absolute; top: 0; height: 100%; background: #e94560; border-radius: 6px; opacity: 0.7; }
.gender-split { display: flex; gap: 12px; }
.gender-card { flex: 1; background: #0f3460; border-radius: 8px; padding: 12px; text-align: center; }
.gender-pct { font-size: 20px; font-weight: 700; color: #fff; }
.reach-section { text-align: center; margin-top: 16px; }
.reach-value-lg { font-size: 28px; font-weight: 700; color: #e94560; }
.reach-range { font-size: 12px; color: #999; margin-top: 4px; }
