/**
 * Custom styles for MiniCRM-SaaS
 * This file extends Tailwind CSS with custom styles specific to the application
 */

/* Custom scrollbar styling for a more polished look */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #c1c1c1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #a8a8a8;
}

/* Smooth transitions for all hover states */
a, button, .transition-all {
  transition: all 0.2s ease-in-out;
}

/* Custom page transitions */
.fade-enter {
  opacity: 0;
}
.fade-enter-active {
  opacity: 1;
  transition: opacity 200ms;
}
.fade-exit {
  opacity: 1;
}
.fade-exit-active {
  opacity: 0;
  transition: opacity 200ms;
}

/* Print styles for invoices and quotes */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  
  body {
    background-color: white !important;
    font-size: 12pt;
  }
  
  table {
    page-break-inside: auto;
  }
  
  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  
  .page-break {
    page-break-before: always;
  }
}

/* Form element focus indicators for better accessibility */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25) !important;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Custom loader/spinner */
.loader {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(14, 165, 233, 0.3);
  border-radius: 50%;
  border-top-color: #0ea5e9;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Helper classes for form layouts */
.form-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Custom animations */
.slide-in-right {
  animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  animation: slide-in-left 0.3s ease-out;
}

@keyframes slide-in-left {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Form validation styling */
.is-invalid {
  border-color: #ef4444 !important;
}

.invalid-feedback {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}