/* =========================================================
   B L O C O S   D E   A N O T A Ç Õ E S (Legacy/Shared)
========================================================= */

.blocos-anotacoes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.bloco-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  border: 1px solid #e0e0e0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.bloco-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.bloco-card.sortable-ghost {
  opacity: 0.5;
  background: #f0f0f0;
  border: 2px dashed #999;
}

.card-header {
  background: #f8f9fa;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #eee;
}

.drag-handle {
  cursor: grab;
  color: #adb5bd;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 5px;
}

.drag-handle:active {
  cursor: grabbing;
}

.card-display-title {
  flex-grow: 1;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #333;
}

.card-title-input {
  border: none;
  background: transparent;
  font-weight: 600;
  color: #333;
  width: 100%;
}

.btn-copy,
.btn-mini-edit {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-copy:hover {
  background: #e9ecef;
  color: #007bff;
}

.btn-mini-edit:hover {
  background: #e9ecef;
  color: #ffc107;
}

.card-body {
  position: relative;
  padding: 10px;
}

.card-body textarea {
  width: 100%;
  height: 120px;
  border: none;
  resize: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: #555;
  background: transparent;
  outline: none;
  margin-top: 0;
  cursor: pointer;
}

.card-body textarea:hover {
  background-color: #fafafa;
}

.bloco-card.exemplo {
  border-style: dashed;
  border-color: #0a9396;
}

.bloco-card.exemplo .card-header {
  background: #e0fbfc;
}

.alert-box {
  background: #fff3cd;
  color: #856404;
  padding: 10px 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid #ffeeba;
}

/* =========================================================
   S O A P   G R I D   (Floating Boxes Design)
========================================================= */

.soap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  /* Compact width */
  gap: 20px;
  margin-top: 20px;
  padding-bottom: 50px;
}

.soap-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
  /* Softer, floating shadow */
  border: 1px solid #eaebec;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.soap-card:hover {
  transform: translateY(-4px);
  /* Lift effect */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: #ced4da;
}

.soap-card-header {
  background: #fdfdfd;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.soap-card-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #495057;
  font-weight: 600;
  flex-grow: 1;
}

.soap-icon {
  width: 32px;
  /* Smaller icon */
  height: 32px;
  object-fit: contain;
}

.soap-card-body {
  padding: 12px 15px;
  flex-grow: 1;
}

.segmento-title {
  margin: 12px 0 6px 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #adb5bd;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.segmento-title:first-child {
  margin-top: 0;
}

.modelos-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  /* Tighter gap */
}

.modelo-item-wrapper {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.2s;
  width: 100%;
  /* Full width in the card */
}

.modelo-item-wrapper:hover {
  background: #f8f9fa;
  border-color: #ced4da;
}

.modelo-item-wrapper.modelo-privado {
  border-left: 3px solid #ffc107;
}

/* IMPORTANT: Class must match 'modelo-btn' in soap.php */
.modelo-btn {
  border: none;
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #555;
  text-align: left;
  flex-grow: 1;
  width: 100%;
}

.modelo-btn:hover {
  color: #ced4da;
  cursor: pointer;
  padding: 8px 6px;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.btn-acao-micro:hover {
  color: #495057;
}

.btn-acao-micro.btn-excluir-modelo:hover {
  color: #dc3545;
}

.btn-add-modelo-micro {
  background: #fff;
  border: 1px dashed #ced4da;
  color: #adb5bd;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 5px;
}

.btn-add-modelo-micro:hover {
  background: #28a745;
  border-color: #28a745;
  color: #fff;
}

/* Highlight draggable segment handles */
.handle-sort-segmento {
  color: #adb5bd;
  margin-right: 8px;
  font-size: 0.85rem;
}

.handle-sort-segmento:hover {
  color: #666;
}