:root {
  --primary: #c97b3e;
  --primary-light: #f59e42;
  --primary-dark: #a5612e;
  --primary-bg: #fef6ef;
  --accent-blue: #4a90d9;
  --accent-green: #38a169;
  --accent-purple: #7c5cbf;
  --accent-red: #e05353;
  --bg: #f8f6f3;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #718096;
  --text-light: #a0aec0;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

/* Header */
header {
  background: var(--card);
  color: var(--text);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

/* Header top row (logo + hamburger) */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: auto;
}

header .logo { font-size: 1.75rem; font-weight: 800; letter-spacing: -1px; }
header .logo a { color: var(--text); }
header .logo span { color: var(--primary); }

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text);
  padding: 0.2rem 0.4rem;
  line-height: 1;
}

header nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

header nav > a {
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-xl);
  transition: all var(--transition);
  font-size: 0.9rem;
}

header nav > a:hover,
header nav > a.active {
  background: var(--primary-bg);
  color: var(--primary);
}

header .search-form {
  display: flex;
  gap: 0.4rem;
}

header .search-form input {
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 0.875rem;
  min-width: 200px;
  background: var(--bg);
  transition: all var(--transition);
}

header .search-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 123, 62, 0.12);
}

header .search-form button {
  padding: 0.45rem 1.2rem;
  border: none;
  border-radius: var(--radius-xl);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
}

header .search-form button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Dropdown Navigation */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown .dropbtn {
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-xl);
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.dropdown .dropbtn:hover,
.dropdown .dropbtn.active {
  background: var(--primary-bg);
  color: var(--primary);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--card);
  min-width: 210px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 0.4rem;
  border: 1px solid var(--border);
}

.dropdown-content a {
  color: var(--text);
  padding: 0.5rem 0.9rem;
  display: block;
  border-radius: 8px;
  font-weight: 500;
  transition: all var(--transition);
  font-size: 0.875rem;
}

.dropdown-content a:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d3436 50%, #3d4a5c 100%);
  color: #fff;
  text-align: center;
  padding: 4.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(201,123,62,0.15) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(74,144,217,0.1) 0%, transparent 50%);
}

.hero h1 { font-size: 2.75rem; margin-bottom: 0.75rem; position: relative; letter-spacing: -0.02em; }
.hero p { font-size: 1.15rem; max-width: 600px; margin: 0 auto 2rem; opacity: 0.85; position: relative; }

.hero .cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.hero .cta-buttons a {
  padding: 0.75rem 2rem;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition);
}

.hero .cta-buttons a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Container */
.container { max-width: 1120px; margin: 0 auto; padding: 2.5rem 2rem; }

/* Page heading */
.page-heading { text-align: center; margin-bottom: 2.5rem; }
.page-heading h1, .page-heading h2 { font-size: 2rem; color: var(--text); letter-spacing: -0.02em; }
.page-heading p { color: var(--text-muted); font-size: 1.05rem; }

/* Species header */
.species-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 2rem; }
.species-header .icon { font-size: 1.75rem; }
.species-header h1 { font-size: 1.75rem; letter-spacing: -0.02em; }

/* Filters */
.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.filters select,
.filters input {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--card);
  transition: all var(--transition);
}

.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 123, 62, 0.12);
}

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

.stat-card {
  background: var(--card);
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

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

.stat-card .number {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-card .label { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.stat-card.cat .number { color: var(--primary); }
.stat-card.dog .number { color: var(--accent-blue); }
.stat-card.breeds .number { color: var(--accent-purple); }

/* No results */
.no-results { text-align: center; padding: 3rem; color: var(--text-muted); }
.no-results h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }

/* Content pages – guide cards, pills, tags */
.group-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pill {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}

.pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.guide-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
}

.guide-card:hover {
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.pet-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all var(--transition);
}

.pet-card:hover {
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.card-body {
  padding: 1.25rem;
}

.guide-card .card-body h3,
.pet-card .card-body h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.card-body .breed {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.card-body .meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.card-body .meta span {
  background: var(--primary-bg);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-weight: 500;
}

.card-body .description {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0.3rem;
}

.guide-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 0.4rem;
}

.group-tag {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary-dark);
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-kids { background: #e8f5e9; color: #2e7d32; }
.badge-pets { background: #e3f2fd; color: #1565c0; }

/* Footer */
footer {
  background: var(--text);
  color: var(--text-light);
  text-align: center;
  padding: 1.5rem;
  margin-top: 3rem;
  font-size: 0.875rem;
}

footer span { color: var(--primary); }

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--card);
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  text-align: center;
  display: block;
  color: var(--text);
  border: 1px solid var(--border);
  position: relative;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  border-color: transparent;
}

.feature-card .feature-icon { font-size: 2.25rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--text); }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* Table */
table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--bg);
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

tbody tr:hover { background: var(--primary-bg); }

/* Details/summary */
details { border-radius: var(--radius); }
details summary { padding: 0.5rem 0; cursor: pointer; outline: none; font-weight: 600; }
details summary::-webkit-details-marker { color: var(--primary); }

/* Form elements */
select, input, textarea { font-family: inherit; }

label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Auth forms */
.auth-form { max-width: 440px; margin: 2.5rem auto; }
.auth-form .form-card { background: var(--card); border-radius: var(--radius-lg); padding: 2.5rem; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.auth-form .form-group { margin-bottom: 1.25rem; }
.auth-form label { font-weight: 600; display: block; margin-bottom: 0.3rem; }

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: all var(--transition);
  background: var(--card);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 123, 62, 0.12);
}

.auth-form .btn-primary {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.auth-form .btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.error-msg {
  background: #fff5f5;
  color: var(--accent-red);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid #fed7d7;
  font-size: 0.9rem;
}

.success-msg {
  background: #f0fff4;
  color: #22543d;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid #c6f6d5;
  font-size: 0.9rem;
}

/* Dashboard */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 2rem; }

.btn-add-pet {
  padding: 0.6rem 1.4rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-xl);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition);
}

.btn-add-pet:hover { background: var(--primary-dark); transform: translateY(-1px); }

.back-link {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.55rem 1.5rem;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.back-link:hover { background: var(--primary); color: #fff; }

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg);
  display: block;
}

.btn-sm {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-xl);
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-edit { background: var(--accent-blue); color: #fff; }
.btn-edit:hover { background: #3a7bc8; }
.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { background: #c0392b; }

.empty-state {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

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

/* Appointments */
.form-group { margin-bottom: 1rem; }
.form-group label { font-weight: 600; display: block; margin-bottom: 0.3rem; font-size: 0.875rem; }

.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: all var(--transition);
  background: var(--card);
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 123, 62, 0.12);
}

.sticky-sidebar { position: sticky; top: 1rem; }

/* Search results */
.search-highlight { background: #fef3c7; padding: 0 2px; border-radius: 2px; }

/* Breed comparison rating bars */
.rating-bar-wrap { margin-bottom: 0.6rem; }
.rb-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.25rem; }
.rb-title { font-weight: 600; color: var(--text); }

/* Quick links on home */
.quick-link {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  color: var(--text);
  font-size: 0.9rem;
}

.quick-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0;
    padding: 0.6rem 1rem;
  }

  .header-top {
    width: 100%;
  }

  .hamburger { display: block; }

  header nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.75rem;
  }

  header nav.open { display: flex; }

  header nav > a,
  header nav .dropbtn {
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius);
  }

  .dropdown { width: 100%; position: relative; }

  .dropdown-content {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0 0 0 1rem;
    min-width: 0;
    display: none;
  }

  .dropdown-content a { padding: 0.5rem 0.8rem; }

  .dropdown:hover .dropdown-content { display: none; }

  header .search-form {
    width: 100%;
    margin-top: 0.5rem;
  }
  header .search-form input { flex: 1; min-width: 0; }

  .hero { padding: 3rem 1.5rem; }
  .hero h1 { font-size: 1.75rem; }

  .container { padding: 1.5rem 1rem; }

  table { font-size: 0.8rem; }
  thead th, tbody td { padding: 0.5rem; }

  .feature-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .hero .cta-buttons { flex-direction: column; align-items: center; }
}
