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

html {
  scroll-behavior: smooth;
}

:root {
  color-scheme: light;
}

html.dark {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-en), "Inter", system-ui, sans-serif;
}

/* Removed text-center override - let Tailwind's text-center work normally
.ltr .text-center {
  text-align: left;
}

.ltr .md\:text-center {
  text-align: left;
}
*/

html[dir="rtl"] body {
  font-family: var(--font-ar), "Cairo", system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }

  @keyframes marquee {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(-50%);
    }
  }

  @keyframes fade-slide {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-marquee {
    animation: marquee 30s linear infinite;
  }

  .animate-fade-slide {
    animation: fade-slide 0.6s ease-out;
  }

  .animate-delay-100 {
    animation-delay: 100ms;
  }

  .animate-delay-200 {
    animation-delay: 200ms;
  }

  .animate-delay-300 {
    animation-delay: 300ms;
  }

  .animate-delay-400 {
    animation-delay: 400ms;
  }

  .animation-delay-200 {
    animation-delay: 200ms;
  }

  .animation-delay-400 {
    animation-delay: 400ms;
  }

  .animation-delay-600 {
    animation-delay: 600ms;
  }

  .animation-delay-800 {
    animation-delay: 800ms;
  }

  .animation-delay-4000 {
    animation-delay: 4000ms;
  }

  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes float {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-20px);
    }
  }

  .animate-slideIn {
    animation: slideIn 0.5s ease-out forwards;
  }

  .animate-fadeIn {
    animation: fadeIn 0.8s ease-out forwards;
  }

  .animate-float {
    animation: float 4s ease-in-out infinite;
  }

  .animation-delay-1000 {
    animation-delay: 1000ms;
  }

  .animation-delay-2000 {
    animation-delay: 2000ms;
  }

  .delay-1000 {
    animation-delay: 1000ms;
  }

  .delay-2000 {
    animation-delay: 2000ms;
  }

  /* Custom scrollbar styles for conversation tabs */
  .scrollbar-thin {
    scrollbar-width: thin;
  }

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

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

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

  .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: rgba(39, 174, 96, 0.4);
  }
}

/* Blog post heading styles */
.text-size-wrapper .prose h1 {
  font-size: 1.875rem;
  font-weight: 900;
  margin-top: 3.5rem;
  margin-bottom: 2.5rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #1e293b;
}

.text-size-wrapper .prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  padding-left: 2.5rem;
  border-bottom: 2px solid rgba(16, 185, 129, 0.3);
  color: #1e293b;
  position: relative;
  letter-spacing: -0.025em;
  scroll-margin-top: 6rem;
}

.text-size-wrapper .prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #10b981, #059669);
  border-radius: 9999px;
}

.text-size-wrapper .prose h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid #10b981;
  padding-left: 1.25rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  background: linear-gradient(to right, rgba(16, 185, 129, 0.05), transparent);
  color: #111827;
  scroll-margin-top: 6rem;
}

.text-size-wrapper .prose h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (min-width: 1280px) {
  .text-size-wrapper .prose h1 {
    font-size: 2.25rem;
  }
  .text-size-wrapper .prose h2 {
    font-size: 1.875rem;
  }
  .text-size-wrapper .prose h3 {
    font-size: 1.5rem;
  }
}

/* Blog post text size control */
/* Body text adjusts based on user preference */

/* Small text size (14px) */
.text-size-wrapper[data-text-size="small"] .prose p,
.text-size-wrapper[data-text-size="small"] .prose li,
.text-size-wrapper[data-text-size="small"] .prose blockquote,
.text-size-wrapper[data-text-size="small"] .prose td {
  font-size: 14px !important;
}

/* Medium text size (18px) - Default */
.text-size-wrapper[data-text-size="medium"] .prose p,
.text-size-wrapper[data-text-size="medium"] .prose li,
.text-size-wrapper[data-text-size="medium"] .prose blockquote,
.text-size-wrapper[data-text-size="medium"] .prose td {
  font-size: 18px !important;
}

/* Large text size (22px) */
.text-size-wrapper[data-text-size="large"] .prose p,
.text-size-wrapper[data-text-size="large"] .prose li,
.text-size-wrapper[data-text-size="large"] .prose blockquote,
.text-size-wrapper[data-text-size="large"] .prose td {
  font-size: 22px !important;
}

/* Default when no data-text-size is set (18px) */
.text-size-wrapper .prose p,
.text-size-wrapper .prose li,
.text-size-wrapper .prose blockquote,
.text-size-wrapper .prose td {
  font-size: 18px;
}

/* Reduced Motion Support - Accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
