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

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

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

/* ─── Gallery Grid ────────────────────────────────────────────────── */
.creative-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.creative-card {
  background: #1e2443;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.creative-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.creative-card__thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #2a2f4e;
  display: block;
}

.creative-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #8b8fa3;
}

.creative-card__body {
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.creative-card__headline {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creative-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.creative-card__platform {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #8b8fa3;
}

/* ─── Score Badge ─────────────────────────────────────────────────── */
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

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

/* ─── Fatigue Indicator ───────────────────────────────────────────── */
.fatigue-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.375rem;
}

.fatigue-dot--ok      { background: #22c55e; }
.fatigue-dot--fatigued { background: #ef4444; }

/* ─── Fatigue Alert Banner ────────────────────────────────────────── */
.fatigue-alert {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.fatigue-alert__icon {
  font-size: 1.25rem;
  line-height: 1;
  color: #ef4444;
}

.fatigue-alert__content {
  flex: 1;
}

.fatigue-alert__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 0.25rem;
}

.fatigue-alert__reason {
  font-size: 0.8125rem;
  color: #c4c7d4;
}

/* ─── Creative Detail ─────────────────────────────────────────────── */
.creative-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.creative-detail__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.creative-detail__close {
  background: none;
  border: none;
  color: #8b8fa3;
  font-size: 1.25rem;
  cursor: pointer;
}

.creative-detail__close:hover {
  color: #ffffff;
}

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

.detail-preview {
  background: #1e2443;
  border-radius: 0.75rem;
  overflow: hidden;
}

.detail-preview img {
  width: 100%;
  display: block;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-section {
  background: #1e2443;
  border-radius: 0.75rem;
  padding: 1rem;
}

.detail-section__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.625rem;
}

.score-breakdown {
  display: flex;
  gap: 1.5rem;
}

.score-breakdown__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.score-breakdown__label {
  font-size: 0.6875rem;
  color: #8b8fa3;
  text-transform: uppercase;
}

.score-breakdown__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #c4c7d4;
}

/* ─── Metrics chart in detail ─────────────────────────────────────── */
.creative-metrics-chart {
  width: 100%;
  height: 200px;
  position: relative;
}

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

/* ─── Element Tag Cloud ───────────────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-cloud__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-cloud__tag--face    { background: rgba(99, 91, 255, 0.15); color: #635bff; }
.tag-cloud__tag--emotion { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tag-cloud__tag--text    { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.tag-cloud__tag--cta     { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.tag-cloud__tag--color   { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.tag-cloud__tag--object  { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }

.tag-cloud__confidence {
  font-size: 0.625rem;
  opacity: 0.7;
}

/* ─── Overlay / Modal ─────────────────────────────────────────────── */
.creative-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.creative-overlay__panel {
  background: #1a1f36;
  border-radius: 1rem;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}

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

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .creatives-page { padding: 1rem; }
  .detail-layout { grid-template-columns: 1fr; }
  .creative-gallery { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
