@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;1,9..40,400&display=swap');

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

:root {
  --font-display: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --soil-dark: #3d2b1f;
  --leaf-mid: #3d9636;
  --sun-gold: #dc9a40;
  --cream: #fdf8f0;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--soil-dark);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
}

/* Scanner animation */
@keyframes scanPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes scanBeam {
  0% { transform: translateY(0); }
  100% { transform: translateY(200px); }
}

.scan-overlay::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #3d9636, transparent);
  animation: scanBeam 2s linear infinite;
  box-shadow: 0 0 8px 2px rgba(61, 150, 54, 0.4);
}

/* Corner brackets for scanner */
.scan-corners::before,
.scan-corners::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: #3d9636;
  border-style: solid;
}

.scan-corners::before {
  top: 12px;
  left: 12px;
  border-width: 3px 0 0 3px;
}

.scan-corners::after {
  bottom: 12px;
  right: 12px;
  border-width: 0 3px 3px 0;
}

/* Severity badges */
.severity-mild { background: #e0f2dc; color: #255f21; border: 1px solid #94cf8d; }
.severity-moderate { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.severity-critical { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Card styles */
.shamba-card {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(61, 150, 54, 0.12);
  box-shadow: 0 2px 12px rgba(61, 43, 31, 0.06);
}

/* Bottom nav safe area */
.bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Stagger animation helper */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

.animate-fade-up {
  opacity: 0;
  animation: fadeUp 0.5s ease-out forwards;
}

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

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(61, 150, 54, 0.2);
  border-top-color: #3d9636;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(61, 150, 54, 0.3); border-radius: 2px; }

/* Offline banner */
.offline-banner {
  background: #854d0e;
  color: white;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-family: var(--font-body);
}
