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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  line-height: 1.5;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.portal-back {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
}
.portal-back:hover { color: #2563eb; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon { font-size: 2rem; }

.brand-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.tagline {
  font-size: 0.75rem;
  color: #64748b;
}

.main-container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.config-panel, .preview-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.config-panel h2, .preview-panel h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 16px;
}

.upload-box {
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  position: relative;
  background: #eff6ff;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-box:hover {
  border-color: #2563eb;
  background: #dbeafe;
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 6px;
}

.upload-instructions p {
  font-size: 0.9rem;
  color: #1e293b;
  margin-bottom: 2px;
}

.upload-instructions small {
  color: #64748b;
  font-size: 0.75rem;
}

.settings-group {
  margin-top: 20px;
}

.settings-group h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.form-field select, .form-field input[type="color"] {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
}

.form-group-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.flex-1 { flex: 1; }

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 8px;
}

/* Previews Grid */
.previews-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.canvas-holder {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  /* Fundo quadriculado para transparência */
  background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%), 
                    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #e2e8f0 75%), 
                    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
}

.preview-item span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.download-action-box {
  margin-bottom: 24px;
}

.btn-download-pack {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
}
.btn-download-pack:hover {
  background: #1d4ed8;
}

.pack-contents-info {
  font-size: 0.75rem;
  color: #64748b;
  text-align: center;
  margin-top: 8px;
}

/* Code Snippet */
.code-output-card {
  background: #0f172a;
  border-radius: 12px;
  padding: 16px;
  color: #f8fafc;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.btn-copy-code {
  background: #334155;
  color: #ffffff;
  border: none;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

pre {
  margin: 0;
  font-family: monospace;
  font-size: 0.8rem;
  color: #38bdf8;
  overflow-x: auto;
}

.app-footer {
  text-align: center;
  padding: 32px 16px;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 48px;
  border-top: 1px solid #e2e8f0;
}
