/* ====== BOTÕES ESPECÍFICOS DO MODAL DE TEMPLATE ====== */

/* Botão Salvar: azul */
.btn-template-save {
  background: transparent;
  color: #5d8df3;
  border: 2px solid #5d8df3;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(37,99,235,0.10);
}
.btn-template-save:hover {
  background: #5d8df3;
  color: #fff;
  border-color: #5d8df3;
  transform: translateY(-2px) scale(1.05);
}

/* Botão Cancelar: vermelho */
.btn-template-cancel {
  background: transparent;
  color: #f16060;
  border: 2px solid #f16060;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(239,68,68,0.10);
}
.btn-template-cancel:hover {
  background: #f16060;
  color: #fff;
  border-color: #f16060;
  transform: translateY(-2px) scale(1.05);
}

/* Botão Tags: laranja */
.btn-template-tags {
  background: transparent;
  color: #f1b16c;
  border: 2px solid #f1b16c;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s, border 0.2s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(245,158,66,0.10);
}
.btn-template-tags:hover {
  background: #f1b16c;
  color: #fff;
  border-color: #f1b16c;
  transform: translateY(-2px) scale(1.05);
}

.btn-template-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
}
.btn-template-close:hover {
  background: #222e3c;
  color: #38b6ff;
}
/* Botão Novo igual ao de Produto */
#btnNovoTemplate {
  background: rgba(14,165,255,0.06);
  color: #0ea5ff;
  border: 2px solid rgba(14,165,255,0.15);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(14,165,255,0.08);
}
#btnNovoTemplate:hover, #btnNovoTemplate.active, #btnNovoTemplate:focus {
  background: rgba(14,165,255,0.18);
  color: #fff;
  border-color: #0ea5ff;
}
/* ====== BOTÕES DE TAGS NO MODAL DE TAGS ====== */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.tag-btn {
  background: transparent;
  color: #c0a322;
  border: 2px solid #c0a322;
  border-radius: 8px;
  padding: 2px 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37,99,235,0.10);
  transition: background 0.2s, color 0.2s, border 0.2s, transform 0.15s;
}
.tag-btn:hover {
  background: #c0a322;
  color: #fff;
  border-color: #c0a322;
  transform: translateY(-2px) scale(1.05);
}

/* Modal de tags menor */
#tagsModalOverlay .templates-modal {
  min-height: unset;
  max-height: 220px;
  height: auto;
  padding-bottom: 24px;
  position: relative;
}
/* ====== ESTILO DA PÁGINA DE TEMPLATES ====== */
.templates-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

/* ====== GRID DE TEMPLATES ====== */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
  margin-top: 18px;
  align-items: stretch;
}
/* ===== CARD DE TEMPLATE ===== */
.template-card {
  background: #181f2a;
  border-radius: 18px;
  padding: 24px 24px 18px 24px;
  color: #e5e7eb;
  position: relative;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  gap: 16px;
    min-height: 300px;
    max-height: 400px;
  overflow-y: auto;
  border: 1.5px solid rgba(14,165,255,0.08);
}

.template-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.template-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0;
  margin-right: 0;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px rgba(14,165,255,0.15);
  border: none;
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.badge-before {
  background: linear-gradient(90deg, #2563eb 60%, #60a5fa 100%);
}
.badge-day {
  background: linear-gradient(90deg, #059669 60%, #34d399 100%);
}
.badge-after {
  background: linear-gradient(90deg, #f59e42 60%, #f43f5e 100%);
}
.badge-custom {
  background: linear-gradient(90deg, #a78bfa 60%, #6366f1 100%);
}

.template-message textarea {
  background: rgba(255,255,255,0.04);
  border: none;
  border-radius: 12px;
  color: #aaadb3;
  font-size: 13px;
  padding: 12px 10px;
  width: 100%;
    min-height: 150px;
  resize: none;
  box-sizing: border-box;
}

.template-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.template-btn {
  background: #23293a;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #60a5fa;
  border-radius: 8px;
  padding: 7px 14px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
}
.template-btn.delete {
  color: #ef4444;
}
.template-btn:hover {
  background: #312e81;
  color: #fff;
}

/* ====== MODAL DE TEMPLATE ====== */
.templates-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.templates-modal {
  display: flex;
  flex-direction: column;
  background: #111827;
  color: #e5e7eb;
  padding: 24px;
  border-radius: 16px;
  width: 520px;
  max-width: 98vw;
  height: 96vh;
  max-height: 640px;/* max-height removido */
  position: relative;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #38b6ff;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 6px;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
}
.modal-close:hover {
  background: #222e3c;
  color: #38b6ff;
}

/* ====== FORMULÁRIO DO MODAL ====== */
.modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
  height: 100%;
}

.modal-form label {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
}

.modal-form input,
.modal-form textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  color: #f3f4f6;
  font-size: 14px;
  resize: none;
  width: 100%;
  box-sizing: border-box;
}

/* 🔹 AQUI O TEXTAREA SE EXPANDE ATÉ OS BOTÕES */
.modal-form textarea {
  flex-grow: 1;
  min-height: 350px;
  height: 100%;
  max-height: 40vh;
}

/* ====== BOTÕES ====== */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: auto;
}

.btn {
  background: #374151;
  color: #1ab87b;
  border: 2px solid rgba(14,165,255,0.15);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 2px 8px rgba(14,165,255,0.08);
  margin-right: 18px;
}

.btn:hover {
  background: rgba(14,165,255,0.18);
  color: #1ab87b;
  border-color: #1ab87b;

}

.btn.cancel {
  background: #374151;
}

.btn.cancel:hover {
  background: #4b5563;
}

.btn.success {
  background: #16a34a;
}

.btn.success:hover {
  background: #15803d;
}
/* Remove fundo, borda e deixa só o emoji */
.emoji-item,
.emoji-item button,
.emoji-box,
.emoji-box button,
.emoji-btn,
.emoji-btn button {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px !important; /* pode ajustar */
  border-radius: 8px; /* opcional: deixa leve ao passar o mouse */
}

/* Hover só com leve highlight */
.emoji-item:hover,
.emoji-item button:hover,
.emoji-box:hover,
.emoji-box button:hover,
.emoji-btn:hover,
.emoji-btn button:hover {
  background: rgba(255,255,255,0.07) !important; 
  cursor: pointer;
}

/* Botões das categorias */
.emoji-tab-btn {
    background: transparent !important;
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 12px;
    padding: 6px 10px;
    cursor: pointer;
    transition: 0.15s;
}

/* Hover */
.emoji-tab-btn:hover {
    background: rgba(255, 255, 255, 0.10) !important;
}

/* Quando selecionado (se você usa classe .active ou algo assim futuramente) */
.emoji-tab-btn.active {
    border-color: #ffe600 !important;
    background: rgba(255, 230, 0, 0.12) !important;
}
