/* Pet Weight Goal Tracker - Styles */
:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --primary-light: #8B85FF;
  --accent: #FF6B6B;
  --success: #4CAF50;
  --warning: #FF9800;
  --bg: #F8F9FE;
  --bg-card: #FFFFFF;
  --bg-alt: #F0F0FF;
  --text: #2D2D3A;
  --text-muted: #6B6B80;
  --border: #E0E0F0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(108, 99, 255, 0.08);
  --shadow-lg: 0 8px 32px rgba(108, 99, 255, 0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.logo:hover { text-decoration: none; }

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.main-nav a:hover { color: var(--primary); }

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

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-sub {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto 32px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  font-family: var(--font);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  text-decoration: none;
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Tracker Section */
.tracker-section {
  padding: 48px 0;
}

.tracker-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 860px) {
  .tracker-layout { grid-template-columns: 1fr; }
  .tracker-sidebar { order: -1; }
}

/* Pet Selector */
.pet-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pet-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pet-tab {
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  transition: all 0.2s;
}

.pet-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pet-tab:hover:not(.active) {
  border-color: var(--primary);
}

/* Setup Panel */
.setup-panel, .dashboard {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.setup-panel h2, .dashboard h2 {
  font-size: 1.3rem;
  margin-bottom: 24px;
}

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

@media (max-width: 600px) {
  .setup-form .form-row { grid-template-columns: 1fr; }
}

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--bg);
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

/* Dashboard */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.dash-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-badge.on-track { background: #E8F5E9; color: var(--success); }
.dash-badge.slowing { background: #FFF8E1; color: var(--warning); }
.dash-badge.off-track { background: #FFEBEE; color: var(--accent); }
.dash-badge.goal-met { background: #E8F5E9; color: var(--success); }

.dash-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

/* Chart */
.chart-container {
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
  overflow-x: auto;
}

#progressChart {
  width: 100%;
  height: auto;
  display: block;
}

/* Milestone Bar */
.milestone-bar {
  margin-bottom: 32px;
}

.milestone-track {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.milestone-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 6px;
  transition: width 0.5s ease;
  width: 0%;
}

.milestone-markers {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Log Form */
.log-section {
  margin-bottom: 32px;
}

.log-section h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.log-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 12px;
  margin-bottom: 12px;
  align-items: end;
}

@media (max-width: 600px) {
  .log-form .form-row { grid-template-columns: 1fr; }
}

/* History Table */
.history-section h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

tr:hover td { background: var(--bg-alt); }

.change-pos { color: var(--success); font-weight: 600; }
.change-neg { color: var(--accent); font-weight: 600; }

.btn-delete {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-delete:hover { background: #FFEBEE; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  font-style: italic;
}

/* Sidebar */
.tracker-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.sidebar-card h3 {
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.sidebar-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.preset-btn {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
}

.milestone-list {
  font-size: 0.85rem;
}

.milestone-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.milestone-icon { font-size: 1.1rem; }
.milestone-text { flex: 1; }
.milestone-pct {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.78rem;
}

.milestone-done .milestone-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Info Sections */
.info-section {
  padding: 64px 0;
}

.info-section h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 40px;
}

.alt-bg {
  background: var(--bg-alt);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 800px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.step-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 16px;
}

.step-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Tips */
.tips-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

@media (max-width: 800px) {
  .tips-layout { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .tips-layout { grid-template-columns: 1fr; }
}

.tip-block {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.tip-block h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.tip-block p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.scenario-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.scenario-box h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.scenario-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* FAQ */
.faq-section {
  padding: 64px 0;
}

.faq-section h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 40px;
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: '+';
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.faq-item[open] summary::before { content: '-'; }

.faq-item p {
  padding: 0 20px 16px 44px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 40px 0 20px;
  font-size: 0.85rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand p {
  margin-top: 8px;
  font-size: 0.82rem;
}

.logo-sm {
  font-weight: 700;
  font-size: 1rem;
  color: white;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.last-updated {
  font-size: 0.78rem;
  opacity: 0.6;
}

/* Print Styles */
@media print {
  .site-header, .site-footer, .tracker-sidebar, .log-section, .dash-actions, .btn, .hero, .faq-section, .info-section { display: none !important; }
  .dashboard { box-shadow: none; padding: 0; }
  .chart-container { page-break-inside: avoid; }
  body { background: white; }
}

/* Celebration animation */
@keyframes celebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.celebrate {
  animation: celebrate 0.5s ease;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

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

/* Responsive nav */
@media (max-width: 500px) {
  .main-nav { gap: 12px; }
  .main-nav a { font-size: 0.82rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 48px 0; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
