/* Shelter Adoption Matcher - Public Web Styles */
:root {
  --primary: #e67e22;
  --primary-dark: #d35400;
  --secondary: #3498db;
  --success: #27ae60;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #ecf0f1;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 25px rgba(0,0,0,0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Header */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Filters Section */
.filters-section {
  background: var(--card-bg);
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
}

.filter-group select,
.filter-group input {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  min-width: 140px;
  outline: none;
  transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary);
}

.search-group {
  flex: 1;
  min-width: 200px;
}

.search-group input {
  width: 100%;
}

.results-count {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.results-count span {
  font-weight: 600;
  color: var(--primary);
}

/* Animals Grid */
.animals-section {
  padding: 30px 0 60px;
}

.animals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* Animal Card */
.animal-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.animal-card-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--border);
}

.animal-card-info {
  padding: 16px;
}

.animal-card-info h3 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.animal-card-info p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.animal-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.tag.has-notes {
  background: #e8f5e9;
  color: var(--success);
}

/* Loading & Empty States */
.loading-state,
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state p {
  font-size: 1.2rem;
  margin-bottom: 20px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  margin: 40px auto;
  position: relative;
  overflow: hidden;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-photo {
  width: 100%;
  height: 400px;
  object-fit: cover;
  background: var(--border);
}

.modal-info {
  padding: 30px;
  overflow-y: auto;
  max-height: 600px;
}

.modal-info h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.modal-details {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section h4 {
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 1rem;
}

.modal-section p {
  color: var(--text-light);
  line-height: 1.6;
}

.behavior-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.behavior-item {
  background: var(--bg);
  padding: 10px;
  border-radius: 8px;
}

.behavior-item.full-width {
  grid-column: 1 / -1;
}

.behavior-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.behavior-value {
  font-size: 0.9rem;
}

.modal-actions {
  margin-top: 24px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, background 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

/* Footer */
.footer {
  background: var(--text);
  color: white;
  padding: 30px 20px;
  text-align: center;
}

.footer p {
  margin-bottom: 4px;
}

.footer-note {
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .filter-group select,
  .filter-group input {
    width: 100%;
  }
  
  .modal-body {
    grid-template-columns: 1fr;
  }
  
  .modal-photo {
    height: 250px;
  }
  
  .modal-info {
    max-height: none;
  }
  
  .behavior-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .animals-grid {
    grid-template-columns: 1fr;
  }
}
