/* Font e colore di base */
body {
  background: linear-gradient(120deg, #fceabb, #f8b500);
  font-family: 'Poppins', sans-serif;
  color: #333;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: #2c3e50;
}

/* Pulsanti */
.btn {
  border-radius: 30px;
  font-weight: 500;
  transition: background-color 0.3s, border-color 0.3s;
  white-space: nowrap;
}

.btn-primary {
  background-color: #ff6f61;
  border-color: #ff6f61;
}

.btn-primary:hover {
  background-color: #e65c50;
  border-color: #e65c50;
}

.btn-success {
  background-color: #4db6ac;
  border-color: #4db6ac;
}

.btn-success:hover {
  background-color: #39958b;
  border-color: #39958b;
}

/* Card Ricette */
.card {
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

#contenitoreRicette .card h5 {
  font-size: 1.1rem;
}

/* Tabelle */
.table thead {
  background-color: #f3f3f3;
}

/* Modali */
.modal-dialog {
  max-width: 100%;
  height: 80vh;
  margin: auto;
  display: flex;
  align-items: center;
}

.modal-content {
  border-radius: 15px;
  overflow-wrap: break-word;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.25rem;
  padding-bottom: 5rem;
}

.modal-footer {
  background-color: #fff;
  border-top: 1px solid #dee2e6;
}

/* Contenuti testo con wrapping */
#viewIstruzioni,
#viewDescrizione {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Textarea */
textarea.form-control {
  resize: vertical;
}

/* Piccolo testo */
small.text-muted {
  display: block;
  margin-top: 5px;
}

/* Responsive fix: mobile */
@media (max-width: 576px) {
  .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    align-items: stretch;
  }

  .modal-content {
    border-radius: 0;
    height: 100%;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .btn {
    font-size: 0.95rem;
    width: 100%;
  }

  #contenitoreRicette .card {
    font-size: 0.95rem;
  }

  h2, h4 {
    font-size: 1.3rem;
  }

  .d-flex.flex-md-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .form-control,
  .form-select {
    font-size: 0.95rem;
  }

  table.table {
    font-size: 0.95rem;
  }
}

/* Scroll fluido su dispositivi mobili */
.modal-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Modale elegante */
.modal-content {
  background: linear-gradient(145deg, #fffbea, #fdf2c7);
  border: 2px solid #ffe082;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease;
}

.modal-header {
  background-color: #ffeb99;
  border-bottom: 1px solid #ffe082;
  color: #4e342e;
  font-weight: 600;
  box-shadow: inset 0 -1px 0 #ffd54f;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-footer {
  background-color: #fff8e1;
  border-top: 1px solid #ffe082;
  padding: 1rem 1.5rem;
  box-shadow: inset 0 1px 0 #ffd54f;
}

/* Animazione in entrata */
@keyframes slideIn {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.pagina-ricetta {
  width: 210mm;
  height: 297mm;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Georgia", serif;
  font-size: 14px;
  color: #222;
  background: white;
  page-break-after: always;
  overflow: hidden;
}

.pagina-ricetta:last-child {
  page-break-after: auto;
}



.pagina-ricetta h2 {
  text-align: center;
  font-size: 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
}

.pagina-ricetta ul {
  padding-left: 20px;
}

#contenitoreRicette,
#listaRicette {
  transition: opacity .3s ease;
}
