/* ==========================================================================
   InPage to PDF & Word (DOCX) Converter - Style System
   Supports Dark (default) and High-Contrast Light Mode + Print Media
   ========================================================================== */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Nastaliq Urdu Font Utilities */
.font-urdu {
  font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif;
  line-height: 2.2 !important;
}

.font-naskh {
  font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  line-height: 1.8 !important;
}

/* Glassmorphism Panels - Dark Mode */
.glass-panel,
.glass-card {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #020617;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Drag and Drop Zone styling */
.dropzone {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropzone-active {
  border-color: #6366f1 !important;
  background-color: rgba(99, 102, 241, 0.12) !important;
  transform: scale(1.008);
}

/* Toast animations */
.toast {
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-visible {
  transform: translateY(0) !important;
  opacity: 1 !important;
}

/* Ad Banner Container */
.ad-banner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  transition: all 0.2s ease-in-out;
}

.ad-banner-slot {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

.ad-placeholder {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.7) 100%);
  border: 1px dashed rgba(148, 163, 184, 0.25);
}

/* Printable Document Preview Area */
.preview-document {
  direction: rtl;
  text-align: right;
  min-height: 380px;
  tab-size: 4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   Print Styles for Clean Direct PDF Export (A4 Format)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 20mm;
  }

  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 14pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide navigation, toolbars, ad units, and documentation during print */
  header, footer, .ad-banner-container, #tool-controls, #upload-section, 
  #options-panel, #documentation-section, #toast, #btn-container, .no-print {
    display: none !important;
  }

  #preview-container {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .preview-document {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif !important;
    font-size: 16pt !important;
    line-height: 2.4 !important;
    color: #000000 !important;
    direction: rtl !important;
    text-align: right !important;
  }
}

/* ==========================================================================
   Comprehensive Light Mode Theme (Applied when 'dark' class is absent)
   ========================================================================== */
html:not(.dark) {
  color-scheme: light;
}

html:not(.dark) body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html:not(.dark) .glass-panel,
html:not(.dark) .glass-card {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
}

html:not(.dark) header {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border-color: #e2e8f0 !important;
}

html:not(.dark) .text-white {
  color: #0f172a !important;
}

html:not(.dark) .text-slate-100 {
  color: #0f172a !important;
}

html:not(.dark) .text-slate-200 {
  color: #1e293b !important;
}

html:not(.dark) .text-slate-300 {
  color: #334155 !important;
}

html:not(.dark) .text-slate-400 {
  color: #64748b !important;
}

html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-950 {
  background-color: #f1f5f9 !important;
}

html:not(.dark) .border-slate-800 {
  border-color: #e2e8f0 !important;
}

html:not(.dark) .border-slate-700 {
  border-color: #cbd5e1 !important;
}

html:not(.dark) .preview-document {
  color: #0f172a !important;
}

html:not(.dark) .ad-placeholder {
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.8) 0%, rgba(226, 232, 240, 0.5) 100%) !important;
  border-color: #cbd5e1 !important;
}
