
/* Open buttons */
/* .openDialogBtn { */
  /* display: inline-block;
  margin: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  color: #000;
  background: #eee;
  transition: background 0.2s ease; */
/* } */
.openDialogBtn[data-dialog="dialog1"] {
  background: #2563eb; /* blue */
}
.openDialogBtn[data-dialog="dialog1"]:hover {
  background: #1d4ed8;
}
.openDialogBtn[data-dialog="dialog2"] {
  background: #16a34a; /* green */
}
.openDialogBtn[data-dialog="dialog2"]:hover {
  background: #15803d;
}

/* Dialog container (backdrop) */
.dialog-container {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1000;
}

/* Visible state */
.dialog-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Hidden state */
.dialog-hidden {
  display: none;
}

/* Dialog content box */
.dialog-content {

  background: #fff;
  background: var(--bgcolor);
  color: var(--fgcolor);
  border-radius: 12px;
  padding: 2rem;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  max-height: 80vh;          /* 👈 Limit height */
  overflow-y: auto;          /* 👈 Scroll inside */
}

.dialog-visible .dialog-content {
  transform: scale(1);
}

/* Headings and text */
.dialog-content h2 {
  margin-top: 0;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.dialog-content p {
  margin-bottom: 1.5rem;
}

/* Close button */
.closeDialogBtn {
  background: var(--btncolor);
  background: #5391ad;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  width: 100%;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.generate-status{
  font-size: 0.8rem;
}

.generate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  width: 100%;
}

.generate-card {
  border: 1px solid var(--panel-border, rgba(0, 0, 0, 0.1));
  border-radius: 12px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
}

.generate-thumb {
  display: block;
  width: 100%;
  padding-top: 100%;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}

.generate-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.generate-card.pending .generate-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: rgba(0, 0, 0, 0.6);
  animation: generate-spin 1s linear infinite;
}

.generate-card.ready .generate-thumb {
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.generate-card.error {
  border-color: rgba(180, 35, 24, 0.4);
}

.generate-caption {
  font-size: 0.85rem;
  margin: 0;
}

.generate-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
#generateResults{
  margin-top: 1rem;
}

.generate-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.generate-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.generate-field textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--panel-border, rgba(0, 0, 0, 0.15));
  background: rgba(0, 0, 0, 0.02);
  background: var(--panel, rgba(0, 0, 0, 0.02));
  color: inherit;
  font: inherit;
}

@keyframes generate-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
