/* Diriya Life Investments - Custom Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Noto+Sans+Sinhala:wght@400;600;700&display=swap');

:root {
  --primary-gold: #c07832;
  --primary-gold-dark: #9d5c1e;
  --primary-gold-light: #fef5eb;
  --primary-dark: #1e293b;
  --primary-green: #5f9e4b;
  --primary-green-light: #eef7eb;
}

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Sinhala', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
}

.sinhala-font {
  font-family: 'Noto Sans Sinhala', 'Iskoola Pota', 'Segoe UI', sans-serif;
}

.gold-gradient {
  background: linear-gradient(135deg, #c07832 0%, #e09349 100%);
}

.dark-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.card-shadow {
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
}

.badge-gold {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Print Specific Styles for Official Letterhead and Receipts */
@media print {
  /* Hide unnecessary elements during print */
  header, nav, aside, .no-print, .btn-print, #sidebar, .sidebar, .action-bar {
    display: none !important;
  }
  
  body {
    background-color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 11pt;
    color: #000000 !important;
  }
  
  .print-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10mm 15mm !important;
    box-shadow: none !important;
    border: none !important;
  }
  
  .letterhead-header {
    display: block !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  .letterhead-footer {
    display: block !important;
    position: static !important;
    margin-top: 2rem !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  
  .avoid-break {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  
  .print-page-break {
    page-break-after: always;
  }
  
  table {
    border-collapse: collapse !important;
    width: 100% !important;
    page-break-inside: auto;
  }
  
  tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  
  thead {
    display: table-header-group !important;
  }
  
  th, td {
    border: 1px solid #cbd5e1 !important;
    padding: 6px 8px !important;
  }
  
  th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Letterhead document paper mockup in browser */
.letterhead-paper {
  background: white;
  width: 210mm;
  min-height: 297mm;
  margin: 20px auto;
  padding: 18mm 20mm;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
  border-radius: 4px;
}

@media screen and (max-width: 768px) {
  .letterhead-paper {
    width: 100%;
    min-height: auto;
    padding: 15px;
    margin: 10px 0;
  }
}

/* ========================================================
   EXECUTIVE DARK MODE STYLES
   ======================================================== */
.dark body {
  background-color: #0b0f19 !important;
  color: #f1f5f9 !important;
}

.dark header, 
.dark footer,
.dark .bg-white {
  background-color: #151e2e !important;
  color: #f1f5f9;
}

.dark .bg-slate-50,
.dark .bg-slate-100,
.dark .bg-slate-100\/70 {
  background-color: #0f172a !important;
}

.dark .border-slate-100,
.dark .border-slate-200,
.dark .border-slate-300,
.dark .border {
  border-color: #263345 !important;
}

.dark .divide-slate-100 > * + *,
.dark .divide-slate-200 > * + * {
  border-color: #263345 !important;
}

.dark .text-slate-900,
.dark .text-slate-800 {
  color: #f8fafc !important;
}

.dark .text-slate-700,
.dark .text-slate-600 {
  color: #cbd5e1 !important;
}

.dark .text-slate-500,
.dark .text-slate-400 {
  color: #94a3b8 !important;
}

/* Form Controls in Dark Mode */
.dark input:not([type="checkbox"]):not([type="radio"]), 
.dark select, 
.dark textarea {
  background-color: #0b1320 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

.dark input:focus, 
.dark select:focus, 
.dark textarea:focus {
  border-color: #c07832 !important;
  box-shadow: 0 0 0 2px rgba(192, 120, 50, 0.25) !important;
  outline: none;
}

/* Tables in Dark Mode */
.dark table thead {
  background-color: #1e293b !important;
}

.dark table thead th {
  background-color: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #263345 !important;
}

.dark table tbody tr:hover {
  background-color: #1c273c !important;
}

/* Dropdown menus & Modals */
.dark .group-hover\:block,
.dark #newCenterModal > div,
.dark #uploadDocModal > div,
.dark .modal-container {
  background-color: #151e2e !important;
  border-color: #263345 !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

/* Amber / Gold / Status Badges in Dark Mode */
.dark .bg-amber-50 {
  background-color: #291e11 !important;
  color: #fcd34d !important;
  border-color: #78350f !important;
}

.dark .bg-amber-100 {
  background-color: #39240f !important;
  color: #fde68a !important;
  border-color: #92400e !important;
}

.dark .text-amber-800,
.dark .text-amber-900 {
  color: #fbbf24 !important;
}

.dark .bg-emerald-50,
.dark .bg-emerald-100 {
  background-color: #062b1a !important;
  color: #6ee7b7 !important;
  border-color: #047857 !important;
}

.dark .bg-rose-50,
.dark .bg-rose-100 {
  background-color: #320c15 !important;
  color: #fda4af !important;
  border-color: #be123c !important;
}

.dark .bg-blue-50,
.dark .bg-blue-100 {
  background-color: #0c203b !important;
  color: #93c5fd !important;
  border-color: #1d4ed8 !important;
}

/* Letterhead & 4-Week Sheet Paper Preview: Keeps crisp white document mockup */
.dark .letterhead-paper {
  background-color: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.dark .letterhead-paper * {
  color: inherit;
}

.dark .letterhead-paper table th {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

.dark .letterhead-paper table td {
  border-color: #cbd5e1 !important;
}

/* Strict Print Preservation: Never affected by dark mode */
@media print {
  html, body, .dark, .dark body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
}

/* Portable Handheld POS 58mm / 80mm Thermal Receipt Print Layout */
@media print {
  .pos-thermal-mode {
    width: 58mm !important;
    max-width: 58mm !important;
    padding: 1mm 2mm !important;
    margin: 0 !important;
    font-size: 8pt !important;
    line-height: 1.2 !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  .pos-thermal-mode * {
    font-family: 'Courier New', Courier, monospace, 'Noto Sans Sinhala', sans-serif !important;
    color: #000000 !important;
  }
  
  .pos-thermal-mode img {
    max-height: 36px !important;
    filter: grayscale(100%) contrast(160%) !important;
    margin: 0 auto 4px auto !important;
  }
  
  .pos-thermal-mode h2 {
    font-size: 9pt !important;
    margin-bottom: 2px !important;
  }
  
  .pos-thermal-mode .border-b,
  .pos-thermal-mode .border-b-2,
  .pos-thermal-mode .border-t,
  .pos-thermal-mode .border-t-2 {
    border-style: dashed !important;
    border-color: #000000 !important;
  }

  .pos-thermal-mode .bg-slate-50,
  .pos-thermal-mode .bg-white {
    background-color: transparent !important;
    border: none !important;
    padding: 2px 0 !important;
  }
}



/* iOS & Android Mobile User Interface Optimizations */
.pb-safe {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 14px));
}

.pt-safe {
  padding-top: max(0.5rem, env(safe-area-inset-top, 14px));
}

/* Eliminate tap delay and highlight on mobile */
html, body, button, a, input, select {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Smooth mobile horizontal scrolling */
.no-scrollbar {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
