@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #00b86b;
  --primary-dark: #009958;
  --dark-bg: #0a1a2a;
  --light-bg: #f0f2f6;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.dark body {
  background-color: #030712;
  color: #f3f4f6;
}

/* Touch feedback press effect for mobile & buttons */
.btn-touch, button, .clickable {
  transition: transform 0.1s ease-in-out, opacity 0.1s ease-in-out, background-color 0.15s ease;
}
.btn-touch:active, button:active:not(:disabled), .clickable:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* Button Loading State Spinner */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75 !important;
}
.btn-loading .btn-text {
  visibility: hidden;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  top: 50%;
  left: 50%;
  margin-top: -0.625rem;
  margin-left: -0.625rem;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bottom Sheet Animation */
.bottom-sheet {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(100%);
}
.bottom-sheet.open {
  transform: translateY(0);
}

/* Backdrop Fade */
.modal-backdrop {
  transition: opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
}
.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

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

/* Toast Notifications Container */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 90vw;
  width: 360px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.875rem;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-success { background-color: #10b981; }
.toast-error { background-color: #ef4444; }
.toast-warning { background-color: #f59e0b; }
.toast-info { background-color: #3b82f6; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Signature Canvas Styling */
.signature-canvas-wrapper {
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  background: #ffffff;
  position: relative;
  touch-action: none;
}
.dark .signature-canvas-wrapper {
  border-color: #374151;
  background: #1f2937;
}
.signature-canvas-wrapper canvas {
  width: 100%;
  height: 140px;
  display: block;
  border-radius: 0.75rem;
}

/* Print CSS override */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .no-print, header, nav, footer, #mobile-bottom-nav, #quick-action-btn, #toast-container {
    display: none !important;
  }
  .print-full {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
}
