/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 4px;
}

/* Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }

  50% {
    transform: none;
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.3s ease-out;
}

/* Delay utilities for bounce */
.delay-150 {
  animation-delay: -0.15s;
}

.delay-300 {
  animation-delay: -0.3s;
}

/* Modal backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

/* Transition helpers */
.transition-all {
  transition: all 0.2s ease;
}

/* Tabular nums */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Print styles */
@media print {

  /* Reset body and html for full-content printing */
  html,
  body {
    height: auto !important;
    overflow: visible !important;
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide app core elements ONLY when printing the report */
  body.is-printing-report main,
  body.is-printing-report header,
  body.is-printing-report #chatbot,
  body.is-printing-report #add-transaction-modal,
  .modal-backdrop:not(:has(.report-print-container)) {
    display: none !important;
  }

  .modal-backdrop:has(.report-print-container) {
    position: static !important;
    display: block !important;
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Report Print Container Adjustment */
  .report-print-container {
    visibility: visible !important;
    display: block !important;
    position: static !important;
    /* Allow natural flow */
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: white !important;
    color: black !important;
    overflow: visible !important;
  }

  /* Inner elements */
  .report-print-container * {
    visibility: visible !important;
  }

  .report-print-container .flex-col,
  .report-print-container .flex-row,
  .report-print-container .divide-y {
    height: auto !important;
    overflow: visible !important;
    display: block !important;
    /* Break flexbox for better page breaking */
  }

  /* Print specific hide */
  .print-hidden,
  [id$="backdrop"]:not(:has(.report-print-container)) {
    display: none !important;
  }

  /* Ensure rows don't break mid-text */
  tr,
  .rounded-2xl {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}