/* Basic page layout + styles */
body {
  background: url("assets/bg-pattern.jpg") no-repeat center center fixed;
  background-size: cover;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: #1f3b4d;
  /* Keep a fallback solid color if image fails to load */
  background-color: #f7f7fc;
  min-height: 100vh;
}

.page {
  max-width: 90%;
  margin: 28px auto;
  padding: 12px;
}

/* Centered landing box */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  border-radius: 15px;
  background: #ffffff;
  opacity: 0.95;
  backdrop-filter: saturate(120%) blur(6px);
  margin: 10%;
}

/* small logo + title row on landing */
.logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.logo-sm {
  width: 90px;
  height: 90px;
}

.logo-lg {
  width: 80px;
  height: 80px;
}

.app-title h3 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1f3b4d;
  line-height: 1.2;
}

.auth-desc {
  margin-top: 2px;
  font-size: 1rem;
  color: #3c4a5d;
  font-weight: 400;
  text-align: left;
  line-height: 1.4;
}

/* small sub text */
.app-sub {
  color: #5a677a;
  margin: 30px 0 5px 0;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: #000000;
  font-weight: 600;
}

.google-icon {
  width: 20px;
  height: 20px;
}

/* Auth status area */
.auth-message {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #2f4858;
  min-height: 18px;
}

/* App UI hidden state default */
.app-ui-hidden {
  display: none;
}

/* top bar */
.top-bar {
  top: 12px;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 16px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(120%) blur(6px);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-block h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #000000;
}

.tagline {
  margin-top: 2px;
  font-size: 1rem;
  color: #0c0d0e;
  font-weight: 400;
}

/* Right side */
.top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.signed-as {
  color: #000000;
  font-size: 0.95rem;
}

/* Main app layout (hidden until login) */
.container {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.10);
  padding: 5px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(120%) blur(6px);
}

.right-panel>.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card {
  flex: 1;
  background: rgba(255, 255, 255, 0.95);
  padding: 24px 10px;
  border-radius: 15px;
  box-shadow: 0 6px 18px rgba(3, 85, 248, 0.04);

}

.test-case-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 260px;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(20, 30, 50, 0.04);
  margin-top: 5px;
}

form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #000000;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #181818;
  margin-bottom: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}

input[type="email"] {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e6e6ec;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.file-upload {
  margin-bottom: 10px;
  width: auto;
  padding: 5px;
  border-radius: 12px;
  background: rgb(245, 241, 241);
  color: #1a1919;
  font-weight: 500;

}

.generate-btn {
  margin-left: 100px !important;
  width: 50% !important;
  padding: 12px !important;
  border-radius: 12px !important;
  background: linear-gradient(90deg, #686de0, #32b6ff);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: medium;
}

.download-link {
  padding: 10px 16px;
  background: linear-gradient(90deg, #686de0, #32b6ff);
  color: #ffffff;
  border-radius: 15px;
  text-decoration: none;
  font-weight: 600;
  width: 200px;
  text-align: center;
}
.status-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap !important; /* prevent wrapping */
}

.loading-icon {
  width: 60px !important;
  height: 60px !important;      /* add this */
  object-fit: contain;          /* keeps the proportions */
  display: none;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0)
  }

  100% {
    transform: rotate(360deg)
  }
}

.logout-btn {
  background: #ffffff;
  border: 1px solid #0453f2;
  color: #7f62f3;
  padding: 8px 12px;
  border-radius: 6px;
  width: 110px;
}

.reset-btn {
  margin-left: 100px !important;
  border: 1px solid #d9534f;
  color: #d9534f;
  background: #fff;
  width: 50% !important;
  padding: 12px !important;
  border-radius: 12px;
  cursor: pointer;
  font-size: medium;
}

/* small layout helpers */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.buttons-row {
  margin-top: 10px;
}

.status-row {
  margin-top: 8px;
  align-items: center;
}



.gen-status {
  display: flex;
  align-items: center; 
   font-size: 18px; 
    margin-left: 12px;
  gap: 6px;
}

/* result image */
.result-doc {
  width: 60px;
  opacity: 0.8;
}

/* responsive tweaks */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .top-right {
    align-items: flex-start;
  }
}

.transcript-drop {
  border: 2px dashed #404045;
  padding: 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;

  align-items: center;
  margin-bottom: 10px;
  justify-content: space-evenly;
}

.transcript-drop:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.drop-inner {
  display: flex;
  gap: 12px;
  align-items: center;
}

.drop-icon {
  font-size: 28px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2efef;
  border-radius: 12px;
  border: 2px solid #6141f4;
  padding: 10px;
  margin: 0px 10px;
}

.drop-title {
  font-weight: 600;
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #000000;
}

.or-text {
  font-weight: 600;
  padding-left: 30px;
  margin-bottom: 1px;
  color: #000000;
}

.btn-primary {
  padding: 8px 12px;
  border-radius: 15px;
  background: #4286f4;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  width: 135px;
}

.hint {
  color: #000000;
  font-size: 1.1rem;
  margin-top: 6px;
  font-weight: 700;
}

.hint span {
  font-weight: 400;
  font-size: 1rem;
  color: rgb(241, 53, 53);
}

.hidden {
  display: none;
}

.transcript-preview-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transcript-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  background: #fbfdff;
  border-radius: 8px;
  border: 1px solid #eef6ff;
}

.preview-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.preview-name {
  font-weight: 600;
  color: #000000;
}

.preview-meta {
  color: #000000;
  font-size: 0.9rem;
}

.preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.small {
  font-size: 0.9rem;
  padding: 6px 8px;
}

.error {
  color: #b91c1c;
  font-weight: 700;
}

#outputStatus a {
  color: #1164d4;
  text-decoration: none;
  font-weight: 600;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.form-label {
  font-weight: 600;
  color: #000000;
  white-space: nowrap;
}

.form-select-inline {
  padding: 6px 28px 6px 10px;
  /* space for arrow */
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  background-color: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;

  /* Remove native arrows */
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;

  /* Custom blue arrow (SVG) */
  background-image: url("data:image/svg+xml;utf8,<svg fill='%233b82f6' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  /* space from right */
  background-size: 16px;

  min-width: 180px;
  box-sizing: border-box;
}

/* Highlight when focused */
.form-select-inline:focus {
  outline: 1px solid #3b82f6;
  border-color: #3b82f6;
  box-shadow: 2px rgba(59, 130, 246, 0.25);
  z-index: 2;
}

.hint-inline {
  font-size: 0.85rem;
  color: #64748b;
}

/* Small info button */
.info-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-btn img {
  width: 30px;
  height: 30px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.info-btn:hover img {
  opacity: 1;
}

/* Popup overlay */
.fib-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* Hide by default */
.hidden {
  display: none;
}

.fib-popup-content {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  max-width: 70%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fib-popup-content img {
  max-width: 80%;
  max-height: 80%;
  border-radius: 6px;
}

.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;

}

.checkbox-group input[type="checkbox"] {
  margin-right: 6px;
  width: 14px;
  height: 14px;
}

.app-type input[type="radio"] {
  margin-right: 6px;
  width: 15px;
  height: 15px;
}
.include-implementation {
  display: inline-flex;
  /* vertically centers checkbox and text */
  gap: 6px; /* space between checkbox and text */
}

.include-implementation input[type="checkbox"] {
    display: inline-flex;
  align-items: center;
  gap: 8px; /* space between checkbox and label */
  margin-bottom: 6px;
   width: 16px;
}


/* ---------- previews, drag & hover ---------- */
/* preview item (kept mostly same) */
.preview-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 82px;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 6px;
  border-radius: 8px;
  background: #fbfdff;
  border: 1px solid #eef6ff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  user-select: none;
  flex: 0 0 auto; /* prevent items from stretching */
}

/* preview row: allow wrapping so many thumbnails don't expand page width */
.preview-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 10px;

  /* NEW: allow items to wrap to next line */
  flex-wrap: wrap;

  /* ensure container doesn't force page width */
  max-width: 100%;
  box-sizing: border-box;

  /* align items at top of their cells */
  align-items: flex-start;
}

/* SMALL: shrink thumbnails slightly on small viewports */
@media (max-width: 520px) {
  .preview-item { width: 64px; }
  .preview-thumb { width: 56px; height: 56px; }
}


.preview-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.preview-item.dragover {
  outline: 2px dashed #3b82f6;
}

.preview-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
  display: block;
  margin-bottom: 6px;
}

/* Hover zoom (subtle) */
.preview-thumb:hover {
  transform: scale(4);
  border: 1px solid #3b82f6;
  box-shadow: 0 6px 18px rgba(20,30,50,0.12);
  z-index: 10;
}

/* file name */
.preview-meta {
  font-size: 11px;
  color: #344154;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* remove button top-right */
.preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #d9534f;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* drag handle left-top */
.preview-drag-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 14px;
  color: #6b7280;
  cursor: grab;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
}

.lightbox-content {
  background: transparent;
  padding: 12px;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}

.story-id-field {
  display: flex;
  align-items: center;
  gap: 10px; /* space between label and box */
  margin-trim: 12px;
}

.story-id-field label {
  font-size: 16px;
  font-weight: 500;
  color: #000000;
  white-space: nowrap;
}

.story-id-field input {
  width: 180px; 
  padding: 6px 9px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  background-color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.story-id-field input:focus {
  border-color: #007bff;
  box-shadow: 0 0 3px rgba(0, 123, 255, 0.3);
}

