/* ===========================================
   HealthHub - Health Knowledge Website CSS
   Fresh, Clean, Health-Focused Theme
   =========================================== */

/* ===========================================
   CSS Custom Properties (Variables)
   =========================================== */
:root {
  /* Primary Colors */
  --color-primary: #27AE60;
  --color-primary-dark: #219A52;
  --color-secondary: #2ECC71;
  --color-accent: #16A085;
  --color-accent-dark: #128570;

  /* Background Colors */
  --color-bg: #F0FBF4;
  --color-bg-white: #FFFFFF;
  --color-bg-alt: #E8F5EC;

  /* Text Colors */
  --color-text: #2C3E50;
  --color-text-light: #5D6D7E;
  --color-text-muted: #7F8C8D;
  --color-text-white: #FFFFFF;

  /* Border Colors */
  --color-border: #D5E8D4;
  --color-border-light: #E8F5EC;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(39, 174, 96, 0.08);
  --shadow-md: 0 4px 16px rgba(39, 174, 96, 0.12);
  --shadow-lg: 0 8px 32px rgba(39, 174, 96, 0.16);
  --shadow-card: 0 4px 12px rgba(39, 174, 96, 0.1);

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-xxl: 4rem;

  /* Typography */
  --font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.4s ease;

  /* Header Height */
  --header-height: 70px;
}

/* ===========================================
   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-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

/* ===========================================
   Typography
   =========================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: 700;
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--color-text-light);
}

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

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

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

/* ===========================================
   Header & Navigation
   =========================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--color-bg-white);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: box-shadow var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.logo:hover {
  color: var(--color-primary-dark);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
  align-items: center;
}

.nav-links li a {
  color: var(--color-text);
  font-weight: 500;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-links li a:hover {
  color: var(--color-primary);
  background-color: var(--color-bg-alt);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ===========================================
   Hero Section
   =========================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--header-height);
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 50%, #D5E8D4 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 150%;
  background: radial-gradient(ellipse, rgba(46, 204, 113, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-btns {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

/* ===========================================
   Buttons
   =========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: var(--font-family);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

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

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

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

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-text-white);
  transform: translateY(-2px);
}

/* ===========================================
   Sections
   =========================================== */
.section {
  padding: var(--space-xxl) 0;
  background-color: var(--color-bg-white);
}

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

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-text-muted);
}

/* ===========================================
   Card Grid & Cards
   =========================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.card {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Article Card */
.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card-content {
  padding: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

.article-card p {
  flex: 1;
  font-size: var(--font-size-sm);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-sm);
  font-weight: 600;
  color: var(--color-primary);
}

.read-more:hover {
  color: var(--color-primary-dark);
}

.read-more::after {
  content: '→';
  transition: transform var(--transition-fast);
}

.read-more:hover::after {
  transform: translateX(4px);
}

/* Tool Card */
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-lg);
}

.tool-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  color: var(--color-primary);
  font-size: var(--font-size-2xl);
  transition: all var(--transition-base);
}

.tool-card:hover .tool-icon {
  background-color: var(--color-primary);
  color: var(--color-text-white);
  transform: scale(1.1);
}

.tool-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.tool-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ===========================================
   Article Navigation Bar
   =========================================== */
.article-nav {
  position: sticky;
  top: var(--header-height);
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  padding: var(--space-sm) 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.article-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  gap: var(--space-lg);
  overflow-x: auto;
}

.article-nav a {
  color: var(--color-text-white);
  font-weight: 500;
  font-size: var(--font-size-sm);
  white-space: nowrap;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.article-nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--color-text-white);
}

/* ===========================================
   Page Content & Article
   =========================================== */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  padding-top: calc(var(--header-height) + var(--space-xl));
}

.article-body {
  font-size: var(--font-size-lg);
  line-height: 1.8;
  color: var(--color-text);
}

.article-body h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.article-body h3 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

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

.article-body ul,
.article-body ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.article-body li {
  margin-bottom: var(--space-xs);
  color: var(--color-text-light);
}

.article-meta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ===========================================
   Tool Panel & Form Elements
   =========================================== */
.tool-panel {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-bg-white);
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

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='%235D6D7E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ===========================================
   FAQ Accordion
   =========================================== */
.faq-item {
  background-color: var(--color-bg-white);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: var(--space-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  font-family: var(--font-family);
  text-align: left;
  color: var(--color-text);
  background-color: var(--color-bg-white);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
}

.faq-question:hover {
  background-color: var(--color-bg-alt);
}

.faq-question::after {
  content: '+';
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-question::after {
  content: '−';
  transform: rotate(0deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 var(--space-md) var(--space-md);
  color: var(--color-text-light);
  line-height: 1.7;
}

/* ===========================================
   Footer
   =========================================== */
.footer {
  background-color: var(--color-text);
  color: var(--color-text-white);
  padding: var(--space-xl) 0 var(--space-lg);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.footer-links h4 {
  color: var(--color-text-white);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-md);
}

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

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

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-secondary);
}

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

.footer-bottom p {
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0;
}

/* ===========================================
   Media Queries - Mobile (max-width: 768px)
   =========================================== */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  /* Mobile Navigation */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    background-color: var(--color-bg-white);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xl);
    transition: right var(--transition-base);
    gap: var(--space-md);
  }

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

  .nav-links li a {
    font-size: var(--font-size-lg);
    display: block;
    padding: var(--space-sm);
  }

  .hamburger {
    display: flex;
  }

  /* Hero Mobile */
  .hero {
    min-height: auto;
    padding: calc(var(--header-height) + var(--space-xl)) var(--space-md) var(--space-xl);
  }

  h1 {
    font-size: var(--font-size-3xl);
  }

  h2 {
    font-size: var(--font-size-2xl);
  }

  /* Card Grid Mobile */
  .card-grid {
    grid-template-columns: 1fr;
  }

  /* Tablet: 2 columns */
  @media (min-width: 481px) and (max-width: 768px) {
    .card-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  /* Footer Mobile */
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  /* Article Navigation Mobile */
  .article-nav-inner {
    gap: var(--space-sm);
  }

  .article-nav a {
    font-size: var(--font-size-xs);
  }

  /* Tool Panel Mobile */
  .tool-panel {
    padding: var(--space-md);
  }

  /* Buttons Mobile */
  .hero-btns {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  /* Page Content Mobile */
  .page-content {
    padding: calc(var(--header-height) + var(--space-md)) var(--space-sm) var(--space-md);
  }

  .article-body {
    font-size: var(--font-size-base);
  }
}

/* ===========================================
   Utility Classes
   =========================================== */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--color-primary);
}

.text-muted {
  color: var(--color-text-muted);
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Sticky Positioning Helper */
.sticky {
  position: sticky;
}

.sticky-top {
  position: sticky;
  top: 0;
}

/* Flex Utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* Hide on mobile */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Show on mobile only */
@media (min-width: 769px) {
  .show-mobile-only {
    display: none !important;
  }
}
