@import "tailwindcss";

/* Global optimizations */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.5;
}

/* Improved focus styles */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Optimize animations */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Animation utilities */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-in-from-top {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation-duration: 0.2s;
  animation-fill-mode: both;
}

.slide-in-from-top-2 {
  animation-name: slide-in-from-top;
}

.fade-in {
  animation-name: fade-in;
}

/* Custom background colors */
.bg-gray-25 {
  background-color: rgba(249, 250, 251, 0.5);
}

/* Improved button styles */
button {
  user-select: none;
}

button:disabled {
  cursor: not-allowed;
}

/* Loading states */
.loading {
  pointer-events: none;
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
  animation: cardFadeIn 0.5s ease-out forwards;
  opacity: 0;
  transform: translateY(10px);
}

.card-hover:nth-child(1) { animation-delay: 0.1s; }
.card-hover:nth-child(2) { animation-delay: 0.2s; }
.card-hover:nth-child(3) { animation-delay: 0.3s; }
.card-hover:nth-child(4) { animation-delay: 0.1s; }
.card-hover:nth-child(5) { animation-delay: 0.2s; }
.card-hover:nth-child(6) { animation-delay: 0.3s; }
.card-hover:nth-child(7) { animation-delay: 0.1s; }
.card-hover:nth-child(8) { animation-delay: 0.2s; }
.card-hover:nth-child(9) { animation-delay: 0.3s; }

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-hover:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Enhanced gradients */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

/* Better masonry columns */
.columns-1 {
  columns: 1;
  column-gap: 1.5rem;
}

@media (min-width: 768px) {
  .columns-1.md\:columns-2 {
    columns: 2;
  }
}

@media (min-width: 1280px) {
  .columns-1.md\:columns-2.xl\:columns-3 {
    columns: 3;
  }
}

/* Prevent column breaks inside cards */
.break-inside-avoid {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Additional line clamp utilities */
.line-clamp-6 {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Better scrollbars */
.scrollbar-thin {
  scrollbar-width: thin;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

/* Print styles */
@media print {
  * {
    background: white !important;
    color: black !important;
  }
  
  nav, .no-print {
    display: none !important;
  }
}