@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --orange:#ff9a3c; --orange-dark:#e58e32; --orange-light:#fff4e8;
  --green:#4caf50;  --red:#e53935;         --blue:#1877f2;
  --bg:#f0f2f5;     --card:#fff;           --text:#1c1e21;
  --muted:#65676b;  --border:#e0e0e0;
  --shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.06);
  --shadow-md:0 4px 12px rgba(0,0,0,.1);
  --radius:12px;
}

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

body {
  font-family: 'Nunito', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
}

/* ── HEADER ───────────────────────────────────── */
.site-header {
  background: var(--orange);
  color: #fff;
  padding: 8px 16px;
  text-align: center;
  line-height: 1.3;
}
.site-header h1 { font-size: 1.3em; font-weight: 800; }
.site-header p  { font-size: .78em; opacity: .9; }

/* ── NAV ─────────────────────────────────────── */
.top-nav {
  display: flex;
  justify-content: space-around;
  background: #1a1a2e;
  padding: 6px 0;
  position: sticky;
  top: 0;
  z-index: 300;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.nav-item {
  color: #9e9eb8;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  border-radius: 8px;
  transition: color .18s;
  position: relative;
  font-size: .68em;
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-item i { font-size: 18px; }
.nav-item.active, .nav-item:hover { color: var(--orange); }

.notification-badge {
  position: absolute;
  top: 0; right: 2px;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  min-width: 17px; height: 17px;
  font-size: .58em;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  padding: 0 3px;
  border: 2px solid #1a1a2e;
}

/* ── FOOTER ──────────────────────────────────── */
footer {
  background: #1a1a2e;
  color: #888;
  padding: 16px 20px;
  text-align: center;
  margin-top: auto;
  font-size: .82em;
}
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 6px; flex-wrap: wrap; }
.footer-links a { color: #aaa; text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--orange); }
.footer-copy { font-size: .75em; color: #555; }

/* ── BUTTONS ─────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: .88em; transition: all .18s; text-decoration: none; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover:not(:disabled) { background: var(--orange-dark); }
.btn-green  { background: var(--green);  color: #fff; }
.btn-green:hover:not(:disabled)  { background: #43a047; }
.btn-red    { background: var(--red);    color: #fff; }
.btn-red:hover:not(:disabled)    { background: #c62828; }
.btn-blue   { background: var(--blue);   color: #fff; }
.btn-blue:hover:not(:disabled)   { background: #1565c0; }
.btn-ghost  { background: #f0f0f0; color: #444; border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled)  { background: #e4e6eb; }
.btn-lg { padding: 12px 28px; font-size: .97em; }
.btn-sm { padding: 6px 12px; font-size: .8em; }
.btn-full { width: 100%; }

/* ── FORMS ───────────────────────────────────── */
.form-wrap    { max-width: 680px; margin: 24px auto; padding: 28px 24px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.form-wrap h2 { color: var(--orange); text-align: center; margin-bottom: 22px; font-size: 1.5em; font-weight: 800; }
.form-group   { margin-bottom: 15px; }
.form-label   { display: block; margin-bottom: 5px; font-weight: 700; color: #555; font-size: .85em; }
.form-input   { width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: .93em; transition: border .18s, box-shadow .18s; background: #fff; }
.form-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,154,60,.15); }
.form-input[disabled] { background: #f5f5f5; cursor: not-allowed; }
textarea.form-input { resize: vertical; min-height: 90px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.col-span-2 { grid-column: span 2; }

/* File upload zone */
.upload-zone { border: 2px dashed var(--border); border-radius: 10px; padding: 22px; text-align: center; cursor: pointer; transition: all .2s; background: #fafafa; }
.upload-zone:hover { border-color: var(--orange); background: var(--orange-light); }
.upload-zone i    { font-size: 2.2em; color: var(--orange); display: block; margin-bottom: 8px; }
.upload-zone p    { font-size: .85em; color: var(--muted); }

/* ── ALERTS ──────────────────────────────────── */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 13px; font-size: .88em; display: none; font-weight: 600; }
.alert-error   { background: #fdecea; color: #c62828; }
.alert-success { background: #e8f5e9; color: #2e7d32; }

/* ── MODAL ───────────────────────────────────── */
.modal-ov { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 500; justify-content: center; align-items: center; padding: 14px; backdrop-filter: blur(4px); }
.modal-ov.open { display: flex; }
.modal-box { background: var(--card); border-radius: 14px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: 0 8px 40px rgba(0,0,0,.25); animation: popIn .2s ease; }
@keyframes popIn { from { opacity:0; transform:scale(.94) } to { opacity:1; transform:scale(1) } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; border-radius: 14px 14px 0 0; }
.modal-head h3 { font-size: 1.1em; font-weight: 800; }
.modal-cls { background: #f0f0f0; border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 1.2em; display: flex; align-items: center; justify-content: center; color: #555; }
.modal-cls:hover { background: #e0e0e0; }

/* ── CAT CARDS ───────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; padding: 18px 0; }
.cat-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; cursor: pointer; display: flex; flex-direction: column; }
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.cat-card-img { height: 240px; background-size: cover; background-position: center; background-color: #f0f0f0; position: relative; }
.cat-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-card-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.cat-card-body h4 { font-size: 1.35em; font-weight: 800; color: #0056b3; margin-bottom: 7px; }
.cat-card-meta { font-size: 1em; color: var(--muted); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.cat-card-meta i { color: var(--orange); font-size: 1em; }
.cat-card-stats { display: flex; gap: 16px; font-size: 1em; color: var(--muted); margin: 8px 0 14px; }
.cat-card-stats span { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.cat-card-actions { display: flex; gap: 10px; margin-top: auto; }
.cat-card-actions .btn { flex: 1; padding: 13px 10px; font-size: 1em; font-weight: 700; }

/* owner row */
.owner-row { display: flex; align-items: center; gap: 9px; font-size: 1em; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }

/* ── BADGES ──────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: .7em; font-weight: 800; }
.badge-adoption { background: #dbeafe; color: #1e40af; }
.badge-rescue   { background: #fee2e2; color: #b91c1c; }
.badge-vet      { background: #dcfce7; color: #166534; }

/* ── SEARCH BAR ──────────────────────────────── */
.search-section { background: var(--card); border-bottom: 1px solid var(--border); padding: 14px 20px 10px; }
.search-inner   { max-width: 1100px; margin: 0 auto; }
.type-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 13px; }
.type-btn { padding: 8px 18px; border: 1.5px solid transparent; border-radius: 20px; cursor: pointer; font-family: inherit; font-size: .87em; font-weight: 700; transition: all .18s; background: #f0f0f0; color: #555; }
.type-btn.active { background: var(--orange) !important; color: #fff !important; border-color: var(--orange-dark) !important; }
.type-btn.adoption { background: #dbeafe; color: #1e40af; }
.type-btn.rescue   { background: #fee2e2; color: #b91c1c; }
.type-btn.vet-btn  { background: #dcfce7; color: #166534; }
.loc-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.loc-label { display: block; font-size: .76em; color: var(--muted); margin-bottom: 3px; font-weight: 700; }
.loc-select { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 7px; font-family: inherit; font-size: .86em; }
.loc-select:focus { border-color: var(--orange); outline: none; }
.loc-select:disabled { background: #f5f5f5; }
.cta-bar { background: #e8f5e9; border: 1px dashed var(--green); border-radius: 9px; padding: 10px 16px; margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cta-bar span { font-size: .88em; color: #2e7d32; font-weight: 700; }

/* ── SECTION WRAPPER ─────────────────────────── */
.section-wrap { flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; padding: 0 16px; }
.section-title { font-size: 1.25em; font-weight: 800; color: #444; margin: 16px 0 0; }
.see-more-wrap { text-align: center; padding: 16px; }

/* ── EMPTY / LOADING ─────────────────────────── */
.empty { text-align: center; padding: 44px 18px; color: #bbb; }
.empty i { font-size: 2.8em; margin-bottom: 12px; display: block; opacity: .3; }
.empty h3 { color: #999; font-size: 1em; margin-bottom: 5px; }
.spin { text-align: center; padding: 34px; color: #bbb; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 768px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-grid  { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .loc-grid   { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .cards-grid { grid-template-columns: 1fr; }
}
