/* ==========================================================================
   ThreadByteCreative — Poster Tiling & Splitter Tool Stylesheet
   Modern, Editorial Workspace Aesthetic
   ========================================================================== */

/* Page Header */
.tiler-hero {
  padding: 44px 0 28px;
  background: linear-gradient(180deg, #F3EDE3 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.tiler-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}

.tiler-crumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.tiler-crumbs a:hover {
  color: var(--accent);
}

.tiler-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFF;
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.tiler-hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 800px;
  margin: 0 auto 12px;
}

.tiler-hero-sub {
  font-size: clamp(14px, 1.6vw, 17px);
  color: var(--muted);
  max-width: 660px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Tool Workspace Container */
.tiler-workspace {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 36px;
  align-items: start;
  margin: 36px 0 60px;
}

@media (max-width: 1060px) {
  .tiler-workspace {
    grid-template-columns: 1fr;
  }
}

/* Controls Panel */
.tiler-controls-panel {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 28px;
}

.control-section {
  border-bottom: 1px solid var(--line-light);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.control-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.control-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 14px;
}

.control-title-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #F2E8DC;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed #D9CFC1;
  border-radius: 14px;
  padding: 32px 20px;
  text-align: center;
  background: #FAF7F2;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--accent);
  background: #FDF9F3;
}

.dropzone-icon {
  font-size: 34px;
  margin-bottom: 10px;
  color: var(--accent);
}

.dropzone-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

.dropzone-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Uploaded Image Card */
.image-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFF;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.image-preview-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #F0ECE4;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.image-preview-meta {
  flex: 1;
  min-width: 0;
}

.image-preview-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.image-preview-stats {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.image-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-icon-danger {
  background: none;
  border: none;
  color: #B91C1C;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-icon-danger:hover {
  background: #FEE2E2;
}

/* Form Groups & Inputs */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #FFF;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 85, 45, 0.12);
}

.form-input.is-invalid {
  border-color: #DC2626 !important;
  background: #FEF2F2 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14) !important;
}

.form-error-msg {
  color: #B91C1C;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 4px;
}

/* Pill / Button Groups */
.btn-group-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #FFF;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #FFF;
}

/* Checkbox Toggle */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  margin-top: 6px;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Quality Indicator Bar */
.dpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
}

.dpi-badge.high {
  background: var(--sage);
  color: var(--green);
  border: 1px solid var(--sage-border);
}

.dpi-badge.medium {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.dpi-badge.low {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* Preview Area */
.tiler-preview-workspace {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-light);
  padding-bottom: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-stats-pill {
  background: #F2E8DC;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

/* Interactive Canvas / Visualizer Container */
.preview-canvas-wrap {
  min-height: 400px;
  max-height: 560px;
  background: #FAF6F0;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: auto;
  box-sizing: border-box;
}

.preview-canvas-empty {
  text-align: center;
  color: var(--muted);
  max-width: 300px;
}

.preview-canvas-empty-icon {
  font-size: 44px;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* SVG Poster Grid Overlay */
.tiler-svg-preview {
  max-width: 100%;
  max-height: 500px;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
  background: #FFF;
}

/* Assembly Results Summary Card */
.assembly-summary-card {
  background: linear-gradient(180deg, #FFFCF7 0%, #F8F2E8 100%);
  border: 1.5px solid #DFCFC0;
  border-radius: 14px;
  padding: 20px 24px;
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
}

.summary-stat-item strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.summary-stat-item span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Download CTA Section */
.download-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 10px;
}

.btn-generate-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: #FFF;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
}

.btn-generate-pdf:hover:not(:disabled) {
  background: var(--accent);
  box-shadow: var(--shadow-glow-accent);
  transform: translateY(-2px);
}

.btn-generate-pdf:disabled {
  background: #D4CDC2;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-generate-pdf svg {
  flex-shrink: 0;
}

/* Step-by-Step Assembly Guide */
.assembly-guide-section {
  margin: 60px 0;
  padding: 40px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 20px;
}

.assembly-guide-section h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
  text-align: center;
}

.assembly-guide-section .guide-sub {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  max-width: 600px;
  margin: 0 auto 36px;
}

.assembly-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.assembly-step-card {
  background: #FAF7F2;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 20px;
  position: relative;
}

.assembly-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFF;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.assembly-step-card h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.assembly-step-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

/* Privacy Notice Banner */
.privacy-badge-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F4EFE6;
  border: 1px solid #E2D7C7;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 20px;
}

.privacy-badge-banner svg {
  color: var(--green);
  flex-shrink: 0;
}

/* Progress / Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #FFF;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Tools FAQ Accordion Styles
   ========================================================================== */
.tools-faq-section {
  max-width: 820px;
  margin: 64px auto 60px;
}

.tools-faq-section h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
  margin-bottom: 28px;
}

.tools-faq-item {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(43, 33, 24, 0.04);
  transition: all 0.2s ease;
}

.tools-faq-item:hover {
  border-color: #D5C8B8;
}

.tools-faq-question {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  transition: color 0.15s ease;
}

.tools-faq-question:hover {
  color: var(--accent);
}

.tools-faq-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--muted);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.tools-faq-item.is-open .tools-faq-icon {
  transform: rotate(180deg);
  color: var(--accent);
}

.tools-faq-answer {
  display: none;
  padding: 0 20px 18px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  border-top: 1px solid var(--line-light);
  padding-top: 14px;
}

.tools-faq-item.is-open .tools-faq-answer {
  display: block;
}
