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

/* Definition of the design system. All colors, gradients, fonts, etc should be defined here. 
All colors MUST be HSL.
*/

@layer base {
  :root {
    --background: 45 15% 97%;
    --foreground: 120 8% 15%;

    --card: 0 0% 100%;
    --card-foreground: 120 8% 15%;

    --popover: 0 0% 100%;
    --popover-foreground: 120 8% 15%;

    --primary: 120 35% 25%;
    --primary-foreground: 0 0% 98%;

    --secondary: 45 25% 92%;
    --secondary-foreground: 120 35% 25%;

    --muted: 45 20% 94%;
    --muted-foreground: 120 8% 45%;

    --accent: 35 65% 88%;
    --accent-foreground: 120 35% 25%;

    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;

    --border: 45 15% 87%;
    --input: 45 15% 87%;
    --ring: 120 35% 25%;

    --radius: 0.75rem;
    
    /* Pantry theme colors - Soft, elegant palette for a pleasant UI */
    --pantry-warm: 25 55% 92%;
    --pantry-fresh: 120 30% 90%;
    --pantry-accent: 340 45% 88%;
    
    /* Auth button colors */
    --auth-blue: 220 85% 55%;
    --auth-blue-foreground: 0 0% 98%;
    --auth-green: 140 75% 45%;
    --auth-green-foreground: 0 0% 98%;
    
    /* Gradients */
    --gradient-pantry: linear-gradient(135deg, hsl(var(--pantry-warm)), hsl(var(--pantry-fresh)));
    --gradient-overlay: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
    
    /* Shadows */
    --shadow-warm: 0 10px 40px -10px hsl(var(--primary) / 0.1);
    --shadow-card: 0 4px 20px -4px hsl(var(--primary) / 0.15);

    --sidebar-background: 0 0% 98%;

    --sidebar-foreground: 240 5.3% 26.1%;

    --sidebar-primary: 240 5.9% 10%;

    --sidebar-primary-foreground: 0 0% 98%;

    --sidebar-accent: 240 4.8% 95.9%;

    --sidebar-accent-foreground: 240 5.9% 10%;

    --sidebar-border: 220 13% 91%;

    --sidebar-ring: 217.2 91.2% 59.8%;
  }

  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;

    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;

    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 212.7 26.8% 83.9%;
    --sidebar-background: 240 5.9% 10%;
    --sidebar-foreground: 240 4.8% 95.9%;
    --sidebar-primary: 224.3 76.3% 48%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent: 240 3.7% 15.9%;
    --sidebar-accent-foreground: 240 4.8% 95.9%;
    --sidebar-border: 240 3.7% 15.9%;
    --sidebar-ring: 217.2 91.2% 59.8%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground;
  }
}

/* Blog post typography enhancements */
.prose p {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose p:first-child {
  margin-top: 0;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Ensure headings also have proper spacing */
.prose h1, .prose h2, .prose h3, .prose h4 {
  margin-top: 2em;
  margin-bottom: 1em;
}

.prose h1:first-child, 
.prose h2:first-child, 
.prose h3:first-child, 
.prose h4:first-child {
  margin-top: 0;
}

/* Better spacing for lists */
.prose ul, .prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
}

.prose li {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Safari compatibility fix for Sonner toast library */
[data-sonner-toast][data-swiped="true"] {
  -webkit-user-select: none;
  user-select: none;
}

/* Hide scrollbar but keep functionality */
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Chrome, Safari, Opera */
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
  .overflow-x-auto {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
}

/* Styled scrollbar for desktop */
@media (min-width: 769px) {
  .overflow-x-auto::-webkit-scrollbar {
    height: 8px;
  }
  
  .overflow-x-auto::-webkit-scrollbar-track {
    background: hsl(var(--muted));
    border-radius: 10px;
  }
  
  .overflow-x-auto::-webkit-scrollbar-thumb {
    background: hsl(var(--primary) / 0.3);
    border-radius: 10px;
  }
  
  .overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--primary) / 0.5);
  }
  
  .overflow-x-auto {
    scroll-behavior: smooth;
  }
}
