/* ==========================================================================
   PROMOFORGE AI — GERA PRÊMIOS
   Design Studio Avançado com Inteligência Artificial e Editor Visual Completo
   Estética Minimalista Clean Studio
   ========================================================================== */

/* Variáveis e Tokens de Design Clean Light */
:root {
  --pf-bg-app: #ebecee;
  --pf-bg-card: #ffffff;
  --pf-bg-elevated: #f8f9fa;
  --pf-bg-input: #f8f9fa;
  --pf-border: #e5e7eb;
  --pf-border-highlight: #111827;
  
  --pf-gold: #d97706;
  --pf-gold-light: #92400e;
  --pf-gold-dark: #78350f;
  --pf-gold-glow: rgba(0, 0, 0, 0.04);
  
  --pf-cyan: #0284c7;
  --pf-cyan-glow: rgba(0, 0, 0, 0.04);
  --pf-purple: #7c3aed;
  --pf-purple-glow: rgba(0, 0, 0, 0.04);
  --pf-emerald: #10b981;
  --pf-rose: #e11d48;
  
  --pf-text-primary: #111827;
  --pf-text-secondary: #6b7280;
  --pf-text-dim: #9ca3af;
  
  --pf-font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --pf-font-mono: 'JetBrains Mono', monospace;
  
  --pf-radius-sm: 8px;
  --pf-radius-md: 12px;
  --pf-radius-lg: 16px;
  --pf-radius-xl: 20px;
  
  --pf-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
  --pf-shadow-modal: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Banner de Status de IA */
.ai-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--pf-bg-elevated);
  border: 1px solid var(--pf-border);
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  color: var(--pf-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-status-pill:hover {
  border-color: var(--pf-border-highlight);
  background: #ffffff;
  color: var(--pf-text-primary);
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pf-emerald);
}

.ai-status-dot.inactive {
  background: var(--pf-gold);
}

/* Seletor de visualizações principais */
.section-view-controller {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 2rem;
}

.view-segmented-control {
  display: inline-flex;
  background: #ffffff;
  border: 1px solid var(--pf-border);
  padding: 0.35rem;
  border-radius: var(--pf-radius-lg);
  box-shadow: var(--pf-shadow-card);
  gap: 0.35rem;
}

.view-segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--pf-radius-md);
  background: transparent;
  border: none;
  color: var(--pf-text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-segment-btn:hover {
  color: var(--pf-text-primary);
  background: #f1f2f4;
}

.view-segment-btn.active {
  background: #111827;
  color: #ffffff;
  border: 1px solid #111827;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Hero e Apresentação */
.promoforge-hero {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f2f4;
  border: 1px solid #e5e7eb;
  color: #111827;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.85rem;
}

.hero-headline {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.65rem;
  color: #111827;
}

.hero-description {
  font-size: 1rem;
  color: var(--pf-text-secondary);
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto 1.5rem;
}

/* Área de Criação: Layout de Grid */
.creator-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

@media (max-width: 1024px) {
  .creator-container {
    grid-template-columns: 1fr;
  }
}

.creator-panel {
  background: var(--pf-bg-card);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  padding: 1.8rem;
  box-shadow: var(--pf-shadow-card);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--pf-border);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--pf-text-primary);
}

.panel-title svg {
  color: var(--pf-gold);
}

/* Formulários e Campos */
.pf-form-group {
  margin-bottom: 1.35rem;
}

.pf-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--pf-text-secondary);
  margin-bottom: 0.45rem;
}

.pf-input, .pf-textarea, .pf-select {
  width: 100%;
  background: #f8f9fa;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  padding: 0.65rem 0.85rem;
  color: var(--pf-text-primary);
  font-family: var(--pf-font-main);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.pf-input:focus, .pf-textarea:focus, .pf-select:focus {
  outline: none;
  border-color: #111827;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

/* Lista Dinâmica de Prêmios */
.prizes-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.prizes-bulk-actions {
  display: flex;
  gap: 0.5rem;
}

.prizes-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.prize-item-card {
  display: grid;
  grid-template-columns: 28px 1.4fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
}

.prize-item-card:hover {
  border-color: #d1d5db;
  background: #ffffff;
}

.prize-drag-handle {
  color: var(--pf-text-dim);
  cursor: grab;
  text-align: center;
}

.prize-input-compact {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  padding: 0.45rem 0.65rem;
  color: var(--pf-text-primary);
  font-size: 0.86rem;
  font-family: var(--pf-font-main);
}

.prize-input-compact:focus {
  outline: none;
  border-color: var(--pf-gold);
}

.prize-item-actions {
  display: flex;
  gap: 0.35rem;
}

.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--pf-text-dim);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--pf-radius-sm);
  transition: all 0.15s ease;
}

.btn-icon-danger:hover {
  color: var(--pf-rose);
  background: rgba(244, 63, 94, 0.12);
}

.btn-add-prize {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed var(--pf-gold);
  border-radius: var(--pf-radius-md);
  color: var(--pf-gold-light);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-prize:hover {
  background: rgba(245, 158, 11, 0.16);
  border-style: solid;
}

/* Seletores de Estilo em Grid */
.styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.style-card-choice {
  background: var(--pf-bg-input);
  border: 2px solid var(--pf-border);
  border-radius: var(--pf-radius-md);
  padding: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.style-card-choice:hover {
  border-color: var(--pf-border-highlight);
  transform: translateY(-2px);
}

.style-card-choice.active {
  border-color: var(--pf-gold);
  background: rgba(245, 158, 11, 0.07);
  box-shadow: 0 0 16px var(--pf-gold-glow);
}

.style-badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4rem;
}

.style-choice-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--pf-text-primary);
  margin-bottom: 0.25rem;
}

.style-choice-desc {
  font-size: 0.74rem;
  color: var(--pf-text-dim);
  line-height: 1.3;
}

/* Seletores de Proporções/Dimensões */
.dimensions-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}

@media (max-width: 768px) {
  .dimensions-selector-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dim-pill-btn {
  background: var(--pf-bg-input);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-md);
  padding: 0.65rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dim-pill-btn:hover {
  border-color: var(--pf-border-highlight);
}

.dim-pill-btn.active {
  border-color: var(--pf-cyan);
  background: rgba(6, 182, 212, 0.1);
  color: var(--pf-cyan);
}

.dim-ratio-tag {
  font-size: 0.72rem;
  color: var(--pf-text-dim);
  display: block;
}

.dim-label-text {
  font-size: 0.82rem;
  font-weight: 700;
  display: block;
  margin-top: 0.2rem;
}

/* Botão Principal de Geração de IA */
.btn-generate-ai {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1.1rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: var(--pf-radius-lg);
  color: #090d14;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--pf-gold-glow);
  transition: all 0.25s ease;
}

.btn-generate-ai:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.btn-generate-ai:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================================
   GALERIA DE PROPOSTAS GERADAS
   ========================================================================= */
.proposals-gallery-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

.proposals-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
}

.proposals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.proposal-card {
  background: var(--pf-bg-card);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  overflow: hidden;
  box-shadow: var(--pf-shadow-card);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.proposal-card:hover {
  border-color: var(--pf-border-highlight);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.proposal-preview-wrapper {
  background: #000;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.proposal-preview-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.proposal-badge-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(9, 13, 20, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--pf-border);
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--pf-text-primary);
}

.proposal-card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.proposal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pf-text-primary);
  margin-bottom: 0.25rem;
}

.proposal-desc {
  font-size: 0.8rem;
  color: var(--pf-text-dim);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.proposal-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-open-editor {
  grid-column: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--pf-gold);
  border: none;
  border-radius: var(--pf-radius-md);
  color: #0b0f17;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-open-editor:hover {
  background: var(--pf-gold-light);
  box-shadow: 0 4px 12px var(--pf-gold-glow);
}

.btn-proposal-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem;
  background: var(--pf-bg-elevated);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-md);
  color: var(--pf-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-proposal-secondary:hover {
  color: var(--pf-text-primary);
  border-color: var(--pf-border-highlight);
}

/* =========================================================================
   EDITOR VISUAL COMPLETO (STUDIO CANVA-LIKE)
   ========================================================================= */
.studio-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
  min-height: 720px;
  background: var(--pf-bg-app);
  overflow: hidden;
}

/* Barra Superior do Studio */
.studio-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 1.2rem;
  background: var(--pf-bg-card);
  border-bottom: 1px solid var(--pf-border);
  gap: 1rem;
}

.studio-project-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.studio-title-input {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.35rem 0.65rem;
  border-radius: var(--pf-radius-sm);
  color: var(--pf-text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--pf-font-main);
  transition: all 0.2s ease;
}

.studio-title-input:hover {
  border-color: var(--pf-border);
  background: var(--pf-bg-input);
}

.studio-title-input:focus {
  outline: none;
  border-color: var(--pf-gold);
  background: var(--pf-bg-input);
}

.studio-history-controls, .studio-canvas-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.studio-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: var(--pf-bg-elevated);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  color: var(--pf-text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.studio-tool-btn:hover {
  color: var(--pf-text-primary);
  border-color: var(--pf-border-highlight);
  background: #232d42;
}

.studio-tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.studio-export-dropdown {
  position: relative;
  display: inline-block;
}

/* Área de Trabalho Central do Studio */
.studio-main-workspace {
  display: grid;
  grid-template-columns: 290px 1fr 340px;
  flex: 1;
  overflow: hidden;
}

@media (max-width: 1200px) {
  .studio-main-workspace {
    grid-template-columns: 260px 1fr 300px;
  }
}

/* Barra Lateral Esquerda: Camadas e Elementos */
.studio-left-sidebar {
  background: var(--pf-bg-card);
  border-right: 1px solid var(--pf-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-tab-nav {
  display: flex;
  border-bottom: 1px solid var(--pf-border);
  background: var(--pf-bg-input);
}

.sidebar-tab-btn {
  flex: 1;
  padding: 0.75rem 0.5rem;
  text-align: center;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pf-text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.sidebar-tab-btn.active {
  color: var(--pf-gold-light);
  border-bottom-color: var(--pf-gold);
  background: var(--pf-bg-card);
}

.sidebar-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

/* Lista de Camadas */
.layers-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: var(--pf-bg-input);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.layer-item:hover {
  border-color: var(--pf-border-highlight);
  background: #151d2c;
}

.layer-item.active {
  border-color: var(--pf-gold);
  background: rgba(245, 158, 11, 0.1);
}

.layer-name-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--pf-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.layer-btn {
  background: transparent;
  border: none;
  color: var(--pf-text-dim);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--pf-radius-sm);
  transition: all 0.15s ease;
}

.layer-btn:hover {
  color: var(--pf-text-primary);
}

/* Área Central do Canvas */
.studio-canvas-stage {
  background: #06090e;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
  padding: 2rem;
}

.canvas-viewport-frame {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  position: relative;
  background: #000;
  transition: transform 0.1s ease-out;
}

/* Barra Lateral Direita: Painel de Propriedades */
.studio-right-sidebar {
  background: var(--pf-bg-card);
  border-left: 1px solid var(--pf-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.2rem;
}

.props-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--pf-border);
}

.props-section:last-child {
  border-bottom: none;
}

.props-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pf-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.props-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--pf-bg-input);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-sm);
  padding: 0.3rem 0.5rem;
}

.color-swatch-native {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

.color-hex-label {
  font-family: var(--pf-font-mono);
  font-size: 0.8rem;
  color: var(--pf-text-secondary);
  text-transform: uppercase;
}

/* Modais de IA e Configurações */
.pf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.pf-modal-card {
  background: var(--pf-bg-card);
  border: 1px solid var(--pf-border-highlight);
  border-radius: var(--pf-radius-xl);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--pf-shadow-modal);
  padding: 2rem;
}

.pf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.pf-modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--pf-text-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--pf-text-dim);
  cursor: pointer;
  font-size: 1.2rem;
}

.btn-close-modal:hover {
  color: var(--pf-text-primary);
}

/* Loading Overlay da IA */
.ai-generating-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 20, 0.9);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.ai-pulse-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, #f59e0b, #d97706);
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.6);
  animation: pulse-orb-anim 1.5s infinite ease-in-out;
}

@keyframes pulse-orb-anim {
  0%, 100% { transform: scale(0.9); box-shadow: 0 0 30px rgba(245, 158, 11, 0.4); }
  50% { transform: scale(1.15); box-shadow: 0 0 70px rgba(245, 158, 11, 0.8); }
}

.ai-generating-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pf-text-primary);
  text-align: center;
}

.ai-generating-step {
  font-size: 0.92rem;
  color: var(--pf-gold-light);
  font-family: var(--pf-font-mono);
}
