/* DogHealth Hub - Main Stylesheet */
/* Design System: Primary #2E86AB, Secondary #A23B72, Accent #F18F01, Background #F5F9FC, Card #FFFFFF, Text #2C3E50 */

:root {
  --primary: #2E86AB;
  --primary-dark: #246580;
  --primary-light: #3a9fc4;
  --secondary: #A23B72;
  --secondary-dark: #8a2f60;
  --accent: #F18F01;
  --accent-dark: #d07d01;
  --background: #F5F9FC;
  --card: #FFFFFF;
  --text: #2C3E50;
  --text-light: #5a6c7d;
  --text-lighter: #8899a6;
  --border: #e1e8ed;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --font-primary: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-primary);
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-bar {
  background: var(--primary);
  padding: 1rem 0;
}

.header-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-tagline {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
}

nav {
  display: flex;
  gap: 0.25rem;
}

nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

nav a:hover, nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Main Content */
main {
  flex: 1;
  padding: 2rem 0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Tool Cards */
.tool-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.tool-card h2 {
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group .help-text {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-primary);
  color: var(--text);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 134, 171, 0.15);
}

input::placeholder {
  color: var(--text-lighter);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6c7d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

/* Range Sliders */
input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  margin: 0.5rem 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.range-value {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 60px;
  text-align: center;
}

/* Checkboxes & Radio Buttons */
.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--background);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-item:hover,
.radio-item:hover {
  background: #eef3f7;
}

.checkbox-item input,
.radio-item input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-label,
.radio-label {
  flex: 1;
  cursor: pointer;
}

.severity-scale {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.severity-option {
  flex: 1;
  min-width: 80px;
}

.severity-option input {
  display: none;
}

.severity-option label {
  display: block;
  text-align: center;
  padding: 0.6rem 0.75rem;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.severity-option input:checked + label {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.severity-option input[value="1"] + label { background: #e8f5e9; border-color: #a5d6a7; }
.severity-option input[value="1"]:checked + label { background: var(--success); border-color: var(--success); color: white; }
.severity-option input[value="2"] + label { background: #fff3e0; border-color: #ffcc80; }
.severity-option input[value="2"]:checked + label { background: var(--warning); border-color: var(--warning); color: white; }
.severity-option input[value="3"] + label { background: #ffebee; border-color: #ef9a9a; }
.severity-option input[value="3"]:checked + label { background: var(--danger); border-color: var(--danger); color: white; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(46, 134, 171, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(46, 134, 171, 0.4);
}

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

.btn-secondary:hover {
  background: var(--secondary-dark);
}

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

.btn-accent:hover {
  background: var(--accent-dark);
}

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

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

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Result Box */
.result-box {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  margin-top: 1.5rem;
  animation: slideUp 0.4s ease-out;
  border-left: 5px solid var(--primary);
}

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

.result-box h3 {
  color: var(--primary);
  font-size: 1.35rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-content {
  color: var(--text);
  line-height: 1.7;
}

.result-content p {
  margin-bottom: 0.75rem;
}

.result-score {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.score-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.score-label {
  font-size: 1.1rem;
  color: var(--text-light);
}

/* Score Cards */
.score-card {
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
}

.score-card.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.score-card.highlight .score-label {
  color: rgba(255,255,255,0.85);
}

.score-card .value {
  font-size: 2rem;
  font-weight: 700;
  color: inherit;
}

.score-card .label {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.score-card.highlight .label {
  color: rgba(255,255,255,0.85);
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-success {
  background: #e8f5e9;
  border-left: 4px solid var(--success);
  color: #2e7d32;
}

.alert-warning {
  background: #fff3e0;
  border-left: 4px solid var(--warning);
  color: #e65100;
}

.alert-danger {
  background: #ffebee;
  border-left: 4px solid var(--danger);
  color: #c62828;
}

.alert-info {
  background: #e3f2fd;
  border-left: 4px solid var(--info);
  color: #1565c0;
}

/* Emergency Alert */
.emergency-alert {
  background: linear-gradient(135deg, var(--danger) 0%, #c0392b 100%);
  color: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
}

.emergency-alert h4 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Progress Bar */
.progress-bar {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.progress-low { background: var(--success); }
.progress-medium { background: var(--warning); }
.progress-high { background: var(--danger); }

/* Tips List */
.tips-list {
  list-style: none;
  padding: 0;
}

.tips-list li {
  padding: 0.75rem 0 0.75rem 2rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.tips-list li:last-child {
  border-bottom: none;
}

.tips-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.info-item {
  background: var(--background);
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.info-item .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.info-item .label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin: 1.25rem 0;
}

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

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--background);
  font-weight: 600;
  color: var(--text);
}

tr:hover td {
  background: #f8fafc;
}

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--background);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s;
}

.checklist-item:hover {
  background: #eef3f7;
}

.checklist-item.checked {
  background: #e8f5e9;
}

.checklist-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  accent-color: var(--success);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-item .checklist-content {
  flex: 1;
}

.checklist-item .checklist-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.checklist-item .checklist-desc {
  font-size: 0.875rem;
  color: var(--text-light);
}

/* BCS Visual Scale */
.bcs-scale {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  padding: 0 0.5rem;
}

.bcs-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.bcs-point:hover {
  transform: scale(1.05);
}

.bcs-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--border);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-light);
  border: 3px solid transparent;
  transition: all 0.2s;
}

.bcs-point.active .bcs-circle {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dark);
}

.bcs-point.underweight .bcs-circle { background: #81d4fa; border-color: #4fc3f7; }
.bcs-point.ideal .bcs-circle { background: var(--success); border-color: #2e7d32; }
.bcs-point.overweight .bcs-circle { background: var(--warning); border-color: #ef6c00; }
.bcs-point.obese .bcs-circle { background: var(--danger); border-color: #c62828; }

.bcs-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  max-width: 70px;
}

/* Footer */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-section a {
  display: block;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 0.35rem 0;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}

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

/* Related Tools */
.related-tools {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}

.related-tools h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--background);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  border: 2px solid transparent;
}

.related-card:hover {
  border-color: var(--primary);
  background: white;
}

.related-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.related-info h4 {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.related-info p {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Formula Display */
.formula-box {
  background: #f8f9fa;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-light);
  text-align: center;
}

/* Mobile Menu */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }
  
  nav.active {
    display: flex;
  }
  
  nav a {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
  }
  
  .page-header h1 {
    font-size: 1.75rem;
  }
  
  .tool-card {
    padding: 1.25rem;
  }
  
  .result-box {
    padding: 1.25rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .bcs-scale {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .bcs-point {
    margin: 0.25rem;
  }
  
  .severity-scale {
    flex-direction: column;
  }
  
  .severity-option {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .score-number {
    font-size: 2.5rem;
  }
  
  .btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
  }
}

/* Unit Toggle */
.unit-toggle {
  display: flex;
  background: var(--background);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  margin-bottom: 1rem;
}

.unit-toggle button {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  color: var(--text-light);
}

.unit-toggle button.active {
  background: var(--primary);
  color: white;
}

/* Loading State */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-in {
  animation: slideIn 0.4s ease;
}

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

/* Metric/Imperial Toggle */
.input-with-toggle {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.input-with-toggle input {
  flex: 1;
}

.input-unit {
  padding: 0.75rem;
  background: var(--background);
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-size: 0.9rem;
  min-width: 60px;
  text-align: center;
}
