/* PupLog Styles */
:root {
  --c-primary: #4A90D9;
  --c-primary-dark: #3570B0;
  --c-primary-light: #E8F0FE;
  --c-accent: #F5A623;
  --c-success: #27AE60;
  --c-danger: #E74C3C;
  --c-bg: #F7F9FC;
  --c-surface: #FFFFFF;
  --c-text: #1A2332;
  --c-text-secondary: #5A6B7F;
  --c-border: #D8E2ED;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w: 1100px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); color: var(--c-text); background: var(--c-bg); line-height: 1.6; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

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

/* Header */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-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.25rem; color: var(--c-text); }
.logo:hover { text-decoration: none; }

.main-nav { display: flex; gap: 24px; }
.main-nav a { color: var(--c-text-secondary); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover { color: var(--c-primary); text-decoration: none; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%); color: white; padding: 80px 0; text-align: center; }
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-sub { font-size: 1.15rem; opacity: 0.9; margin-bottom: 32px; max-width: 500px; margin-left: auto; margin-right: auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; font-family: var(--font); }
.btn-primary { background: var(--c-accent); color: #1A2332; border-color: var(--c-accent); }
.btn-primary:hover { background: #E0951F; border-color: #E0951F; text-decoration: none; color: #1A2332; }
.btn-ghost { background: transparent; color: var(--c-primary); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-primary-light); border-color: var(--c-primary); text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; border-radius: var(--radius); }

/* Ad Banner */
.ad-banner { max-width: var(--max-w); margin: 0 auto; padding: 16px 20px 0; }

/* Tracker Section */
.tracker-section { padding: 48px 0; }
.tracker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

.tracker-left h2 { margin-bottom: 20px; font-size: 1.5rem; }

/* Pet Tabs */
.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(--c-border); background: var(--c-surface); cursor: pointer; font-weight: 500; font-size: 0.9rem; transition: all 0.2s; }
.pet-tab.active { border-color: var(--c-primary); background: var(--c-primary); color: white; }
.pet-tab:hover:not(.active) { border-color: var(--c-primary); }

/* Form */
.log-form { background: var(--c-surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.form-row { margin-bottom: 16px; }
.form-label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; color: var(--c-text-secondary); }
.form-row input, .form-row select { width: 100%; padding: 10px 14px; border: 2px solid var(--c-border); border-radius: var(--radius-sm); font-size: 1rem; font-family: var(--font); background: var(--c-bg); transition: border-color 0.2s; }
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--c-primary); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.input-group select { width: 70px; }

.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

/* Entry List */
.entry-list { margin-bottom: 24px; }
.entry-list h3 { font-size: 1rem; margin-bottom: 12px; color: var(--c-text-secondary); }
.entry-item { background: var(--c-surface); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 8px; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.entry-info { flex: 1; }
.entry-weight { font-weight: 700; font-size: 1.1rem; }
.entry-date { color: var(--c-text-secondary); font-size: 0.85rem; }
.entry-notes { font-size: 0.85rem; color: var(--c-text-secondary); margin-top: 4px; }
.entry-delete { background: none; border: none; color: var(--c-text-secondary); cursor: pointer; font-size: 1.2rem; padding: 2px 6px; border-radius: 4px; }
.entry-delete:hover { color: var(--c-danger); background: #FDEDEC; }

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

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

/* Chart */
.chart-card, .stats-card, .alert-card { background: var(--c-surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.chart-card h3, .stats-card h3, .alert-card h3 { font-size: 1rem; margin-bottom: 16px; color: var(--c-text-secondary); }
.chart-wrap { overflow-x: auto; }
#trend-chart { min-width: 300px; }
.chart-legend { margin-top: 12px; font-size: 0.85rem; color: var(--c-text-secondary); }

/* Stats */
#stats-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#stats-list dt { font-size: 0.8rem; color: var(--c-text-secondary); font-weight: 500; }
#stats-list dd { font-size: 1.25rem; font-weight: 700; }

/* Alert */
.alert-card { border-left: 4px solid var(--c-danger); }
.alert-card h3 { color: var(--c-danger); }
.alert-card p { font-size: 0.95rem; }

/* Guide Section */
.guide-section { padding: 48px 0; }
.guide-section h2 { font-size: 1.5rem; margin-bottom: 24px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.guide-card { background: var(--c-surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.guide-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.guide-card p, .guide-card li { font-size: 0.9rem; color: var(--c-text-secondary); }
.guide-card ul { padding-left: 20px; margin-top: 8px; }
.guide-card li { margin-bottom: 4px; }

/* Examples Section */
.examples-section { padding: 48px 0; background: var(--c-surface); border-top: 1px solid var(--c-border); }
.examples-section h2 { font-size: 1.5rem; margin-bottom: 24px; }
.examples-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.example-card { background: var(--c-bg); border-radius: var(--radius); padding: 24px; border: 1px solid var(--c-border); }
.example-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.example-card p { font-size: 0.9rem; color: var(--c-text-secondary); }

/* Footer */
.site-footer { background: var(--c-text); color: rgba(255,255,255,0.7); padding: 40px 0 24px; margin-top: 48px; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; margin-bottom: 24px; flex-wrap: wrap; }
.footer-brand { font-weight: 700; font-size: 1.1rem; color: white; display: block; margin-bottom: 8px; }
.footer-grid nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-grid nav a { color: rgba(255,255,255,0.7); }
.footer-grid nav a:hover { color: white; }
.footer-small { font-size: 0.8rem; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 16px; }
.footer-small a { color: rgba(255,255,255,0.8); }

/* Print */
@media print {
  .site-header, .site-footer, .hero, .ad-banner, .guide-section, .examples-section, .form-actions, .export-actions, .entry-delete, .pet-selector button { display: none !important; }
  .tracker-grid { display: block; }
  .tracker-right { page-break-before: always; }
  body { background: white; }
  .chart-card, .stats-card { box-shadow: none; border: 1px solid #ccc; }
}

/* Responsive */
@media (max-width: 860px) {
  .tracker-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .examples-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 48px 0; }
}
@media (max-width: 520px) {
  .guide-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  #stats-list { grid-template-columns: 1fr; }
  .main-nav { gap: 14px; }
  .main-nav a { font-size: 0.85rem; }
}



/* 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;
}
