/* ===== SOCIAL MEDIA CANVAS STUDIO - STYLE ===== */
/* VERSÃO CORRIGIDA 3.0 - COMPLETA */
/* Mantém todas as funcionalidades existentes */

:root {
  --bg: #0a0a0a;
  --panel: rgba(20, 20, 20, 0.95);
  --panel-2: rgba(30, 30, 30, 0.95);
  --panel-3: rgba(40, 40, 40, 0.95);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --muted: #a0a0a0;
  --muted-light: #c0c0c0;
  --gold: #d4af37;
  --gold-light: rgba(212, 175, 55, 0.2);
  --gold-medium: rgba(212, 175, 55, 0.4);
  --gold-strong: rgba(212, 175, 55, 0.6);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-xxl: 36px;
  --radius-circle: 50%;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s ease;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.3);
  --glass-border: rgba(255, 255, 255, 0.05);
  --gradient-gold: linear-gradient(135deg, var(--gold) 0%, #f5e7a3 100%);
  --gradient-gold-subtle: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(245, 231, 163, 0.05) 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: white;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(212, 175, 55, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1600px;
  width: 100%;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  position: relative;
  z-index: 1;
}

/* ===== PAINÉIS ===== */
.form-panel,
.preview-panel {
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xxl);
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.form-panel::before,
.preview-panel::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), var(--gold-light), transparent);
  opacity: 0.6;
  z-index: 2;
}

.form-panel:hover,
.preview-panel:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--gold-light);
}

.form-panel {
  padding: 32px;
  position: relative;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--panel-2);
}

.form-panel::-webkit-scrollbar {
  width: 6px;
}

.form-panel::-webkit-scrollbar-track {
  background: var(--panel-2);
  border-radius: 3px;
}

.form-panel::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 3px;
}

.preview-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* ===== HEADERS ===== */
h2 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  position: relative;
  z-index: 5;
}

h2 i {
  color: var(--gold);
  font-size: 1.6rem;
  background: var(--gold-light);
  padding: 10px;
  border-radius: var(--radius-circle);
  box-shadow: 0 0 15px var(--gold-light);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 28px 16px 28px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: var(--radius-xxl) var(--radius-xxl) 0 0;
}

.preview-header h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

.preview-header h2 i {
  font-size: 1.2rem;
  padding: 8px;
}

.preview-note {
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--panel-3);
  padding: 6px 14px;
  border-radius: 60px;
  border: 1px solid var(--line);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-note i {
  color: var(--gold);
  font-size: 0.7rem;
}

/* ===== PREVIEW ===== */
#preview {
  flex: 1;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  min-height: 400px;
  position: relative;
  overflow: auto;
}

#preview iframe {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

#preview.loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}

#preview.loading::after {
  content: '🔄 A gerar preview...';
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 60px;
  font-size: 0.85rem;
  z-index: 100;
  border: 1px solid var(--gold-light);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}

.preview-error {
  color: #dc2626;
  background: white;
  padding: 20px;
  border-radius: var(--radius-lg);
  text-align: center;
}

/* ===== SEÇÕES DO FORMULÁRIO ===== */
.form-section {
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  position: relative;
  z-index: 5;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-left: 3px solid var(--gold);
  padding-left: 14px;
}

.section-title i {
  font-size: 0.9rem;
  color: var(--gold-light);
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== CAMPOS ===== */
.field {
  margin-bottom: 0;
  transition: var(--transition-fast);
  position: relative;
}

.field:focus-within {
  transform: translateX(8px);
}

.field label {
  display: block;
  color: var(--muted-light);
  margin-bottom: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  transition: var(--transition-fast);
}

.field:focus-within label {
  color: var(--gold);
  transform: translateX(-4px);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: white;
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition-fast);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--gold);
  background: var(--panel-3);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-light);
  background: var(--panel-3);
}

.field input[type="range"] {
  padding: 0;
  height: 40px;
  accent-color: var(--gold);
  background: transparent;
  border: none;
}

.field input[type="range"]:focus {
  box-shadow: none;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4af37' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 44px;
  cursor: pointer;
}

.field input[type="color"] {
  width: 100%;
  height: 48px;
  padding: 4px;
  cursor: pointer;
  border-radius: var(--radius-md);
}

.field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

.field-range-value {
  display: inline-block;
  background: var(--panel-3);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--gold);
  margin-left: 8px;
}

/* ===== CHECKBOX ===== */
.field-checkbox {
  display: flex;
  align-items: center;
  background: var(--panel-2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  border: 1px solid var(--line);
  transition: var(--transition-fast);
}

.field-checkbox:hover {
  border-color: var(--gold);
  background: var(--panel-3);
  transform: translateX(4px);
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.9rem !important;
  color: white !important;
  margin-bottom: 0 !important;
  width: 100%;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--gold);
  margin: 0;
  cursor: pointer;
}

/* ===== CORES ===== */
.color-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 8px 0;
  padding: 20px;
  background: var(--gradient-gold-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-light);
}

/* A última cor (Cor de destaque) ocupa a largura total das duas colunas */
.color-row .color-field:last-child {
  grid-column: span 2;
}

.color-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  background: rgba(0, 0, 0, 0.3);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: var(--transition-fast);
}

.color-field:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  background: var(--gold-light);
}

.color-field label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-light);
  margin-bottom: 0;
}

.color-field input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.color-field small {
  font-size: 0.6rem;
  color: var(--muted);
  text-align: center;
}

/* ===== UPLOAD ===== */
.upload-area {
  background: var(--panel-2);
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 16px;
}

.upload-area:hover {
  border-color: var(--gold);
  background: var(--panel-3);
  transform: scale(1.02);
}

.upload-area i {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 12px;
}

.upload-area p {
  color: white;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.upload-area small {
  color: var(--muted);
  font-size: 0.7rem;
}

.image-preview {
  background: var(--panel-2);
  border-radius: var(--radius-lg);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 12px;
}

.image-preview img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.image-preview.empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ===== BOTÕES DE AÇÃO ===== */
.actions-grid {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Botão principal (PNG) */
.btn-primary,
[data-action="export-png"] {
  background: var(--gradient-gold);
  color: #111;
  border: none;
  border-radius: 60px;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover,
[data-action="export-png"]:hover {
  opacity: 0.96;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* Botões secundários (todos os outros) */
.btn-secondary,
[data-action="export-jpg"],
[data-action="export-html"],
[data-action="copy-html"],
[data-action="export-svg"],
[data-action="export-todos"],
[data-action="visualizar-real"],
[data-action="imprimir"],
[data-action="partilhar"],
[data-action="limpar"] {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid var(--line);
  border-radius: 60px;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-secondary:hover,
[data-action="export-jpg"]:hover,
[data-action="export-html"]:hover,
[data-action="copy-html"]:hover,
[data-action="export-svg"]:hover,
[data-action="export-todos"]:hover,
[data-action="visualizar-real"]:hover,
[data-action="imprimir"]:hover,
[data-action="partilhar"]:hover,
[data-action="limpar"]:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* Botão de limpar tem estilo consistente */
[data-action="limpar"] {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

[data-action="limpar"]:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: #dc2626;
  color: #ff6b6b;
}

.full-width {
  width: 100%;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel);
  color: var(--gold);
  padding: 12px 28px;
  border-radius: 60px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  z-index: 9999;
  opacity: 0;
  transition: all 0.35s ease;
  display: none;
  min-width: 250px;
  text-align: center;
  border: 1px solid var(--gold-light);
  backdrop-filter: blur(16px);
  font-size: 0.9rem;
}

.toast.show {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== LOADING ===== */
.loading-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  color: white;
  padding: 24px 40px;
  border-radius: 60px;
  z-index: 10000;
  display: none;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--gold-light);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  font-size: 1rem;
  font-weight: 500;
}

.loading-indicator i {
  color: var(--gold);
  font-size: 1.2rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--panel-2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

/* ===== FORM PLACEHOLDER (loading inicial) ===== */
.form-placeholder {
  display: flex;
  flex-direction: column;
  gap: 25px;
  opacity: 0.6;
  pointer-events: none;
  margin: 20px auto;
  width: 100%;
}

.placeholder-section {
  margin-bottom: 20px;
}

.placeholder-title {
  height: 28px;
  width: 140px;
  background: linear-gradient(90deg, #2a2a2a, #3a3a3a, #2a2a2a);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 8px;
  margin-bottom: 16px;
}

.placeholder-field {
  height: 48px;
  background: linear-gradient(90deg, #2a2a2a, #3a3a3a, #2a2a2a);
  background-size: 200% 100%;
  animation: shimmer 2.2s infinite;
  border-radius: 12px;
  margin-bottom: 12px;
}

.placeholder-field.small {
  height: 36px;
  width: 60%;
}

.placeholder-color-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.placeholder-color {
  height: 60px;
  width: 70px;
  background: linear-gradient(90deg, #2a2a2a, #3a3a3a, #2a2a2a);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== BADGE E INFO ===== */
.badge-premium {
  background: linear-gradient(135deg, var(--gold) 0%, #f5e7a3 100%);
  color: #111;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 60px;
  font-weight: 600;
  margin-left: 12px;
  letter-spacing: 0.5px;
}

.footer-credits {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-credits a {
  color: var(--gold);
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-credits a:hover {
  opacity: 0.8;
}

.info-banner {
  background: var(--gold-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  border-left: 3px solid var(--gold);
}

.info-banner i {
  color: var(--gold);
  font-size: 1.1rem;
}

/* ===== CORES PREVIEW ===== */
.cores-preview-container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  justify-content: center;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
  .container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .preview-panel {
    position: static;
    max-height: none;
  }
  
  .form-panel {
    max-height: none;
  }
}

@media (max-width: 768px) {
  body {
    padding: 16px;
  }
  
  .form-panel {
    padding: 20px;
  }
  
  .preview-header {
    padding: 20px 20px 12px 20px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  #preview {
    padding: 16px;
    min-height: 300px;
  }
  
  .color-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
  }
  
  .action-row {
    grid-template-columns: 1fr;
  }
  
  .section-title {
    font-size: 0.8rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  h2 i {
    font-size: 1.3rem;
    padding: 8px;
  }
  
  .footer-credits {
    flex-direction: column;
    gap: 8px;
  }
  
  .badge-premium {
    display: none;
  }
}

@media (max-width: 480px) {
  .color-row {
    grid-template-columns: 1fr;
  }
  
  .preview-note {
    font-size: 0.6rem;
  }
  
  .toast {
    min-width: 200px;
    padding: 10px 20px;
    font-size: 0.8rem;
  }
}


/* ===== BOTÃO COLAR EM CADA CAMPO DE COR ===== */
.color-paste-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-light);
  font-family: inherit;
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}

.color-paste-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 175, 55, 0.15);
  transform: translateY(-1px);
}

.color-paste-btn:disabled,
.color-paste-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  border-color: var(--line);
  color: var(--muted);
}

.color-paste-btn i {
  font-size: 0.75rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .color-paste-btn {
    padding: 4px 8px;
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .color-paste-btn span {
    display: none;
  }
  
  .color-paste-btn {
    padding: 6px;
  }
  
  .color-paste-btn i {
    font-size: 0.85rem;
    margin: 0;
  }
}