body {
  font-family: system-ui, arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

.container {
  max-width: 100%;
  margin: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

h1 {
  text-align: center;
}

.intro-section {
  text-align: center;
  margin: 30px 0;
}

.intro-section h1 {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 8px;
}

.subheading {
  font-size: 16px;
  color: #444;
  margin-bottom: 12px;
}

.features-line {
  font-size: 14px;
  color: #111;
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 5px;
}

.features-line span {
  color: #2c7c1f;
  /* green check color */
}







.upload-wrapper-box {
  background-color: #d5f7ff80;
  padding: 5px;
  border-radius: 10px;
  margin: 0 auto;
  box-sizing: border-box;
}

.drop-zone {
  width: 100%;
  min-height: 230px;
  border: 2px dashed #0078d5;
  background: transparent;
  border-radius: 0;
  padding: 1rem;
  cursor: pointer;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: all 0.3s ease;
}

.drop-zone.blur-active .upload-ui,
.drop-zone.blur-active .preview-container,
.drop-zone.blur-active .upload-fab {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}

.upload-ui {
  margin-bottom: 0;
  text-align: center;
}

.upload-button {
  color: white;
  font-size: 26px;
  padding: 10px 28px;
  text-decoration: none;
  border: none;
  border-radius: 11px;
  cursor: pointer;
  transition: all .2s ease-out;
  display: block;
  background-color: #ff6411;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .3);
}

.upload-button:hover {

  border-bottom: none;
  cursor: pointer;
  border-color: #dadada;
  background-color: #ff6411;
}

.upload-button:focus {
  outline: 3px dotted #ff6411;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .3);
  outline-offset: 2px;
  box-shadow: inset 0 3px 3px rgba(0, 0, 0, .3);
}

.upload-button:active {
  transform: translateY(5px);
  background-color: #ff6411;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .3);
  outline: 0;
  box-shadow: inset 0 3px 3px rgba(0, 0, 0, .3);
}


input[type="file"] {
  display: none;
}

.drag-hint {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
  font-style: italic;
}

.preview-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 1rem;
  width: 100%;
}

.thumb-box {
  width: 140px;
  height: 170px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
  text-align: center;
  padding: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thumb-box img,
.thumb-box canvas {
  width: 100%;
  height: 125px;
  object-fit: contain;
}

.thumb-box p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 138px;
}

.remove-btn {
  position: absolute;
  display: flex;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(117, 116, 116);
  color: white;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  z-index: 1;
}

.remove-btn:hover {
  background: #d33a2c;
}

/* Expanded invisible hover area */
.remove-btn::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  width: 38px;
  height: 38px;
  cursor: pointer;
}



/* ✅ URL upload panel inside drop box */
.url-upload-panel {
  display: none;
  margin-top: 10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
  align-items: stretch;
  width: 350px;
  max-width: 100%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}


#urlInput {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  border: none;
  outline: none;
  border-radius: 0;
}

#urlUploadBtn {
  background: #007bff;
  color: white;
  padding: 0 20px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  border-left: 1px solid #ccc;
  transition: background 0.3s;
}

#urlUploadBtn:hover {
  background: #0056b3;
}


/* ✅ FAB bottom right (horizontal layout) */
.upload-fab {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
}

.fab-main {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #007bff;
  color: white;
  font-size: 28px;
  text-align: center;
  line-height: 44px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.fab-options {
  position: absolute;
  bottom: 0;
  right: 55px;
  display: none;
  flex-direction: row;
  gap: 8px;
}

.upload-fab.open .fab-options {
  display: flex;
}

.fab-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #444;
  color: #fff;
  font-size: 18px;
  text-align: center;
  line-height: 38px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* OCR and results */
#startOCRBtn {
  background-color: #d87d02;
  color: white;
  font-size: 24px;
  padding: 8px 35px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.3s;
  display: block;
  margin: 20px auto;
}

#startOCRBtn:hover {
  background-color: #c76d00;
}


.settings {
  text-align: center;
  margin-top: 1rem;
}

#statusPanel {
  display: none;
  text-align: center;
  padding: 30px;
  border: 1px solid green;
  margin-top: 40px;
}

.status-text {
  margin-top: 10px;
  font-size: 16px;
}

.results-container {
  display: none;
  /* ⬅️ hide until result is available */
  margin-top: 2rem;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 10px;
  text-align: center;
}


.result-block {
  margin-bottom: 2rem;
}

.word-count {
  background: #e0ffe0;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
}

pre {
  background: #f4f4f4;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 10px;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 200px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 40px 20px;
  max-width: 1100px;
  margin: 50px auto 0;
  text-align: center;
}

.info-item {
  padding: 10px 20px;
}

.info-item h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #222;
}

.info-item p {
  font-size: 15px;
  color: #444;
  line-height: 1.6;
}


/* 📦 Horizontal split layout (image left, text right) */
.info-split-horizontal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 30px auto 80px;
  /* ⬅️ Reduced top margin from 70px to 30px */
  padding: 0 40px;
  gap: 40px;
}

.info-image-left {
  flex: 1 1 400px;
  text-align: center;
}

.info-image-left img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.info-text-right {
  flex: 1 1 600px;
  text-align: left;
}

.info-text-right h2 {
  font-size: 28px;
  margin-bottom: 20px;
  color: #222;
}

.info-text-right p {
  font-size: 17px;
  color: #444;
  line-height: 1.8;
  margin-bottom: 14px;
}


/* footer */
/* 🔳 Footer Menu Grid - With More Spacing */
.footer-columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 80px 60px;
  /* ⬅️ Increased horizontal + vertical spacing */
  background: #ffffff;
  padding: 60px 40px 50px;
  /* ⬅️ More height overall */
  border-top: 1px solid #eee;
}

.footer-col {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* ⬅️ More vertical space between links */
}

.footer-col h4 {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 14px;
  color: #222;
}

.footer-col a {
  font-size: 14px;
  color: #0077cc;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #005fa3;
}

/* 📝 Bottom Footer Bar (Final Bar with More Height) */
.site-footer-bar {
  background-color: #f3f3f3;
  padding: 50px 40px;
  /* ⬆️ More vertical padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
  color: #555;
  margin: 0;
}

.footer-left p {
  margin: 0;
}

.footer-right {
  display: flex;
  gap: 25px;
}

.footer-right a {
  color: #555;
  text-decoration: none;
  font-weight: 500;
}

.footer-right a:hover {
  text-decoration: underline;
}

/* 📱 Responsive for Small Devices */
@media (max-width: 768px) {
  .footer-columns {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 40px;
  }

  .site-footer-bar {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    padding: 30px 20px;
  }

  .footer-right {
    justify-content: center;
  }
}





/* ========================== */
/*         HEADER STYLES      */
/* ========================== */

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 40px;
  background-color: #ffffff;
  border-bottom: 1px solid #ddd;
  font-family: sans-serif;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  font-size: 18px;
  color: #111;
}

.logo img {
  width: 20px;
  height: 20px;
}

.nav-menu {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: #111;
  margin-left: 40px;
  flex-grow: 1;
}

.nav-item {
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  transition: background 0.2s ease;
}


/* Dropdown container */
.dropdown {
  position: relative;
}

/* Dropdown menu styles */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px 0;
  min-width: 200px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  color: #111;
  text-decoration: none;
}

.dropdown-menu a:hover {
  background: #f1f1f1;
  color: #0077cc;
}

/* Show dropdown when hovering anywhere on the nav-item */
.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  display: block;
}

/* Right side buttons */
.nav-actions {
  display: flex;
  gap: 12px;
}

.btn-outline {
  padding: 6px 14px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.btn-filled {
  padding: 6px 14px;
  background: #407bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.btn-outline:hover {
  background-color: #f1f1f1;
}

.btn-filled:hover {
  background-color: #2563eb;
}

/* Responsive layout */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-menu {
    flex-wrap: wrap;
    margin-left: 0;
    gap: 16px;
  }

  .nav-actions {
    align-self: flex-end;
  }
}




/* 🧾 ASCII Style Results Table */
.ascii-style-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  margin: 30px auto;
  text-align: left;
}

/* Top and bottom dashed borders like the image */
.ascii-style-table thead tr {
  border-top: 2px dashed #000;
  border-bottom: 2px dashed #000;
}

.ascii-style-table tbody tr:last-child {
  border-bottom: 2px dashed #000;
}

.ascii-style-table th,
.ascii-style-table td {
  padding: 8px 12px;
  border: none;
  /* No gridlines */
}

/* Optional: Add slight indent to match ASCII look */
.ascii-style-table td:first-child {
  padding-left: 18px;
}


/* check box*/
.ocr-options-wrapper {
  display: flex;
  justify-content: center;
  margin: 25px auto;
  padding: 0 1rem;
}

.ocr-options-wrapper form {

  padding: 1rem;
  border-radius: 10px;
  max-width: 420px;
  width: 100%;
}

.ocr-options-wrapper fieldset {
  border: 2px dashed #bbb;
  /* changed from solid to dotted */
  padding: 1rem;
  border-radius: 0px;
  background: white;
}

.ocr-options-wrapper legend {
  font-weight: bold;
  font-size: 16px;
  padding: 0 5px;
}

.ocr-options-wrapper .form__group {
  display: flex;
  align-items: center;
  margin-top: 12px;
}

.ocr-options-wrapper input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: limegreen;
  margin-right: 10px;
}

.blink-outline {
  border: 2px dashed red !important;
  animation: blink 1s linear infinite;
}

@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

.ocr-options-wrapper label {
  font-size: 15px;
  color: #111;
}











.thumb-loading-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  height: 16px;
  transform: translate(-50%, -50%);
  /* ✅ Perfectly centers both vertically and horizontally */
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid #ffc107;
  border-radius: 8px;
  overflow: hidden;
  z-index: 2;
}


.thumb-loading-bar {
  height: 100%;
  width: 0%;
  background-color: rgba(255, 193, 7, 0.95);
  /* yellow fill */
  transition: width 0.15s linear;
}

.thumb-percent-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 400;
  /* lighter */
  font-size: 12px;
  color: #333;
  z-index: 3;
  background-color: rgba(255, 255, 255, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: sans-serif;
}



.thumb-box {
  transition: transform 0.2s ease;
}

.dragging {
  opacity: 0.5;
}


#previewBox,
#previewBox * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}


.thumb-box {
  cursor: grab;
  cursor: -webkit-grab;
  user-select: none;
}

/* While dragging */
.thumb-box:active,
.dragging {
  cursor: grabbing;
  cursor: -webkit-grabbing;
}



.merge-button-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}


.intro-banner {
  width: 100px;
  height: auto;
  margin-bottom: -20px;
}





#mergeBtn {
  color: white;
}







.merge-button-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}


.intro-banner {
  width: 100px;
  height: auto;
  margin-bottom: -20px;
}


#mergeBtn:disabled {
  background-color: #aaa !important;
  cursor: not-allowed;
  opacity: 0.7;
  background-image: none;
}


#downloadBtn {
  font-size: 24px;
  background-color: #41b14f;
  background-image: linear-gradient(#9ec14c, #41b14f);
  color: #fff;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, .25);
  box-shadow: 0 4px #2d8f39;
  position: relative;
  display: inline-block;
  border-radius: 11px;
  text-align: center;
  text-decoration: none;
  border: none;
  outline: 0;
  top: -2px;
  transition: top .1s ease-in-out, box-shadow .1s ease-in-out;


}

#downloadBtn:hover {
  background: #41b14f;
}


#downloadBtn:active {
  outline: 3px dotted red;
  outline-offset: 2px;
  background: #41b14f;
  transform: translateY(5px);
  /* Move button down */
  box-shadow: 0 0 0 #0056b3;
  /* Remove shadow to simulate being pressed into surface */
  box-shadow: 0 4px #2d8f39;
  box-shadow: inset 0 3px 3px rgba(0, 0, 0, .3);
}

:focus {
  outline: 3px dotted red;
  outline-offset: 2px;
}