/* Custom application styles & A4 Print layout (100% Local & Vectoriel) */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
  font-family: var(--font-sans);
  background-color: #f8fafc;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

#app-container {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* Print container hidden by default outside print mode */
#print-only-container {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.scrollbar-none {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Document Paper Preview (A4 Dimensions) */
.a4-preview-page {
  width: 720px;
  margin: 0 auto;
  background: white;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  position: relative;
}

/* Print Specific Rules for True Vector Pixel-Perfect PDF Export */
@media print {
  @page {
    size: A4 portrait;
    margin: 14mm; /* Calibrage fidèle de 40pt */
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  /* Hide everything except the print container */
  #app-container,
  #sidebar,
  #header,
  .no-print,
  #modal-container,
  .toast-container {
    display: none !important;
  }

  #print-only-container {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .vigitech-pdf-sheet {
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  tr {
    page-break-inside: avoid !important;
  }

  table {
    page-break-inside: auto !important;
  }

  .pdf-legal-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border-top: 1px solid #e5e7eb !important;
    padding-top: 8px !important;
    text-align: center !important;
  }
}

/* Animations */
.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

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