/* ==========================================================================
   A5 Receipt Printer — Premium Upscaled & Fully Responsive Stylesheet
   Theme: Royal Blue (#1a3566), Amber Gold (#d97706), Slate, Glassmorphism
   Supported Breakpoints: 320px, 375px, 430px, 768px, 1024px, 1280px+
   ========================================================================== */

/* --- Tool Header & Badges --- */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(26, 53, 102, 0.12);
  box-shadow: 0 4px 16px rgba(26, 53, 102, 0.05);
  font-size: 13px;
  font-weight: 600;
  color: var(--royal-dark, #122549);
  margin-bottom: 18px;
  max-width: 100%;
  text-align: center;
}

.tool-badge i {
  font-size: 15px;
  color: #059669;
  flex-shrink: 0;
}

/* --- Dropzone Base & Responsive Ergonomics --- */
.dropzone {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px dashed rgba(26, 53, 102, 0.22);
  border-radius: 24px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
}

.dropzone:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--royal, #1a3566);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(26, 53, 102, 0.08);
}

.dropzone.dragover,
.dropzone.drag-active {
  background: rgba(238, 246, 255, 0.95);
  border-color: #2563eb;
  border-style: solid;
  transform: scale(1.01);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.15), 0 20px 40px rgba(37, 99, 235, 0.12);
}

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

.dz-content {
  position: relative;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dz-icon-wrapper {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1a3566 0%, #2563eb 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 12px 24px rgba(26, 53, 102, 0.22);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.dropzone:hover .dz-icon-wrapper {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

.dz-icon-wrapper svg {
  width: 38px;
  height: 38px;
}

.dropzone h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.dropzone p {
  font-size: 15px;
  color: var(--slate-600, #475569);
  margin-bottom: 18px;
  line-height: 1.5;
  max-width: 480px;
}

.dz-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  max-width: 100%;
}

.dz-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(26, 53, 102, 0.06);
  border: 1px solid rgba(26, 53, 102, 0.1);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--royal, #1a3566);
  white-space: nowrap;
}

.dz-chip i {
  font-size: 12px;
  flex-shrink: 0;
}

.dz-btn {
  pointer-events: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(26, 53, 102, 0.22);
}

/* --- Processing Panel & File Info --- */
.process-panel {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.file-info {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(248, 250, 252, 0.95);
  border: 1.5px solid #e2e8f0;
  padding: 16px 20px;
  border-radius: 18px;
  margin-bottom: 20px;
}

.file-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(26, 53, 102, 0.1), rgba(37, 99, 235, 0.15));
  color: var(--royal, #1a3566);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.file-icon-box svg {
  width: 24px;
  height: 24px;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-details h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  margin: 0 0 3px 0;
  word-break: break-all;
}

.file-details p {
  font-size: 13px;
  color: var(--slate-500, #64748b);
  margin: 0;
  font-weight: 500;
}

.text-danger {
  color: #ef4444 !important;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  transform: scale(1.05);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* --- Preview Workspace (Realistic A5 Paper Display) --- */
.preview-workspace {
  position: relative;
  width: 100%;
  overflow: auto;
  background: #e2e8f0;
  border-radius: 20px;
  margin-top: 16px;
  margin-bottom: 24px;
  padding: 32px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 360px;
  box-sizing: border-box;
}

.preview-container {
  position: relative;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  background: #ffffff;
  max-width: 100%;
  max-height: 65vh;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
}

#previewImage {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 4px;
}

/* --- Controls & Print Action Row --- */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
  align-items: center;
}

.margin-control {
  flex: 1;
  min-width: 220px;
  background: rgba(248, 250, 252, 0.95);
  padding: 16px 20px;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  box-sizing: border-box;
}

.margin-control label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
}

.margin-control label span:last-child {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
}

.margin-control input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: #cbd5e1;
  outline: none;
  -webkit-appearance: none;
}

.margin-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2563eb;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.print-btn-wrapper {
  flex: 1.4;
  min-width: 220px;
}

.print-btn-wrapper .btn {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* --- Password Modal --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  z-index: 10;
  background: #ffffff;
  border-radius: 24px;
  padding: 28px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body p {
  font-size: 14px;
  color: var(--slate-600, #475569);
  line-height: 1.5;
  margin-bottom: 14px;
}

.modal-body .form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.modal-body .form-input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-footer .btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
}

/* --- Section Headlines & Subtitles --- */
.section-headline {
  font-size: 26px;
  font-weight: 900;
  color: var(--royal-dark, #122549);
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 15px;
  color: var(--slate-600, #475569);
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* --- Info Grid & Card Containers --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.info-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 28px 24px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.info-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(26, 53, 102, 0.1), rgba(37, 99, 235, 0.15));
  color: var(--royal, #1a3566);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.info-card-icon.gold {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12), rgba(245, 158, 11, 0.2));
  color: #d97706;
}

.info-card-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin: 0;
}

/* --- Step Items List --- */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a3566, #2563eb);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(26, 53, 102, 0.22);
}

.step-text {
  flex: 1;
}

.step-text h5 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--slate-800, #1e293b);
  margin: 0 0 3px 0;
}

.step-text p {
  font-size: 13.5px;
  color: var(--slate-600, #475569);
  line-height: 1.5;
  margin: 0;
}

/* --- Guidelines List --- */
.guidelines-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guideline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(248, 250, 252, 0.85);
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.guideline-icon {
  font-size: 18px;
  color: #d97706;
  flex-shrink: 0;
  margin-top: 2px;
}

.guideline-text {
  font-size: 13.5px;
  color: var(--slate-700, #334155);
  line-height: 1.5;
  flex: 1;
}

.guideline-text strong {
  color: var(--slate-900, #0f172a);
}

/* --- SEO Article Block --- */
.article-block {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 60px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.03);
}

.article-block h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-top: 0;
  margin-bottom: 14px;
}

.article-block h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--royal-dark, #122549);
  margin-top: 24px;
  margin-bottom: 10px;
}

.article-block p {
  font-size: 14.5px;
  color: var(--slate-600, #475569);
  line-height: 1.7;
  margin-bottom: 14px;
}

.article-highlight-box {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 20px 0;
}

.article-highlight-box h4 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-highlight-box p {
  margin: 0;
  font-size: 13.5px;
  color: #1e40af;
  line-height: 1.6;
}

/* --- FAQ Section & Accordion --- */
.faq-section {
  margin-bottom: 60px;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}

.accordion-item {
  background: #ffffff;
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.accordion-item:hover {
  border-color: #bfdbfe;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.06);
}

.accordion-header {
  width: 100%;
  padding: 18px 22px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--royal-dark, #122549);
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: color 0.2s ease;
}

.accordion-header:hover {
  color: #2563eb;
}

.accordion-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, color 0.2s ease;
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
  background: #2563eb;
  color: #ffffff;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-body p {
  padding: 0 22px 20px 22px;
  margin: 0;
  font-size: 14px;
  color: var(--slate-600, #475569);
  line-height: 1.6;
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */

/* --- Tablet (max-width: 768px) --- */
@media (max-width: 768px) {
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .margin-control {
    min-width: 100%;
  }

  .print-btn-wrapper {
    min-width: 100%;
  }
}

/* --- Mobile Devices (max-width: 480px) --- */
@media (max-width: 480px) {
  .tool-badge {
    font-size: 11px;
    padding: 5px 12px;
    gap: 6px;
    margin-bottom: 12px;
  }

  .dropzone {
    padding: 24px 14px 20px;
    border-radius: 16px;
  }

  .dz-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    margin-bottom: 12px;
  }

  .dz-icon-wrapper svg {
    width: 28px;
    height: 28px;
  }

  .dropzone h3 {
    font-size: 17px;
    margin-bottom: 4px;
  }

  .dropzone p {
    font-size: 12.5px;
    margin-bottom: 12px;
  }

  .dz-chips {
    gap: 6px;
    margin-bottom: 14px;
  }

  .dz-chip {
    font-size: 10.5px;
    padding: 3px 8px;
    gap: 4px;
  }

  .dz-btn {
    width: 100%;
    max-width: 260px;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 12px;
  }

  .file-info {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .file-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .preview-workspace {
    padding: 16px 10px;
    min-height: 260px;
    border-radius: 16px;
  }

  .margin-control {
    padding: 14px;
    border-radius: 14px;
  }

  .print-btn-wrapper .btn {
    min-height: 46px;
    font-size: 14.5px;
  }

  .info-card {
    padding: 20px 16px;
  }

  .article-block {
    padding: 20px 16px;
  }

  .accordion-header {
    padding: 14px 16px;
    font-size: 14px;
  }

  .accordion-body p {
    padding: 0 16px 16px 16px;
    font-size: 13px;
  }
}
