/* Vibe Coded UI & Custom Font Setup for S.V. ALUMINIUM & GLASS */

/* Load front/all.ttf font family */
@font-face {
  font-family: 'FrontAllFont';
  src: url('front/all.ttf') format('truetype'),
       url('./front/all.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-vibe: 'Noto Sans Sinhala', 'FrontAllFont', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font-vibe) !important;
  background-color: #0b0f17;
  color: #e2e8f0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.font-vibe, 
.font-sans, 
.font-mono, 
.font-sinhala, 
.font-serif {
  font-family: var(--font-vibe) !important;
}

/* Glassmorphism Cards */
.glass-panel {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-panel:hover {
  border-color: rgba(245, 158, 11, 0.3);
}

.glass-input {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  transition: all 0.2s ease;
  font-family: var(--font-vibe) !important;
}

.glass-input:focus {
  background: rgba(30, 41, 59, 0.95);
  border-color: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
  outline: none;
}

/* Glowing Accent Effects */
.glow-gold {
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
}

.glow-blue {
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.35);
}

.text-gradient-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Animated Grid Background */
.cyber-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* STRICT A4 PRINTABLE CANVAS DIMENSIONS */
.a4-page {
  width: 210mm;
  height: 297mm;
  max-height: 297mm;
  margin: 0 auto 24px auto;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-vibe) !important;
  background-color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

/* Printing Overrides */
body.is-printing .a4-page {
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}
body.is-printing .page-number-indicator {
  display: none !important;
}
body.is-printing #previewContainer {
  gap: 0 !important;
}
body.is-printing .space-y-6 > * + * {
  margin-top: 0 !important;
}

.a4-page:last-child {
  margin-bottom: 0;
}

/* Multi-Page Mode when items overflow 1 page */
.a4-page.multi-page {
  height: 297mm !important;
  max-height: 297mm !important;
  overflow: hidden !important;
}

/* Custom Scrollbar for Vibe UI */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
::-webkit-scrollbar-thumb:hover {
  background: #f59e0b;
}

/* Page Break Controls */
.page-break-avoid {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}

/* PRINT STYLESHEET FOR HIGH PRECISION A4 OUTPUT (210mm x 297mm / 21.0cm x 29.7cm) */
@media print {
  @page {
    size: 210mm 297mm;
    margin: 0;
  }

  body {
    background-color: white !important;
    color: black !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  header,
  section.lg\:col-span-5,
  .no-print,
  button,
  .cyber-grid,
  .preview-header,
  .page-number-indicator {
    display: none !important;
  }

  main {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  section.lg\:col-span-7 {
    width: 100% !important;
    display: block !important;
  }

  #previewContainer,
  .print-wrapper {
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .a4-page {
    width: 210mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    page-break-after: always;
  }

  .a4-page:last-child {
    page-break-after: auto;
  }
}
