/* Basic layout and reset (aligned with original PHP/ai-library.css) */
.generate-page-content {
  overflow: hidden;
  height: 100vh;
}

.generate-section {
  display: flex;
  flex-direction: column;
  height: 85.4vh;
  overflow: hidden;
  padding: 0;
  width: 100%;
  background: #faf9fb;
  box-sizing: border-box;
  color: #111827;
  font-family: "Poppins", sans-serif;
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.generate-section-area {
  flex-grow: 1;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
  margin: 0 auto;
  margin-top: 50px;
  padding: 0 25px;
}

@media only screen and (min-width: 576px) and (max-width: 991px) {
  .generate-page-content {
    overflow: hidden;
    height: 86vh;
  }

  .generate-section {
    height: 75.4vh;
  }
}

@media screen and (max-width: 576px) {
  .generate-page-content {
    overflow: hidden;
    height: 88vh;
  }
}

.header-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
}

.heading-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hover-bg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.subHeading {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0px;
  color: var(--color-second);
  text-transform: uppercase;
}

.muted {
  margin: 4px 0 0;
  color: #374151;
  font-size: 1rem;
  font-weight: 400;
}

.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
  padding: 20px;
  margin-bottom: 18px;
}

.card-body {
  display: flex;
  justify-content: center;
}

.center-col {
  text-align: center;
  max-width: 880px;
}

.creative-icon {
  width: 50px;
  height: 50px;
  margin: 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-second);
}

.thirdHeading {
  margin: 8px 0 4px;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.creative-type-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.option-card {
  display: flex;
  align-items: stretch;
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
  cursor: pointer;
}

.option-card input {
  margin-right: 10px;
  align-self: center;
}

.option-content .opt-title {
  font-weight: 600;
  font-size: 1rem;
}

.option-content .opt-sub {
  color: #6b7280;
  font-size: 1rem;
  font-weight: 300;
}

.upload-text {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #374151;
  margin: 0;
}

.upload-form {
  margin-top: 14px;
}

.upload-img-section {
  display: flex;
  gap: 10px;
  align-items: center;
}

.image-upload-box {
  position: relative;
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e6e9ef;
  margin-bottom: 0px;
}

.image-upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.preview-img.placeholder {
  opacity: 0.6;
}

.remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.creative-type-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e6e9ef;
  font-size: 1rem;
}

.dropdown-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e6e9ef;
  background: #fff;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  z-index: 30;
}

.menu-title {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

/* Aspect ratio controls – mimic original PHP design */
.aspectRatio {
  display: flex;
  gap: 8px;
}

.aspectRatioBtn {
  position: relative;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid #e6e9ef;
  background: #fbfdff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.aspectRatioBtn .tools-icon {
  width: 24px;
  height: 24px;
}

.aspectRatioBtn.active {
  background-color: #e6e9ef;
}

.aspectRatioBtn.active svg path {
  fill: var(--color-first);
}

.menu-item {
  width: 100%;
  text-align: left;
  padding: 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.menu-item .muted-sm {
  font-size: 1rem;
  font-weight: 300;
  color: #6b7280;
}

.imagine-dropdown-item:hover {
  background-color: var(--color-second) !important;
  color: #fff;
}

.imagine-dropdown-item:hover p {
  color: #fff;
}

.imagine-dropdown-item.active {
  background-color: #aaa !important;
  color: #fff;
}

.imagine-dropdown-item.active p {
  color: #ffe;
}

.send-btn {
  padding: 10px 12px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.footnote {
  text-align: center;
  color: #9aa3b2;
  font-size: 1rem;
  font-weight: 300;
  margin-top: 8px;
}

/* responsive */
@media (max-width: 880px) {
  .creative-type-options {
    grid-template-columns: 1fr;
  }

  .upload-img-section {
    flex-direction: column;
    align-items: stretch;
  }

  .dropdown-menu {
    left: 0;
    right: auto;
  }
}

/* Chat styles for the card when in chat mode */
.card {
  /* keep existing visual structure but ensure adequate min-height for chat */
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  margin-bottom: 16px;
  overflow: visible;
}

/* Chat wrapper inside card-body */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.chat-header {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
  margin-bottom: 8px;
}

.chat-title {
  font-weight: 600;
  color: #111827;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.chat-sub {
  font-size: 1rem;
  font-weight: 300;
  color: #6b7280;
  margin-top: 2px;
}

/* Scrollable messages container */
.chat-container {
  /* let container grow so full images are visible without inner scrolling */
  max-height: none;
  overflow-y: visible;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Each message row */
.chat-message {
  display: flex;
  width: 100%;
}

/* user aligned right, bot aligned left */
.chat-message.user {
  justify-content: flex-end;
}

.chat-message.bot {
  justify-content: flex-start;
}

/* bubble */
.message-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  display: inline-block;
  word-wrap: break-word;
  background: #f3f4f6;
  color: #111827;
  font-size: 1rem;
  font-weight: 400;
  position: relative;
}

/* When bubble is image-only, remove extra padding/background so no white bands */
.message-bubble.image-bubble {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* styling for user bubble */
.chat-message.user .message-bubble {
  background: linear-gradient(180deg, #2563eb, #1e40af);
  color: #fff;
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 12px;
  border-top-right-radius: 12px;
  border-top-left-radius: 12px;
}

/* small timestamp */
.message-time {
  font-size: 0.875rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
  opacity: 0.85;
}

/* For bot bubble timestamp (darker text) */
.chat-message.bot .message-time {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 300;
  margin-top: 6px;
}

/* fallback when message text is long */
.message-text {
  white-space: pre-wrap;
  line-height: 1.4;
}

/* input area (upload-form) keep as before, minor spacing tweaks */
.upload-form {
  margin-top: 12px;
}

/* Add subtle visual for API error */
.api-error {
  margin-top: 8px;
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 400;
}

/* Make send button more prominent but keep original layout */
.send-btn {
  background: #2563eb;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Responsive: make chat container smaller on small screens */
@media (max-width: 560px) {
  .chat-container {
    max-height: 220px;
  }

  .message-bubble {
    max-width: 90%;
  }
}

.media-badge {
  display: inline-flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.4);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  gap: 8px;
  font-size: 1rem;
  font-weight: 400;
}

.media-badge .active {
  border-radius: 999px;
  /* padding: 8px 16px; */
  height: 40px;
  width: 40px;
  background-color: rgba(0, 0, 0, 0.7);
}

.badge-item {
  color: white;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
}

.badge-icon {
  width: 16px;
  height: 16px;
  stroke: white;
}

.badge-text {
  font-weight: 600;
  font-size: 0.75rem;
  color: white;
}

.divider {
  width: 1px;
  height: 16px;
  /* background-color: rgba(0, 0, 0, 0.05); */
}

.video-skeleton {
  height: 400px;
  border-radius: 1.5rem;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 37%, #e5e7eb 63%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: 0 0;
  }
}

/* Action button hover effects */
.border.rounded-3.p-2.m-0.bg-white {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.border.rounded-3.p-2.m-0.bg-white:hover {
  background-color: #f8f9fa !important;
  border-color: #6c757d !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.border.rounded-3.p-2.m-0.bg-white:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.dialog-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.dialog-actions .primary {
  background: #2563eb;
  color: white;
}


/* Voice input button pulse animation */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}
