/* VetCalc Hub - Professional Veterinary Calculator Suite
   Aesthetic: Warm, trustworthy, professional veterinary feel
   Colors: Earthy teals, warm ambers, soft creams
*/

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

:root {
  /* Primary Palette */
  --vet-teal: #2a7b7b;
  --vet-teal-dark: #1e5f5f;
  --vet-teal-light: #3d9e9e;
  
  /* Accent Colors */
  --warm-amber: #d4a574;
  --warm-amber-light: #e8c9a8;
  --soft-cream: #faf8f5;
  --pale-mint: #e8f4f4;
  
  /* Neutrals */
  --charcoal: #2d3436;
  --slate: #636e72;
  --light-gray: #b2bec3;
  --off-white: #fdfdfd;
  
  /* Functional Colors */
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 20px rgba(42, 123, 123, 0.15);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50%;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--soft-cream);
  color: var(--charcoal);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--charcoal);
}

h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }

p { margin-bottom: var(--space-md); }

a {
  color: var(--vet-teal);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--vet-teal-dark);
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-2xl) 0;
}

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

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
}

.logo-icon {
  font-size: 2rem;
}

.nav {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.nav a {
  color: rgba(255,255,255,0.9);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

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

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--vet-teal) 0%, var(--vet-teal-dark) 100%);
  color: white;
  padding: var(--space-2xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: white;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.95;
  max-width: 700px;
  margin: 0 auto var(--space-lg);
}

.hero-badge {
  display: inline-block;
  background: var(--warm-amber);
  color: var(--charcoal);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

/* Calculator Cards Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
}

.calc-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.calc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--vet-teal), var(--vet-teal-light));
}

.calc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--vet-teal-light);
}

.calc-card-icon {
  width: 60px;
  height: 60px;
  background: var(--pale-mint);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
}

.calc-card h3 {
  margin-bottom: var(--space-sm);
}

.calc-card p {
  color: var(--slate);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.calc-card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--vet-teal);
  font-weight: 600;
}

.calc-card-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.calc-card:hover .calc-card-link::after {
  transform: translateX(4px);
}

/* Calculator Page Styles */
.calculator-container {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: var(--space-xl) 0;
}

.calculator-header {
  background: linear-gradient(135deg, var(--vet-teal) 0%, var(--vet-teal-dark) 100%);
  color: white;
  padding: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.calculator-header-icon {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.calculator-header h1 {
  color: white;
  margin-bottom: var(--space-xs);
}

.calculator-header p {
  opacity: 0.9;
  margin: 0;
}

.calculator-body {
  padding: var(--space-xl);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-lg);
}

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--charcoal);
}

.label-hint {
  font-weight: 400;
  color: var(--slate);
  font-size: 0.85rem;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--off-white);
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--vet-teal);
  box-shadow: 0 0 0 3px rgba(42, 123, 123, 0.15);
}

input[type="number"]::-webkit-inner-spin-button {
  opacity: 1;
}

.input-group {
  display: flex;
  gap: var(--space-sm);
}

.input-group input {
  flex: 1;
}

.input-group select {
  width: auto;
  min-width: 100px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--vet-teal) 0%, var(--vet-teal-dark) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--pale-mint);
  color: var(--vet-teal);
}

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

.btn-reset {
  background: transparent;
  color: var(--slate);
  border: 2px solid var(--light-gray);
}

.btn-reset:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.button-group {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

/* Results Display */
.results-panel {
  background: var(--pale-mint);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-top: var(--space-xl);
  border-left: 4px solid var(--vet-teal);
}

.results-panel.warning {
  background: #fef9e7;
  border-left-color: var(--warning);
}

.results-panel.danger {
  background: #fdedec;
  border-left-color: var(--danger);
}

.results-panel.success {
  background: #eafaf1;
  border-left-color: var(--success);
}

.results-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--vet-teal);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.results-panel.warning .results-title { color: var(--warning); }
.results-panel.danger .results-title { color: var(--danger); }
.results-panel.success .results-title { color: var(--success); }

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px dashed rgba(0,0,0,0.1);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--slate);
}

.result-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--charcoal);
}

.result-value.highlight {
  color: var(--vet-teal);
  font-size: 1.25rem;
}

.result-unit {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--slate);
  margin-left: var(--space-xs);
}

/* Animal Image Decoration */
.animal-decoration {
  width: 100%;
  max-width: 400px;
  margin: var(--space-xl) auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.animal-decoration img {
  width: 100%;
  height: auto;
  display: block;
}

/* Info Box */
.info-box {
  background: var(--pale-mint);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.info-box-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-box-content h4 {
  margin-bottom: var(--space-xs);
}

.info-box-content p {
  margin: 0;
  color: var(--slate);
  font-size: 0.95rem;
}

/* Disclaimer */
.disclaimer {
  background: #fff9e6;
  border: 1px solid var(--warm-amber);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  font-size: 0.9rem;
  color: var(--slate);
}

.disclaimer strong {
  color: var(--charcoal);
}

/* References Section */
.references {
  background: var(--soft-cream);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-top: var(--space-2xl);
}

.references h3 {
  color: var(--vet-teal);
  margin-bottom: var(--space-md);
  font-size: 1.1rem;
}

.references ol {
  padding-left: var(--space-lg);
  color: var(--slate);
  font-size: 0.9rem;
}

.references li {
  margin-bottom: var(--space-sm);
}

.references a {
  word-break: break-word;
}

/* Footer */
.footer {
  background: var(--charcoal);
  color: rgba(255,255,255,0.8);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-2xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer h4 {
  color: white;
  margin-bottom: var(--space-md);
}

.footer p {
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

.footer a {
  color: var(--warm-amber-light);
}

.footer a:hover {
  color: var(--warm-amber);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-lg);
  text-align: center;
  font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
  padding: var(--space-md) 0;
  font-size: 0.9rem;
  color: var(--slate);
}

.breadcrumb a {
  color: var(--vet-teal);
}

.breadcrumb span {
  margin: 0 var(--space-sm);
}

/* Toggle Switch (for species selection) */
.toggle-group {
  display: flex;
  background: var(--pale-mint);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}

.toggle-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.toggle-btn.active {
  background: var(--vet-teal);
  color: white;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 250px;
  background-color: var(--charcoal);
  color: white;
  text-align: left;
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.4;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Ad Placeholder */
.ad-container {
  background: var(--soft-cream);
  border: 2px dashed var(--light-gray);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  margin: var(--space-xl) 0;
  color: var(--slate);
}

/* Responsive */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    text-align: center;
  }
  
  .nav {
    justify-content: center;
  }
  
  .calculator-header {
    flex-direction: column;
    text-align: center;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .header, .footer, .nav, .btn, .ad-container {
    display: none;
  }
  
  .calculator-container {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .results-panel {
    break-inside: avoid;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.pulse {
  animation: pulse 2s infinite;
}
