/* Teva — Pet Social Network */
:root {
  --primary:    #FF6B35;
  --primary-h:  #e55a28;
  --accent:     #10B981;
  --bg:         #F8F6F3;
  --surface:    #FFFFFF;
  --border:     #E8E2DA;
  --text:       #1C1917;
  --muted:      #78716C;
  --dim:        #A8A29E;
  --real-color: #10B981;
  --ai-color:   #8B5CF6;
  --danger:     #EF4444;
  --radius:     14px;
  --shadow:     0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
  --nav-h:      58px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.logo-icon { font-size: 22px; }
.logo-text {
  font-size: 20px; font-weight: 800; color: var(--primary);
  letter-spacing: -0.5px;
}
.nav-links {
  display: flex; align-items: center; gap: 10px;
}
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--muted);
  text-decoration: none; padding: 6px 12px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg); }
.nav-links .nav-name {
  font-weight: 600; color: var(--text); font-size: 14px; padding: 6px 0;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 18px; border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; text-decoration: none;
  transition: all .15s; font-family: inherit;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-h); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: rgba(255,107,53,.06); }
.btn-full { width: 100%; }
.btn-large { padding: 13px 20px; font-size: 15px; }
.btn-small { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Feed layout ────────────────────────────────────────────────────────────── */
.main-container { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.feed-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }
@media (max-width: 860px) { .feed-layout { grid-template-columns: 1fr; } .sidebar { display: none; } }

.feed-header { margin-bottom: 20px; }
.feed-header h2 { font-size: 20px; font-weight: 700; }
.feed-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── Post card ──────────────────────────────────────────────────────────────── */
.post-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 16px;
  box-shadow: var(--shadow); overflow: hidden;
  transition: box-shadow .15s;
}
.post-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1), 0 8px 24px rgba(0,0,0,.08); }

.post-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px;
}
.pet-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #FFE4D6, #FFDDD0);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0; border: 2px solid var(--border);
}
.post-meta { flex: 1; min-width: 0; }
.post-pet-name {
  font-weight: 700; font-size: 15px;
  display: flex; align-items: center; gap: 6px;
}
.post-species { font-size: 12px; color: var(--muted); }
.post-time { font-size: 11px; color: var(--dim); margin-left: auto; flex-shrink: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 12px; text-transform: uppercase; letter-spacing: .04em;
}
.badge-real {
  background: rgba(16,185,129,.12); color: var(--real-color);
  border: 1px solid rgba(16,185,129,.25);
}
.badge-ai {
  background: rgba(139,92,246,.12); color: var(--ai-color);
  border: 1px solid rgba(139,92,246,.25);
}

.post-body { padding: 0 16px 14px; }
.post-content {
  font-size: 15px; line-height: 1.6; color: var(--text);
}

.post-media { width: 100%; max-height: 400px; object-fit: cover; }

.post-actions {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 12px; border-top: 1px solid var(--border);
}
.action-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 7px 10px; border-radius: 8px;
  font-size: 13px; color: var(--muted); cursor: pointer; font-family: inherit;
  transition: all .12s;
}
.action-btn:hover { background: var(--bg); color: var(--text); }
.action-btn.liked { color: var(--danger); }
.action-btn .count { font-weight: 600; }

.share-via-teva {
  margin-left: auto; font-size: 11px; color: var(--dim);
}
.watermark {
  font-size: 10px; color: var(--dim); padding: 6px 16px 12px;
  font-style: italic;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  margin-bottom: 16px;
}
.sidebar-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.sidebar-card p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.cta-emoji { font-size: 28px; margin-bottom: 10px; }

/* ── Auth pages ─────────────────────────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--nav-h)); padding: 40px 20px; }
.auth-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow); }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-emoji { font-size: 40px; margin-bottom: 12px; }
.auth-header h1 { font-size: 22px; font-weight: 800; }
.auth-header p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--muted); }
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-row { display: flex; gap: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 13px; border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--surface);
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,.12);
}
.form-group textarea { resize: vertical; }
.required { color: var(--primary); }
.optional { font-weight: 400; color: var(--dim); font-size: 12px; }
.field-hint { font-size: 12px; color: var(--dim); margin-top: 5px; }

.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox-label input[type="checkbox"] { width: auto; }

/* ── Personality traits ──────────────────────────────────────────────────────── */
.personality-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.trait-btn {
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all .12s;
}
.trait-btn:hover { border-color: var(--primary); color: var(--primary); }
.trait-btn.active { border-color: var(--primary); background: rgba(255,107,53,.1); color: var(--primary); font-weight: 700; }

/* ── Create page ────────────────────────────────────────────────────────────── */
.create-page { max-width: 640px; margin: 0 auto; padding: 28px 20px; }
.create-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 36px; box-shadow: var(--shadow); }
.create-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.page-sub { font-size: 14px; color: var(--muted); margin-bottom: 28px; }

/* ── Dashboard ──────────────────────────────────────────────────────────────── */
.dashboard-page { max-width: 900px; margin: 0 auto; padding: 28px 20px; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.dashboard-header h1 { font-size: 22px; font-weight: 800; }
.pets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.pet-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px; text-align: center;
  box-shadow: var(--shadow); position: relative;
}
.pet-avatar-lg { font-size: 52px; margin-bottom: 4px; }
.pet-card .badge { position: absolute; top: 14px; right: 14px; }
.pet-card-name { font-size: 18px; font-weight: 700; margin: 8px 0 2px; }
.pet-card-species { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pet-card-personality { font-size: 12px; color: var(--dim); margin-bottom: 12px; }
.pet-card-stats { display: flex; justify-content: center; gap: 16px; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.pet-card-stats span { font-weight: 600; color: var(--text); }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}
.modal-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 28px; width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 700; margin-bottom: 12px;
}
.modal-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--muted); padding: 2px 6px; border-radius: 6px;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.generated-post {
  background: var(--bg); border-radius: 10px; padding: 16px;
  font-size: 15px; line-height: 1.6; font-style: italic;
  color: var(--text); border: 1px solid var(--border);
}

/* ── Banners ────────────────────────────────────────────────────────────────── */
.error-banner {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  color: var(--danger); border-radius: 9px; padding: 12px 16px;
  font-size: 14px; margin-bottom: 18px;
}
.success-banner {
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.25);
  color: var(--accent); border-radius: 9px; padding: 12px 16px; font-size: 14px;
}
.success-banner a { color: var(--accent); font-weight: 600; }
.welcome-banner {
  background: linear-gradient(135deg, rgba(255,107,53,.12), rgba(16,185,129,.08));
  border: 1px solid rgba(255,107,53,.2); border-radius: 10px;
  padding: 14px 18px; font-size: 14px; font-weight: 600;
  color: var(--primary); margin-bottom: 24px;
}

/* ── Misc ───────────────────────────────────────────────────────────────────── */
.loading-spinner {
  text-align: center; padding: 48px; color: var(--dim); font-size: 14px;
}
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

.my-pets-list { }
.my-pet-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.my-pet-item:last-child { border-bottom: none; }
.my-pet-emoji { font-size: 22px; }
.my-pet-info { flex: 1; }
.my-pet-name { font-size: 14px; font-weight: 600; }
.my-pet-meta { font-size: 12px; color: var(--muted); }

/* v2 badges */
.badge-adopted {
  background: rgba(16,185,129,.12); color: #059669;
  border: 1px solid rgba(16,185,129,.25);
}
.badge-shelter {
  background: rgba(239,68,68,.10); color: #dc2626;
  border: 1px solid rgba(239,68,68,.2);
}
.pet-avatar-img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}

/* ── Post hero (feed cards) ── */
.post-pet-photo-wrap { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); display: block; }
.post-pet-photo { width: 100%; height: 220px; object-fit: cover; display: block; }
.post-pet-photo-wrap video.post-pet-photo { background: #000; }
.pet-avatar-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--border); }
.post-species-bg { height: 100px; display: flex; align-items: center; justify-content: center; font-size: 52px; }
.badge-adopted { background: rgba(139,92,246,.12); color: #8B5CF6; border: 1px solid rgba(139,92,246,.25); }
.badge-shelter { background: rgba(245,158,11,.12); color: #D97706; border: 1px solid rgba(245,158,11,.25); }
