/**
 * Main Stylesheet - Amigos de Patas Theme
 * Replicating Lovable design system exactly
 */

:root {
  /* Base Colors - Exact HSL from Lovable */
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(215, 25%, 27%);
  
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(215, 25%, 27%);
  
  --primary: hsl(207, 68%, 51%);
  --primary-foreground: hsl(0, 0%, 100%);
  
  --secondary: hsl(210, 17%, 98%);
  --secondary-foreground: hsl(215, 25%, 27%);
  
  --muted: hsl(210, 17%, 95%);
  --muted-foreground: hsl(215, 16%, 47%);
  
  --accent: hsl(36, 94%, 54%);
  --accent-foreground: hsl(0, 0%, 100%);
  
  --destructive: hsl(0, 84%, 60%);
  --destructive-foreground: hsl(0, 0%, 100%);
  
  --border: hsl(210, 17%, 90%);
  --input: hsl(210, 17%, 90%);
  --ring: hsl(207, 68%, 51%);
  
  /* Custom Design Tokens */
  --vibrant-blue: hsl(207, 68%, 51%);
  --energetic-teal: hsl(174, 100%, 36%);
  --warm-orange: hsl(36, 94%, 54%);
  --cheerful-yellow: hsl(48, 100%, 62%);
  --light-bg: hsl(210, 17%, 98%);
  --medium-gray: hsl(210, 17%, 95%);
  
  /* Gradients */
  --gradient-hero: linear-gradient(135deg, hsl(207, 68%, 51%) 0%, hsl(174, 100%, 36%) 100%);
  --gradient-warm: linear-gradient(180deg, hsl(0, 0%, 100%) 0%, hsl(210, 17%, 98%) 100%);
  --gradient-accent: linear-gradient(135deg, hsl(36, 94%, 54%) 0%, hsl(48, 100%, 62%) 100%);
  
  /* Shadows */
  --shadow-soft: 0 4px 20px -4px hsl(207, 68%, 51%, 0.15);
  --shadow-card: 0 2px 12px -2px hsl(207, 68%, 51%, 0.1);
  --shadow-hover: 0 8px 30px -6px hsl(207, 68%, 51%, 0.2);
  
  /* Spacing */
  --radius: 0.75rem;
  --container-padding: 2rem;
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
.dark {
  --background: hsl(215, 25%, 10%);
  --foreground: hsl(210, 17%, 98%);
  --card: hsl(215, 25%, 12%);
  --card-foreground: hsl(210, 17%, 98%);
  --primary: hsl(207, 68%, 60%);
  --secondary: hsl(215, 20%, 18%);
  --secondary-foreground: hsl(210, 17%, 98%);
  --muted: hsl(215, 20%, 18%);
  --muted-foreground: hsl(210, 17%, 70%);
  --border: hsl(215, 20%, 20%);
  --input: hsl(215, 20%, 20%);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--foreground);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-card);
}

.btn-primary:hover {
  background: hsl(207, 68%, 45%);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-foreground);
  box-shadow: 0 4px 14px -2px hsl(36, 94%, 54%, 0.3);
  font-weight: 600;
}

.btn-accent:hover {
  background: hsl(36, 94%, 48%);
  box-shadow: 0 6px 20px -4px hsl(36, 94%, 54%, 0.4);
  transform: translateY(-1px);
}

.btn-hero {
  background: hsla(0, 0%, 100%, 0.9);
  color: var(--primary);
  border: 2px solid hsla(0, 0%, 100%, 0.5);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card);
  font-weight: 600;
}

.btn-hero:hover {
  background: hsl(0, 0%, 100%);
  border-color: hsl(0, 0%, 100%);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-lg {
  height: 2.75rem;
  padding: 0 2rem;
  font-size: 1rem;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--card-foreground);
}

.card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
}

.card-content {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-default {
  background: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-section img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, hsla(207, 68%, 51%, 0.4), hsla(207, 68%, 51%, 0.2), transparent);
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  backdrop-filter: blur(4px);
  background: hsla(0, 0%, 100%, 0.1);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 56rem;
  margin: 0 auto;
}

.hero-content h1 {
  color: white;
  font-size: 3.75rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out;
}

.hero-content p {
  color: hsla(0, 0%, 100%, 0.95);
  font-size: 1.25rem;
  margin-bottom: 2rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 1s ease-out 0.15s both;
}

.hero-content .btn {
  animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 4rem 0;
}

.stat-card {
  text-align: center;
  padding: 2rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.stat-icon {
  width: 2rem;
  height: 2rem;
  color: var(--primary);
  margin: 0 auto 0.75rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Animals Grid */
.animals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.animal-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition-smooth);
}

.animal-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.animal-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.animal-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.animal-card:hover .animal-card-image img {
  transform: scale(1.1);
}

.animal-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: hsla(0, 0%, 100%, 0.9);
  backdrop-filter: blur(4px);
}

.animal-card-content {
  padding: 1rem;
}

.animal-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.animal-card-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.animal-card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Section Styles */
.section {
  padding: 4rem 0;
}

.section-gray {
  background: var(--secondary);
}

.section-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  text-align: center;
  color: var(--muted-foreground);
  max-width: 48rem;
  margin: 0 auto 3rem;
}

.section-primary .section-subtitle {
  color: hsla(0, 0%, 100%, 0.9);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: var(--transition-smooth);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px hsla(207, 68%, 51%, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Filters */
.filters-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 2rem 0;
}

.filter-input,
.filter-select {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Responsive */
@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
  }
  
  .hero-section {
    min-height: 500px;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  .filters-wrapper {
    flex-direction: column;
  }
  
  .filter-input,
  .filter-select {
    width: 100%;
  }
}