@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --background: #fafafa;
  --foreground: #171717;
}

.dark {
  --background: #030712;
  --foreground: #f9fafb;
}

@layer base {
  * {
    @apply box-border p-0 m-0;
  }

  html,
  body {
    @apply max-w-full overflow-x-hidden scroll-smooth;
  }

  body {
    background: var(--background);
    color: var(--foreground);
    @apply antialiased;
  }
}

@layer utilities {
  /* Hide scrollbar but allow scrolling */
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }

  /* Gradient text */
  .text-gradient {
    @apply bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 bg-clip-text text-transparent;
  }

  /* Glassmorphism */
  .glass {
    @apply bg-white/70 backdrop-blur-xl;
  }

  .dark .glass {
    @apply bg-gray-900/70;
  }

  /* Line clamp */
  .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

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

  /* Safe area for iPhone */
  .h-safe-area-inset-bottom {
    height: env(safe-area-inset-bottom);
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  @apply bg-gray-300 rounded;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-400;
}

.dark ::-webkit-scrollbar-thumb {
  @apply bg-gray-700;
}

.dark ::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-600;
}

/* Image placeholder loading */
.image-loading {
  @apply bg-gradient-to-r from-gray-100 via-gray-200 to-gray-100;
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.dark .image-loading {
  @apply from-gray-800 via-gray-700 to-gray-800;
}

/* Focus styles */
:focus-visible {
  @apply outline-2 outline-purple-500 outline-offset-2;
}

/* Selection */
::selection {
  @apply bg-purple-500/30;
}

/* Input autofill */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #f9fafb inset;
  transition: background-color 5000s ease-in-out 0s;
}

.dark input:-webkit-autofill,
.dark input:-webkit-autofill:hover,
.dark input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px #1f2937 inset;
  -webkit-text-fill-color: #f9fafb;
}
