/* Custom styles for Credit Inspiration */

/* Base styles */
* {
  transition: background-color 0.2s ease;
}

/* Mobile-first responsive base font size */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Better touch targets for mobile */
button,
a,
input,
select,
textarea {
  min-height: 44px; /* Apple's recommended minimum touch target size */
}

/* Form inputs focus state */
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important; /* Prevents iOS zoom */
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

/* Chart containers - responsive */
canvas {
  max-height: 400px;
  width: 100% !important;
  height: auto !important;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  /* Better spacing on small screens */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Responsive typography */
  h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  /* Stack grid items on mobile */
  .grid {
    grid-template-columns: 1fr;
  }

  /* Make sticky elements not sticky on mobile */
  .sticky {
    position: relative !important;
    top: auto !important;
  }

  /* Better chart sizing on mobile */
  canvas {
    max-height: 300px;
  }

  /* Reduce padding on mobile */
  .p-8 {
    padding: 1.5rem;
  }

  .p-12 {
    padding: 2rem;
  }
}

/* Tablet optimizations */
@media (min-width: 641px) and (max-width: 1024px) {
  .lg\:col-span-2 {
    grid-column: span 1;
  }

  .lg\:col-span-3 {
    grid-column: span 1;
  }
}

/* Print styles */
@media print {
  header,
  footer,
  button {
    display: none;
  }

  .no-print {
    display: none;
  }

  @page {
    margin: 1cm;
  }
}

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* Status badges */
.badge-safe {
  background-color: #dcfce7;
  color: #166534;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-caution {
  background-color: #fef3c7;
  color: #92400e;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.badge-predatory {
  background-color: #fee2e2;
  color: #991b1b;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Hover effects for cards - only on non-touch devices */
@media (hover: hover) {
  .hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }
}

/* Better focus states for accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Improve tap highlight color on mobile */
* {
  -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
}

/* Fix iOS Safari bottom padding issue */
@supports (-webkit-touch-callout: none) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
