:root {
  --primary:#0d6efd;
  --muted:#666;
  --bg:#fff;
  --card:#f9fbff;
}
* { box-sizing: border-box; }
body { font-family: Arial, sans-serif; margin: 0; background: var(--bg); color: #222; }
.topbar { display: flex; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid #eee; background: #f3f7ff; }
.brand { font-weight: 600; }
.container { max-width: 1200px; margin: 22px auto; padding: 0 18px; }
.toolbar { display: flex; justify-content: space-between; margin-bottom: 12px; }
.toolbar .toolbar-buttons button { margin-left: 8px; }
.message { padding: 10px 12px; color:#0b3d91; background: #eef4ff; border-radius:6px; margin-bottom:12px; display:none; }
.message.error { background:#fff2f2; color:#8a1616; }
.preview-area { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.page-card { background: var(--card); border: 1px solid #ddd; border-radius: 6px; padding: 8px; position: relative; }
.page-meta { margin-top: 6px; text-align: center; color: var(--muted); font-size: 14px; }
.page-hover { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: 0.2s; }
.page-card:hover .page-hover { opacity: 1; }
.icon-btn { background: #fff; border: 1px solid #ccc; padding: 4px 6px; cursor: pointer; border-radius: 4px; }
.selected { outline: 3px solid rgba(13,110,253,0.3); }
/* .controls { margin-top: 16px; display: flex; gap: 10px; align-items: center; } */
.note { color: var(--muted); }
.features, .howto, .faq { margin-top: 24px; padding: 16px; background: #fff; border: 1px solid #eee; border-radius: 6px; }
.sitefoot { text-align: center; padding: 16px; color: var(--muted); }
@media (max-width: 900px) {
  .preview-area { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 600px) {
  .preview-area { grid-template-columns: repeat(2,1fr); }
  .page-thumb { height: 140px; }
}

.page-thumb {
  background: #fff;
  border: 1px solid #ccc;
  height: 240px;  
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;  
  transition: transform 0.18s ease;
}
/* When rotated 90/270 we will set width/height inline from JS so no extra CSS required */

.btn-primary, .btn-secondary {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 0.25rem;
}

.btn-primary {
  background: #007bff;
  color: #fff;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background: #545b62;
}
.btn:disabled, .btn[disabled] {
  background: #ccc !important;
  cursor: not-allowed !important;
  color: #666 !important;
}

/* Center action buttons */
.controls {
  margin-top: 1.5rem;
  text-align: center;
}

.action-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.action-buttons button {
  min-width: 160px;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  .action-buttons button {
    width: 90%;
    max-width: 300px;
  }
}
/* Styled note box */
.note-box {
  margin: 1.5rem auto 0 auto;
  padding: 1rem 1.5rem;
  max-width: 700px;
  border: 2px solid #007bff;
  border-radius: 8px;
  background: #e9f5ff;
  font-size: 1rem;
  font-weight: 500;
  color: #0056b3;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.note-box p {
  margin: 0;
}
/* Header styling */
.site-header {
  text-align: center;
  background: #007bff;
  color: #fff;
  padding: 2rem 1rem;
}

.site-header h1 {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.2;
}

.site-header p {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  opacity: 0.95;
}
.merge-options {
  margin: 1rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.merge-options label {
  font-size: 1rem;
  cursor: pointer;
}

@media (min-width: 600px) {
  .merge-options {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
  }
}

.upload-area {
  display: block;
  border: 2px dashed #007bff;
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  background: #f8f9ff;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  outline: none;
}

.upload-area:hover,
.upload-area:focus {
  border-color: #0056b3;
  background: #e3f2fd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.upload-area.dragover {
  border-color: #28a745;
  background: #e8f5e8;
}

.upload-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}
.upload-area.dragover {
  border-color: #28a745;
  background: #e8f5e8;
}

.upload-area {
  width: 100%;
  box-sizing: border-box;
}
.file-input-offscreen {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#uploadPlaceholder {
  grid-column: 1 / -1;
  text-align: center;
}

/* Related Tools Section */
.related-tools {
  margin-top: 3rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.related-tools h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: #007bff;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.tool-card .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

footer p, footer a {
  color: #222 !important;  /* darker text */
}

