/* ================================================
   Pawbridge App Styles
   Matches landing page design tokens
   ================================================ */

:root {
  --warm: #F97316;
  --warm-light: #FFF7ED;
  --warm-hover: #EA580C;
  --earth: #78716C;
  --earth-dark: #292524;
  --sage: #6B8F71;
  --sage-light: #E8F0E9;
  --cream: #FAFAF9;
  --sky: #7DD3FC;
  --red: #EF4444;
  --red-light: #FEF2F2;
  --border: rgba(120, 113, 108, 0.12);
  --shadow-sm: 0 1px 3px rgba(41, 37, 36, 0.06);
  --shadow-md: 0 8px 24px rgba(41, 37, 36, 0.08);
  --shadow-lg: 0 16px 48px rgba(41, 37, 36, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--earth-dark);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Outfit', sans-serif; }

a { color: var(--warm); text-decoration: none; }
a:hover { color: var(--warm-hover); }

/* --- NAV --- */
.app-nav {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(250, 250, 249, 0.92);
  border-bottom: 1px solid var(--border);
}

.app-nav .logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--earth-dark);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.app-nav .logo span { color: var(--warm); }

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--earth);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  transition: all 0.2s;
}
.nav-links a:hover {
  background: var(--warm-light);
  color: var(--earth-dark);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-secondary {
  background: white;
  color: var(--earth-dark);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--warm-light);
  border-color: var(--warm);
}

.btn-sage {
  background: var(--sage);
  color: white;
}
.btn-sage:hover {
  background: #5a7a5f;
  color: white;
}

.btn-lg {
  padding: 0.8rem 1.75rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

/* --- PAGE CONTAINER --- */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--earth);
  font-size: 1.05rem;
}

/* --- FILTERS --- */
.filters-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--earth);
}

.filter-group select,
.filter-group input {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--earth-dark);
  outline: none;
  transition: border-color 0.2s;
}

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

/* --- PET GRID --- */
.pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.pet-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.pet-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.pet-card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--warm-light), #FED7AA);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.pet-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-card-body {
  padding: 1.25rem;
}

.pet-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.pet-card-meta {
  font-size: 0.85rem;
  color: var(--earth);
  margin-bottom: 0.75rem;
}

.pet-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  background: var(--cream);
  color: var(--earth);
  border: 1px solid var(--border);
}

.tag-location {
  background: var(--sage-light);
  color: var(--sage);
  border-color: var(--sage-light);
}

.tag-species {
  background: var(--warm-light);
  color: var(--warm);
  border-color: var(--warm-light);
}

/* --- EMPTY STATE --- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--earth);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--earth-dark);
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* --- RESULTS COUNT --- */
.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--earth);
}

/* --- PAGINATION --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  color: var(--earth-dark);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.pagination button:hover { background: var(--warm-light); }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination button.active {
  background: var(--warm);
  color: white;
  border-color: var(--warm);
}

/* --- FORMS --- */
.form-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.form-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.form-card .subtitle {
  color: var(--earth);
  margin-bottom: 1.5rem;
}

.form-section {
  margin-bottom: 1.5rem;
}

.form-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--earth-dark);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--earth-dark);
}

.form-group label .required {
  color: var(--red);
}

.form-group input,
.form-group select,
.form-group textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--cream);
  color: var(--earth-dark);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--warm);
  background: white;
}

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

.form-group .help-text {
  font-size: 0.75rem;
  color: var(--earth);
}

/* --- PHOTO UPLOAD --- */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--cream);
}
.photo-upload-area:hover {
  border-color: var(--warm);
  background: var(--warm-light);
}
.photo-upload-area .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.photo-upload-area p { font-size: 0.85rem; color: var(--earth); }

.photo-previews {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.photo-preview {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- PET DETAIL --- */
.pet-detail-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.pet-gallery {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(135deg, var(--warm-light), #FED7AA);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}

.pet-gallery img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
}

.pet-detail-info h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.pet-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pet-detail-section {
  margin-bottom: 1.5rem;
}

.pet-detail-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--earth);
  margin-bottom: 0.5rem;
}

.pet-detail-section p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--earth-dark);
}

/* --- TOAST / ALERTS --- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  animation: slideUp 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast-success {
  background: var(--sage);
  color: white;
}

.toast-error {
  background: var(--red);
  color: white;
}

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

/* --- LOADING --- */
.loading-spinner {
  display: flex;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--warm);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* --- FOOTER --- */
.app-footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--earth);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.app-footer span { color: var(--warm); }

/* --- MOBILE --- */
@media (max-width: 768px) {
  .app-nav { padding: 0.85rem 1.25rem; }
  .app-nav .logo { font-size: 1.2rem; }
  .nav-links a { padding: 0.4rem 0.7rem; font-size: 0.8rem; }

  .page-container { padding: 1.25rem; }
  .page-header h1 { font-size: 1.5rem; }

  .filters-bar { flex-direction: column; }
  .filter-group { min-width: unset; }

  .pets-grid { grid-template-columns: 1fr; }

  .form-row { grid-template-columns: 1fr; }

  .pet-detail-layout { grid-template-columns: 1fr; }
  .pet-gallery { min-height: 250px; }
  .pet-detail-info h1 { font-size: 1.7rem; }
}

@media (max-width: 480px) {
  .nav-links { gap: 0.25rem; }
}
