@font-face {
  font-family: 'Lufga';
  font-style: normal;
  font-weight: 300;
  src: local('Lufga Light'),
       url('/fonts/LufgaLight.woff') format('woff');
}

@font-face {
  font-family: 'Lufga';
  font-style: normal;
  font-weight: 400;
  src: local('Lufga Regular'),
       url('/fonts/LufgaRegular.woff') format('woff');
}

@font-face {
  font-family: 'Lufga';
  font-style: normal;
  font-weight: 700;
  src: local('Lufga Bold'),
       url('/fonts/LufgaBold.woff') format('woff');
}

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

body button {
  margin: 0;
}

body {
  font-family: 'Lufga', Arial, sans-serif;
  background: #f2f2f2;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.container {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100%;
  box-sizing: border-box;
  transition: padding-right 0.3s ease;
}

.container.with-settings-panel {
  padding-right: 380px;
}

.form {
  flex: 1;
  max-width: 550px;
  background: #f8f9fa !important;
  box-shadow: 4px 0 12px rgba(0,0,0,0.1);
  z-index: 1;
  border-right: 1px solid #eee;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.body {
  padding: 1.5rem;
  background: #fff;
}

h1 {
  text-align: center;
  color: #333;
  font-size: 2rem;
}

/* Grupo de input com botão */
.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-group input {
  flex: 1;
  font-size: 1rem;
  font-family: 'Lufga', Arial, sans-serif;
  background: #fff;
  color: #000000;
  padding: 12px;
  font-weight: 400;
  line-height: 1.5;
  border: 1px solid #ddd;
  border-radius: .25rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

/* Botão de configuração do input */
.btn-input-config {
  width: 50px;
  height: 50px;
  background: #008cff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
  margin: 0;
}

.btn-input-config:hover {
  background: #008cff;
}

.btn-input-config.active {
  background: #008cff;
}

/* Inputs sem botão (observações) */
input:not(.with-advanced-controls) {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: 'Lufga', Arial, sans-serif;
}

.template-selector {
  margin: 1rem 0;
}

.template-selector h3 {
  margin-bottom: 1rem;
  color: #000000;
}

.template-previews {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 16px 4px;
  scrollbar-width: thin;
  scrollbar-color: #008cff #f0f0f0;
}

.template-previews::-webkit-scrollbar {
  height: 8px;
}

.template-previews::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.template-previews::-webkit-scrollbar-thumb {
  background: #008cff;
  border-radius: 4px;
}

.template-preview {
  flex: 0 0 auto;
  width: 94px;
  height: 160px;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.template-preview:hover {
  transform: scale(1.05);
}

.template-preview.active {
  border-color: #008cff;
}

.template-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
}

button {
  width: 100%;
  padding: 14px;
  background: #008cff;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: 'Lufga', Arial, sans-serif;
  font-weight: 700;
  transition: background 0.2s;
  margin-top: 10px;
}

button:hover {
  background: #008cff;
}

.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 600px;
  background: #fff;
}

/* Seletor de Telefone simplificado */
.telefone-selector {
  margin: 1rem 0;
  padding: 1rem;
  background: #777777 !important;
  border-radius: 8px;
}

.telefone-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}

.telefone-btn {
  flex: 1;
  background: none;
  border: 1px solid #333;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Lufga', Arial, sans-serif;
  color: #333;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: calc(1.5em + 0.75rem + 2px);
  font-size: 1rem;
  padding: .375rem .75rem;
  font-weight: 400;
}

.telefone-btn:hover {
  background: #f0f0f0;
  border-color: #ccc;
}

.telefone-btn.active {
  background: #008cff;
  color: #fff;
  border-color: #008cff;
}

canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Painel lateral de configurações */
.settings-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 12px rgba(0,0,0,0.1);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.settings-panel.active {
  right: 0;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.settings-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2rem;
}

.btn-close-settings {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: #666;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-close-settings:hover {
  background: #eee;
  color: #008cff;
}

.settings-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.settings-content .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #999;
  text-align: center;
}

.settings-content .empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.settings-content .empty-state p {
  font-size: 1rem;
  margin: 0;
}

/* Remove os controles avançados antigos */
.advanced-controls-panel {
  display: none;
}

/* Estilos dos controles dentro do painel lateral */
.control-group {
  margin-bottom: 1.5rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.font-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.font-size-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #333;
  transition: all 0.2s;
}

.font-size-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.font-size-value {
  min-width: 50px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.color-control {
  display: flex;
  align-items: center;
  gap: 15px;
}

.color-input {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
}

.color-hex {
  font-family: monospace;
  font-size: 0.95rem;
  color: #666;
  background: #f8f9fa;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  flex: 1;
}

.position-control {
  display: flex;
  align-items: center;
  gap: 20px;
}

.vertical-slider {
  writing-mode: bt-lr;
  width: 20px;
  padding: 0 5px;
}

.position-value {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
}

.font-style-control {
  display: flex;
  gap: 10px;
}

.font-style-btn {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
  font-family: 'Lufga', Arial, sans-serif;
  font-size: 1.1rem;
  color: #000;
}

.font-style-btn:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.font-style-btn.active {
  background: #008cff;
  color: white;
  border-color: #008cff;
}

/* Notificações */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  color: white;
  font-family: 'Lufga', Arial, sans-serif;
  font-weight: 600;
  z-index: 1001;
  animation: slideIn 0.3s ease;
}

.notification.success {
  background: #008cff;
}

.notification.error {
  background: #008cff;
}

.notification.info {
  background: #008cff;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Overlay para mobile */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.overlay.active {
  display: block;
}

/* Responsividade */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }
  
  .container.with-settings-panel {
    padding-right: 0;
  }
  
  .form {
    flex: none;
    max-width: 100%;
  }
  
  .canvas-container {
    min-height: 400px;
  }
  
  canvas {
    max-height: 60vh;
  }
}

@media (max-width: 768px) {
  .header {
    text-align: center;
  }
  
  .settings-panel {
    width: 100%;
    right: -100%;
  }
}

/* Estilos para elementos arrastáveis no canvas */
.canvas-container {
    position: relative;
    cursor: default;
}

.canvas-container.dragging-active {
    cursor: grab;
}

.canvas-container.dragging-active:active {
    cursor: grabbing;
}

.drag-element-highlight {
    outline: 3px solid #008cff;
    outline-offset: 4px;
    filter: drop-shadow(0 0 8px rgba(255, 0, 61, 0.5));
    transition: all 0.2s ease;
}

.canvas-container.dragging-active .drag-element-highlight {
    cursor: move;
}

/* Indicador de modo de arrasto */
.drag-mode-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #008cff;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Lufga', Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}
/* ── Contatos dinâmicos ─────────────────────────────────────────────────── */
.contacts-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 12px;
}

.contact-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.contact-row .contact-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #000;
    font-family: 'Lufga', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.contact-row .contact-input:focus {
    border-color: #cd1419;
    box-shadow: 0 0 0 2px rgba(205, 20, 25, 0.15);
}

.btn-remove-contact {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-remove-contact:hover {
    border-color: #cd1419;
    background: #cd1419;
    color: #fff;
}

.btn-add-contact {
    width: 100%;
    padding: 11px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    background: transparent;
    color: #999;
    font-family: 'Lufga', Arial, sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    transition: border-color 0.15s, color 0.15s;
}

.btn-add-contact:hover {
    border-color: #cd1419;
    color: #cd1419;
}

