/* 
================================================================================
Theme Name: Tooltip Master - Health & Fitness Calculators
Description: Modern, responsive, accessiblity-friendly template with light/dark theme.
================================================================================
*/

/* -----------------------------------------------------------------------------
   1. GOOGLE FONTS & CSS VARIABLES
----------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@1,400;1,600;1,700&display=swap');

:root {
  --body-gradient: linear-gradient(135deg, #f8fdf9 0%, var(--bg-primary) 100%);
  /* Font Family */
  --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-accent: 'Playfair Display', Georgia, serif;

  /* Colors (Light Theme Default) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  
  --primary: #0d9488; /* Teal 600 */
  --primary-hover: #0f766e; /* Teal 700 */
  --primary-light: #f0fdfa; /* Teal 50 */
  --primary-glow: rgba(13, 148, 136, 0.15);
  
  --accent: #3b82f6; /* Blue 500 */
  --accent-light: #eff6ff;
  --success: #10b981; /* Emerald 500 */
  --success-light: #ecfdf5;
  --warning: #f59e0b; /* Amber 500 */
  --warning-light: #fef3c7;
  --danger: #ef4444; /* Red 500 */
  --danger-light: #fef2f2;

  --border: #e2e8f0; /* Slate 200 */
  --border-focus: #0d9488;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px 0 rgba(13, 148, 136, 0.1);

  /* Layout & Transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 72px;
  --container-width: 1280px;
}

/* Dark Theme Variables */
body.dark-theme {
  --body-gradient: linear-gradient(135deg, #0b291e 0%, var(--bg-primary) 100%);
  --bg-primary: #090d16;
  --bg-secondary: #121824;
  --bg-tertiary: #1b2330;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  
  --primary: #2dd4bf; /* Teal 400 */
  --primary-hover: #14b8a6; /* Teal 500 */
  --primary-light: #115e59; /* Teal 900 */
  --primary-glow: rgba(45, 212, 191, 0.15);
  
  --accent: #60a5fa; /* Blue 400 */
  --accent-light: #1d4ed8;
  --success: #34d399; /* Emerald 400 */
  --success-light: #065f46;
  --warning: #fbbf24; /* Amber 400 */
  --warning-light: #78350f;
  --danger: #f87171; /* Red 400 */
  --danger-light: #7f1d1d;

  --border: #1e293b; /* Slate 800 */
  --border-focus: #2dd4bf;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px 0 rgba(45, 212, 191, 0.08);
}

/* -----------------------------------------------------------------------------
   2. RESET & BASE STYLES
----------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-primary);
  background: var(--body-gradient, var(--bg-primary));
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* -----------------------------------------------------------------------------
   3. HEADER & NAVIGATION
----------------------------------------------------------------------------- */
.site-header {
  height: var(--header-height);
  background-color: rgba(var(--bg-secondary) == #ffffff ? 255 : 18, var(--bg-secondary) == #ffffff ? 255 : 24, var(--bg-secondary) == #ffffff ? 255 : 36, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

body.dark-theme .site-header {
  background-color: rgba(18, 24, 36, 0.85);
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.site-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu a, .nav-menu li a, .nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  padding: 8px 16px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

/* Hover & Active Text Color transitions (No background pill) */
.nav-menu a:hover, .nav-menu li a:hover, .nav-link:hover,
.nav-menu li.current-menu-item a, .nav-menu li.current_page_item a, .nav-link.active {
  color: var(--primary);
  background-color: transparent;
}

body.dark-theme .nav-menu a:hover, body.dark-theme .nav-menu li a:hover, body.dark-theme .nav-link:hover,
body.dark-theme .nav-menu li.current-menu-item a, body.dark-theme .nav-menu li.current_page_item a, body.dark-theme .nav-link.active {
  color: #2dd4bf;
  background-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search Bar in Header */
.header-search {
  position: relative;
  max-width: 240px;
  display: none; /* Shown on scroll/details or desktop */
}

@media(min-width: 1024px) {
  .header-search {
    display: block;
  }
}

.header-search input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background-color: var(--bg-primary);
  font-size: 0.875rem;
  transition: var(--transition);
}

.header-search input:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-secondary);
  box-shadow: var(--shadow-glow);
  width: 280px;
}

.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background-color: var(--border);
  color: var(--text-primary);
  transform: scale(1.05);
}

.theme-toggle-btn .sun-icon {
  display: none;
}

body.dark-theme .theme-toggle-btn .moon-icon {
  display: none;
}

body.dark-theme .theme-toggle-btn .sun-icon {
  display: block;
}

.burger-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  width: 24px;
  cursor: pointer;
}

.burger-line {
  height: 2px;
  width: 100%;
  background-color: var(--text-primary);
  transition: var(--transition);
}

/* Mobile Drawer Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background-color: var(--bg-secondary);
  z-index: 2000;
  padding: 40px 24px;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  gap: 32px;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-close {
  align-self: flex-end;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-nav-link {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

/* -----------------------------------------------------------------------------
   4. HOMEPAGE SPECIFIC SECTIONS
----------------------------------------------------------------------------- */

/* Hero Section */
.hero-section {
  padding: 80px 0 60px;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Moving Background Gradient Blobs */
.hero-bg-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  transition: var(--transition);
}

body.dark-theme .glow-blob {
  opacity: 0.06;
}

.glow-blob-1 {
  top: -10%;
  right: 10%;
  width: 400px;
  height: 400px;
  background-color: var(--primary);
  animation: floatBlob1 20s infinite alternate ease-in-out;
}

.glow-blob-2 {
  bottom: -20%;
  left: 5%;
  width: 500px;
  height: 500px;
  background-color: var(--accent);
  animation: floatBlob2 25s infinite alternate ease-in-out;
}

.glow-blob-3 {
  top: 30%;
  left: 35%;
  width: 350px;
  height: 350px;
  background-color: var(--warning, #f59e0b);
  animation: floatBlob3 18s infinite alternate ease-in-out;
}

/* Animations for Background Glow Blobs */
@keyframes floatBlob1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-80px, 60px) scale(1.1); }
  100% { transform: translate(-30px, -40px) scale(0.9); }
}

@keyframes floatBlob2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(100px, -80px) scale(0.95); }
  100% { transform: translate(-40px, 40px) scale(1.15); }
}

@keyframes floatBlob3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -50px) scale(1.1); }
  100% { transform: translate(60px, 80px) scale(0.9); }
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(13, 148, 136, 0.15);
}

body.dark-theme .hero-tagline {
  background-color: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.2);
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.hero-title span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title span.accent-title-font {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  background: none;
  -webkit-text-fill-color: var(--primary);
  display: inline-block;
  animation: floatSlow 6s ease-in-out infinite alternate;
}

.hero-title span.animated-precision {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: gradientShift 4s linear infinite;
  display: inline-block;
}

/* Animations for Heading */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes floatSlow {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-4px) rotate(0.5deg); }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* Hero Search Block */
.search-block {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  padding: 6px;
  display: flex;
  transition: var(--transition);
}

.search-block:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--primary-glow);
  transform: translateY(-2px);
}

.search-input-wrapper {
  flex-grow: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-block-icon {
  position: absolute;
  left: 18px;
  font-size: 1.25rem;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-block input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  font-size: 1.05rem;
  font-weight: 500;
  background: transparent;
  color: var(--text-primary);
}

.search-btn {
  background-color: var(--primary);
  color: white;
  padding: 0 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
}

.search-btn:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

/* Category Filter Tabs */
.category-tabs-section {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-secondary);
  position: sticky;
  top: var(--header-height);
  z-index: 900;
}

.category-tabs-wrapper {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.category-tabs-wrapper::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.category-tab {
  white-space: nowrap;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.category-tab:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.3);
}

body.dark-theme .category-tab {
  background-color: var(--bg-secondary);
}

body.dark-theme .category-tab:hover {
  background-color: rgba(13, 148, 136, 0.12);
  color: #2dd4bf;
  border-color: #2dd4bf;
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.1);
}

body.dark-theme .category-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
}

/* Calculator Grid & Cards */
.section-padding {
  padding: 80px 0;
}

.section-header {
  margin-bottom: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.section-title-wrap {
  max-width: 600px;
}

.section-label {
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  display: block;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.view-all-link {
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
}

.view-all-link:hover {
  border-color: var(--primary);
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
}

.calc-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 30px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.calc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.calc-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.calc-card:hover::before {
  opacity: 1;
}

.calc-card-icon {
  width: 56px;
  height: 56px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
  transition: var(--transition);
}

body.dark-theme .calc-card-icon {
  background-color: rgba(45, 212, 191, 0.1);
}

.calc-card:hover .calc-card-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  transform: scale(1.05);
}

.calc-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.calc-card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  flex-grow: 1;
}

.calc-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  margin-top: auto;
}

.calc-card-btn span {
  transition: transform 0.2s ease;
}

.calc-card:hover .calc-card-btn span {
  transform: translateX(4px);
}

/* Features/Benefits Section */
.features-section {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.feature-item {
  display: flex;
  gap: 20px;
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

body.dark-theme .feature-icon-wrap {
  background-color: rgba(96, 165, 250, 0.1);
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* CTA Section */
.cta-section {
  padding: 100px 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 80px;
}

.cta-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  z-index: 2;
}

.cta-content {
  max-width: 600px;
}

.cta-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.cta-desc {
  font-size: 1.1rem;
  color: #94a3b8;
}

.cta-btn {
  background-color: var(--primary);
  color: white;
  padding: 16px 36px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
}

.cta-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5);
}

/* FAQ Accordion */
.faq-grid {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.faq-question {
  font-weight: 700;
  font-size: 1.05rem;
}

.faq-toggle-icon {
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-toggle-icon {
  transform: rotate(45deg);
  color: var(--primary);
}

.faq-item.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  padding: 0 24px;
}

.faq-item.active .faq-body {
  max-height: 300px; /* Adjust according to content length */
  padding: 0 24px 24px 24px;
}

.faq-answer {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* -----------------------------------------------------------------------------
   5. SINGLE CALCULATOR TEMPLATE LAYOUT
----------------------------------------------------------------------------- */

/* Breadcrumb Navigation */
.breadcrumb-nav {
  padding: 24px 0 12px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.breadcrumb-item a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-tertiary);
  font-size: 0.75rem;
}

/* Layout Split: Two columns on Desktop */
.calc-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

.calculator-sticky-sidebar {
  /* Naturally flows last on mobile, below the calculator and its description */
}

@media(min-width: 1024px) {
  .calc-page-layout {
    grid-template-columns: 3fr 2fr; /* 60% left side, 40% right sidebar */
    gap: 48px;
  }
  
  .calculator-sticky-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
    padding-right: 4px;
  }
}

@media(min-width: 1200px) {
  .calc-page-layout {
    grid-template-columns: 3fr 2fr;
  }
}

/* Title & Header Section */
.calc-header {
  margin-bottom: 24px;
}

.calc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.calc-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.75px;
  line-height: 1.2;
}

/* Calculator Widget Component */
.calc-widget {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  margin-bottom: 24px;
}

.calc-widget-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-widget-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-widget-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
}

/* Input Styles */
.input-group {
  margin-bottom: 20px;
}

.input-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.input-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.input-help {
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Tab/Switch Selector Component */
.unit-switcher {
  display: flex;
  background-color: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.unit-btn {
  flex: 1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: var(--transition);
}

.unit-btn.active {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Field Inputs (text, number, select) */
.field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  padding: 12px 48px 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
}

.field-input:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-secondary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.field-unit {
  position: absolute;
  right: 16px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  pointer-events: none;
}

/* For Select Tag fields */
select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 40px;
}

body.dark-theme select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

/* Custom Range Slider Styling */
.range-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-slider-wrapper input[type="number"] {
  width: 80px;
  flex-shrink: 0;
}

.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Validation Alert styles */
.field-error {
  display: none;
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 4px;
  font-weight: 500;
}

.input-group.has-error .field-input {
  border-color: var(--danger);
  background-color: var(--danger-light);
}

.input-group.has-error .field-error {
  display: block;
}

/* Real-Time Results Section */
.calc-results-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(13, 148, 136, 0.02) 100%);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
  transition: var(--transition);
}

body.dark-theme .calc-results-card {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.05) 0%, rgba(45, 212, 191, 0) 100%);
  border-color: var(--primary);
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.result-label {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.result-value-wrap {
  text-align: right;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.result-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 4px;
}

.result-badge.success { background-color: var(--success-light); color: var(--success); }
.result-badge.warning { background-color: var(--warning-light); color: var(--warning); }
.result-badge.danger { background-color: var(--danger-light); color: var(--danger); }

/* Custom Visual Gauge (e.g. for BMI / Body Fat) */
.visual-gauge {
  position: relative;
  width: 100%;
  height: 8px;
  background-color: var(--border);
  border-radius: var(--radius-full);
  margin: 32px 0 16px;
}

.gauge-zones {
  display: flex;
  height: 100%;
  width: 100%;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.gauge-zone {
  height: 100%;
}

/* Zone Colors */
.gauge-zone.underweight { background-color: #3b82f6; width: 18.5%; }
.gauge-zone.normal { background-color: #10b981; width: 6.5%; }
.gauge-zone.overweight { background-color: #f59e0b; width: 5%; }
.gauge-zone.obese { background-color: #ef4444; width: 70%; }

.gauge-pointer {
  position: absolute;
  top: -8px;
  left: 0; /* Updated via JS */
  width: 24px;
  height: 24px;
  background-color: var(--bg-secondary);
  border: 4px solid var(--primary);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  transform: translateX(-50%);
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gauge-pointer::after {
  content: '';
  width: 4px;
  height: 4px;
  background-color: var(--primary);
  border-radius: 50%;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 600;
  padding: 0 4px;
}

/* Actions panel in widget */
.calc-widget-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.widget-btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.widget-btn.btn-clear {
  color: var(--text-secondary);
  background-color: var(--bg-primary);
}

.widget-btn.btn-clear:hover {
  background-color: var(--border);
  color: var(--text-primary);
}

.widget-btn.btn-share {
  background-color: var(--primary-light);
  border-color: rgba(13, 148, 136, 0.15);
  color: var(--primary);
}

body.dark-theme .widget-btn.btn-share {
  background-color: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.2);
}

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

.feedback-section {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.feedback-question {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.feedback-buttons {
  display: inline-flex;
  gap: 10px;
}

.feedback-btn {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
}

.feedback-btn:hover, .feedback-btn.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Sidebar Info Widget */
.sidebar-related-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.sidebar-related-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-related-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.sidebar-related-item a:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
  transform: translateX(3px);
}

body.dark-theme .sidebar-related-item a:hover {
  background-color: rgba(45, 212, 191, 0.05);
}

.sidebar-related-icon {
  color: var(--primary);
  font-size: 0.8rem;
}

/* Content Area - Left Column Details */
.calc-details-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.content-section {
  scroll-margin-top: calc(var(--header-height) + 40px);
}

.content-section h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  position: relative;
}

.content-section h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 24px 0 12px;
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.content-section p strong {
  color: var(--text-primary);
}

/* Formula Block Component */
.formula-block {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.formula-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.formula-math {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--primary);
  padding: 12px 0;
  overflow-x: auto;
  letter-spacing: 0.5px;
}

.formula-legend {
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}

/* Step-by-Step Lists */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 24px 0;
}

.step-item {
  display: flex;
  gap: 16px;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-content-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.step-content-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Author Block Component */
.author-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media(min-width: 640px) {
  .author-card {
    flex-direction: row;
    align-items: center;
  }
}

.author-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid var(--primary-light);
  object-fit: cover;
  flex-shrink: 0;
}

.author-info {
  flex-grow: 1;
}

.author-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.author-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.author-badge {
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

body.dark-theme .author-badge {
  background-color: rgba(45, 212, 191, 0.1);
}

.author-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Table of Contents for Single Page */
.toc-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.toc-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}

.toc-list a:hover {
  text-decoration: underline;
}

/* Share Block */
.share-section {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 40px;
}

.share-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.share-btn:hover {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: scale(1.05);
}

/* -----------------------------------------------------------------------------
   6. SITE FOOTER
----------------------------------------------------------------------------- */
.site-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 80px 0 40px;
  border-top: 1px solid var(--border);
}

body.dark-theme .site-footer {
  background-color: #060910;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-logo {
  color: white;
}

.footer-desc {
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-social-link {
  width: 36px;
  height: 36px;
  background-color: #1e293b;
  color: #94a3b8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}

.footer-social-link:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

.footer-title {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  font-size: 0.9rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: white;
  transform: translateX(3px);
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.85rem;
}

@media(min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-copyright {
  text-align: center;
}

.footer-bottom-links {
  display: flex;
  gap: 24px;
}

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

/* -----------------------------------------------------------------------------
   7. RESPONSIVE DESIGN - MEDIA QUERIES (GENERAL)
----------------------------------------------------------------------------- */
@media(max-width: 1023px) {
  .site-header {
    height: 64px;
  }
  
  .hero-title {
    font-size: 2.25rem;
  }
  
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .burger-menu {
    display: flex;
  }
  
  .nav-menu {
    display: none;
  }
}

@media(max-width: 639px) {
  .hero-title {
    font-size: 1.8rem;
  }
  
  .section-title {
    font-size: 1.6rem;
  }
  
  .calc-title {
    font-size: 1.8rem;
  }
  
  .cta-container {
    flex-direction: column;
    text-align: center;
  }
  
  .cta-title {
    font-size: 1.8rem;
  }
}

/* Clinical Verified Badge */
.clinical-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--success);
  background-color: var(--success-light);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.15);
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

body.dark-theme .clinical-verified-badge {
  background-color: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

/* =============================================================================
   AI CHATBOT WIDGET STYLES
   ============================================================================= */
.ai-chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  font-family: var(--font-primary), sans-serif;
}

.ai-chat-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl), 0 0 20px rgba(13, 148, 136, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

.ai-chat-trigger:hover {
  transform: scale(1.05);
}

.ai-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 520px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ai-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-chat-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.ai-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
}

.ai-chat-close:hover {
  opacity: 1;
}

.ai-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-msg-user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-msg-bot {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ai-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.ai-chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-size: 0.9rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
}

.ai-chat-input:focus {
  border-color: var(--primary);
}

.ai-chat-send {
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.ai-chat-send:hover {
  background-color: var(--primary-hover);
}

/* Prompt Banner Styling */
.ai-prompt-banner {
  margin-top: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ai-prompt-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ai-prompt-content svg {
  flex-shrink: 0;
}

.ai-prompt-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.ai-prompt-btn:hover {
  background: var(--primary-hover);
}

@media(max-width: 639px) {
  .ai-prompt-banner {
    flex-direction: column;
    text-align: center;
  }
  .ai-prompt-content {
    flex-direction: column;
  }
  .ai-chat-window {
    width: calc(100vw - 40px);
    right: -10px;
  }
}

/* =============================================================================
   SITE-WIDE BUTTON ANIMATION UPGRADES
   ============================================================================= */
button,
input[type="submit"],
input[type="button"],
.btn,
.button,
.cta-btn,
.widget-btn,
.ai-prompt-btn,
.feedback-btn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.btn:hover,
.button:hover,
.cta-btn:hover,
.widget-btn:hover,
.ai-prompt-btn:hover,
.feedback-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.15);
}

button:active,
input[type="submit"]:active,
input[type="button"]:active,
.btn:active,
.button:active,
.cta-btn:active,
.widget-btn:active,
.ai-prompt-btn:active,
.feedback-btn:active {
  transform: translateY(0) scale(0.98);
}

/* =============================================================================
   DETAILED DYNAMIC RESULTS STYLING
   ============================================================================= */
.detailed-results-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg), 0 10px 30px rgba(13, 148, 136, 0.03);
  animation: slideDownIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDownIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detailed-results-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 24px;
}

.detailed-results-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.detailed-results-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.results-table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.results-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

.results-data-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.results-data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.results-data-table tr:last-child td {
  border-bottom: none;
}

/* Reference Range cards highlight animations */
.range-zone-card.active-range {
  border-color: var(--primary) !important;
  background-color: var(--primary-light) !important;
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.1);
  transform: scale(1.01);
}

body.dark-theme .range-zone-card.active-range {
  background-color: rgba(13, 148, 136, 0.08) !important;
  border-color: #2dd4bf !important;
}

.range-zone-card.active-range .range-cond-badge {
  background-color: var(--primary) !important;
  color: white !important;
}

body.dark-theme .range-zone-card.active-range .range-cond-badge {
  background-color: #2dd4bf !important;
  color: #0f172a !important;
}

