@import "tailwindcss";

/* Toast animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(100px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate-slideIn {
  animation: slideIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-hide {
  animation: hide 150ms ease-in;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-ExtraLight.ttf") format("truetype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./fonts/Lato/Lato-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
    --radius: 0.5rem;
  }

  .dark {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 3.9%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 3.9%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 14.9%;
    --input: 0 0% 14.9%;
    --ring: 0 0% 83.1%;
  }
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --font-sans: var(--font-geist-sans);
  --font-mono: var(--font-geist-mono);

  /* Add missing gray colors for Tailwind v4 */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Lato", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Safari scroll optimization */
  -webkit-overflow-scrolling: touch;
}

/* Hide scrollbars while keeping scroll functionality */
@layer utilities {
  .scrollbar-hide {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch; /* Safari smooth scrolling */
  }
  .scrollbar-hide::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }

  /* Always show scrollbars */
  .scrollbar-always-visible {
    scrollbar-width: auto; /* Firefox - show scrollbar */
    -ms-overflow-style: scrollbar; /* IE and Edge */
  }
  .scrollbar-always-visible::-webkit-scrollbar {
    display: block; /* Safari and Chrome - always show */
    width: 16px; /* Standard scrollbar width */
    height: 16px; /* Standard scrollbar height */
  }
  .scrollbar-always-visible::-webkit-scrollbar-track {
    background: #f1f1f1; /* Light grey track */
    border-radius: 8px;
  }
  .scrollbar-always-visible::-webkit-scrollbar-thumb {
    background: #c1c1c1; /* Grey thumb */
    border-radius: 8px;
    border: 2px solid #f1f1f1; /* Padding around thumb */
  }
  .scrollbar-always-visible::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8; /* Darker on hover */
  }

  /* Safari scroll optimization utilities */
  .safari-scroll-smooth {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0); /* Force GPU acceleration */
    will-change: scroll-position;
    contain: layout style paint; /* CSS containment for performance */
  }

  /* Additional Safari performance optimizations */
  .safari-optimized {
    -webkit-transform: translate3d(0, 0, 0); /* Force GPU layer */
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000px;
    contain: layout style paint;
    isolation: isolate;
  }

  /* Firefox-specific fix using @supports */
  @supports (-moz-appearance: none) {
    /* Target table headers that contain version headers */
    table thead th {
      padding: 0 !important;
      height: auto !important;
    }

    table thead th > div {
      height: 100% !important;
      padding: 12px 16px !important;
      display: flex !important;
      flex-direction: column !important;
      box-sizing: border-box !important;
    }

    .firefox-version-header {
      display: flex !important;
      flex-direction: column !important;
      height: 100% !important;
      min-height: 0 !important;
      flex: 1 !important;
      font-size: 12px;
    }

    .firefox-version-content {
      flex: 1 1 auto !important;
      min-height: 0 !important;
      display: flex;
      flex-direction: column;
      gap: 0px;
    }

    .firefox-version-metrics {
      flex: 0 0 auto !important;
      margin-top: auto !important;
    }
  }

  /* Fallback for non-Firefox browsers */
  .firefox-version-header {
    display: flex;
    flex-direction: column;
    height: 100%;
    font-size: 12px;
  }

  .firefox-version-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .firefox-version-metrics {
    flex-shrink: 0;
    margin-top: auto;
  }
}
