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

/* Set the default background color for the entire app */
html,
body {
  background-color: #11141e;
  min-height: 100vh;
}

/* Processing dots animation */
@keyframes fadeInOut {

  0%,
  100% {
    opacity: 0.2;
  }

  50% {
    opacity: 1;
  }
}

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 240 10% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 240 10% 3.9%;
    --primary: 240 5.9% 10%;
    --primary-foreground: 0 0% 98%;
    --secondary: 240 4.8% 95.9%;
    --secondary-foreground: 240 5.9% 10%;
    --muted: 240 4.8% 95.9%;
    --muted-foreground: 240 3.8% 46.1%;
    --accent: 240 4.8% 95.9%;
    --accent-foreground: 240 5.9% 10%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 5.9% 90%;
    --input: 240 5.9% 90%;
    --ring: 240 5.9% 10%;
    --radius: 0.5rem;
  }

  .dark {
    --background: 0 0% 20%;
    --foreground: 0 0% 98%;
    --card: 0 0% 24%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 24%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 20%;
    --secondary: 0 0% 30%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 30%;
    --muted-foreground: 0 0% 70%;
    --accent: 0 0% 30%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 30%;
    --input: 0 0% 30%;
    --ring: 0 0% 83.9%;
  }
}

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

  html {
    font-size: 62.5%;
    /* 1rem = 16px - standard sizing */
  }

  body {
    @apply bg-background text-foreground;
    font-size: 1rem;
  }

  /* Remove spinners (arrows) from number inputs across browsers */
  /* Chrome, Safari, Edge, Opera */
  input[type=number]::-webkit-outer-spin-button,
  input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  /* Firefox */
  input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
  }

  /* Remove all focus outlines on buttons globally */
  button:focus,
  button:focus-visible,
  button:focus-within {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
  }
}

@font-face {
  font-family: 'Readit';
  src: url('/fonts/readit.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Readingful';
  src: url('/fonts/readingful.woff2') format('woff2');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Readmore';
  src: url('/fonts/readmore.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Readalot';
  src: url('/fonts/readalot.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Storyful';
  src: url('/fonts/storyful.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1;
  font-weight: normal;
}

/* Fade transition utilities - no easing, just linear transitions */
.fade-in {
  opacity: 1;
  transition: opacity 400ms linear;
}

.fade-out {
  opacity: 0;
  transition: opacity 400ms linear;
}

.fade-in-800 {
  opacity: 1;
  transition: opacity 800ms linear;
}

.fade-out-800 {
  opacity: 0;
  transition: opacity 800ms linear;
}

.fade-in-400 {
  opacity: 1;
  transition: opacity 400ms linear;
}

.fade-out-400 {
  opacity: 0;
  transition: opacity 400ms linear;
}

/* State-based fade classes */
.will-fade {
  transition: opacity 400ms linear;
}

.will-fade-800 {
  transition: opacity 800ms linear;
}

.will-fade-400 {
  transition: opacity 400ms linear;
}

html {
  font-size: 62.5%;
}

/* Slide-in animation */
@keyframes slide-in {
  0% {
    transform: translateY(10px) scale(0.95);
    opacity: 0;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.animate-slide-in {
  animation: slide-in 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-blink {
  animation: blink 1.8s linear infinite;
}

/* Custom scrollbar styles */
.overflow-y-auto::-webkit-scrollbar {
  width: 8px;
}

.overflow-y-auto::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Terms scrollbar with blue circle */
.scrolly::-webkit-scrollbar-thumb {
  background: radial-gradient(circle at center, #616ee2 0%, #616ee2 40%, transparent 40%) no-repeat;
  background-size: 48px 48px;
  background-position: center;
  border-radius: 50%;
  min-height: 48px;
  transition: background 0.15s ease;
}

.scrolly::-webkit-scrollbar-thumb:hover {
  background: radial-gradient(circle at center, #5264d1 0%, #5264d1 40%, transparent 40%) no-repeat;
  background-size: 48px 48px;
  background-position: center;
}

.scrolly::-webkit-scrollbar-thumb:active {
  background: radial-gradient(circle at center, #4254c1 0%, #4254c1 40%, transparent 40%) no-repeat;
  background-size: 48px 48px;
  background-position: center;
}

.scrolly::-webkit-scrollbar {
  width: 48px;
}

.scrolly::-webkit-scrollbar-track {
  background: linear-gradient(#dfe2ea80, #dfe2ea80) center/8px calc(100% - 24px) no-repeat;
  background-position: center;
  position: relative;
}

.scrolly::-webkit-scrollbar-track::before {
  content: '';
  position: absolute;
  width: 8px;
  height: 100%;
  background: #dfe2ea80;
  border-radius: 4px;
  left: 50%;
  transform: translateX(-50%);
}

/* Hide scrollbars in contact form textarea */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

/* Utility to hide scrollbars without disabling scrolling */
.scrollbar-hide {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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