@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

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

:root {
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 255, 255, 255;
  --background-end-rgb: 255, 255, 255;
}

.dark {
  --foreground-rgb: 255, 255, 255;
  --background-start-rgb: 0, 0, 0;
  --background-end-rgb: 0, 0, 0;
}

body {
  color: rgb(var(--foreground-rgb));
  background: rgb(var(--background-start-rgb));
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

@layer utilities {
  .text-balance {
    text-wrap: balance;
  }
  
  .font-tt-interphases {
    font-family: 'TT Interphases', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }
}

/* Mobile Optimization */
@media (max-width: 768px) {
  
  /* Optimize touch targets */
  button, a, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve mobile typography */
  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }
  
  h2 {
    font-size: 2rem;
    line-height: 1.3;
  }
  
  /* Better mobile spacing */
  .py-24 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  /* Mobile-friendly cards */
  .bg-white {
    margin: 0.5rem;
  }
  
  /* Optimize mobile navigation */
  .hidden.md\\:flex {
    display: none;
  }
  
}

/* Performance optimizations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .text-gray-600 {
    color: #000;
  }
  
  .border-gray-200 {
    border-color: #000;
  }
}

/* Typing Animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: #000;
  }
}

.typing-animation {
  overflow: hidden;
  border-right: 2px solid #000;
  white-space: nowrap;
  margin: 0 auto;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
  animation-fill-mode: forwards;
}

/* Mobile Menu Styles */
.mobile-menu-open {
  max-height: 500px !important;
  opacity: 1 !important;
}

/* Enable proper transitions for header and footer */
nav, footer {
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

nav a, footer a, nav button, footer button {
  transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
}

/* Keep logo hover effects */
nav .group:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

/* Dark Mode Styles */
.dark {
  color-scheme: dark;
}

.dark .faq-item {
  border-bottom: 1px solid #374151;
}

.dark .faq-button:hover {
  color: #d1d5db;
}

.dark .faq-question {
  color: #f9fafb;
}

.dark .faq-arrow {
  color: #9ca3af;
}

.dark .faq-answer {
  color: #9ca3af;
}

/* Dark mode transitions */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* FAQ Styles */
.faq-item {
  border-bottom: 1px solid #e5e7eb;
}

.faq-button {
  width: 100%;
  text-align: left;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-button:hover {
  color: #374151;
}

.faq-question {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.faq-arrow {
  width: 1.5rem;
  height: 1.5rem;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.faq-arrow.rotated {
  transform: rotate(180deg);
}

.faq-answer {
  padding-bottom: 1rem;
  color: #6b7280;
  line-height: 1.6;
}

.faq-answer p {
  margin: 0;
}

/* Dataset Page Styles */
.dataset-card {
  transition: all 0.3s ease;
}

.dataset-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.download-button {
  transition: all 0.2s ease;
}

.download-button:hover {
  transform: translateY(-1px);
}

.download-button:active {
  transform: translateY(0);
}

/* Dataset format badges */
.format-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0.125rem;
}

.format-badge-csv {
  background-color: #dbeafe;
  color: #1e40af;
}

.dark .format-badge-csv {
  background-color: #1e3a8a;
  color: #dbeafe;
}

.format-badge-json {
  background-color: #dcfce7;
  color: #166534;
}

.dark .format-badge-json {
  background-color: #14532d;
  color: #dcfce7;
}

.format-badge-txt {
  background-color: #f3f4f6;
  color: #374151;
}

.dark .format-badge-txt {
  background-color: #4b5563;
  color: #f3f4f6;
}

/* Loading animation for download buttons */
@keyframes download-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.downloading {
  animation: download-pulse 1s ease-in-out infinite;
}

/* Dataset statistics */
.dataset-stats {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.dark .dataset-stats {
  background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 100%);
}

/* Responsive dataset grid */
@media (max-width: 768px) {
  .dataset-card {
    margin-bottom: 1rem;
  }
  
  .download-button {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}