:root {
  --primary: #0284c7; /* Sky 600 - Health Blue */
  --primary-hover: #0369a1; /* Sky 700 */
  --secondary: #10b981; /* Emerald 500 - Green */
  --background: #f8fafc; /* Slate 50 */
  --card-bg: #ffffff;
  --text-main: #1e293b; /* Slate 800 */
  --text-muted: #64748b; /* Slate 500 */
  --border: #e2e8f0; /* Slate 200 */
  --danger: #ef4444; /* Red 500 */
  --danger-bg: #fef2f2; /* Red 50 */
  
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --transition: all 0.3s ease;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --border-radius: 12px;
}

/* Dark Mode Variables (Optional enhancement later) */
@media (prefers-color-scheme: dark) {
  /* You can add dark mode colors here if requested */
}

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

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

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

/* Header */
header {
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  color: var(--secondary);
}

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

.nav-links a {
  color: var(--text-main);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}

.nav-links a:hover, .nav-links a.active {
  background-color: #f1f5f9;
  color: var(--primary);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0c4a6e 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
  border-radius: 0 0 32px 32px;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto 32px;
  opacity: 0.9;
}

.search-bar {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
}

.search-bar input {
  flex: 1;
  padding: 16px 24px;
  border-radius: 30px;
  border: none;
  font-size: 16px;
  box-shadow: var(--shadow-lg);
  outline: none;
  font-family: var(--font-family);
}

.search-bar input:focus {
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.3);
}

.search-bar button {
  background-color: var(--secondary);
  color: white;
  border: none;
  padding: 16px 32px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.search-bar button:hover {
  background-color: #059669; /* Emerald 600 */
  transform: translateY(-2px);
}

/* Grid Layouts for Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.card-tag {
  display: inline-block;
  background-color: #e0f2fe; /* Sky 100 */
  color: var(--primary-hover);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  align-self: flex-start;
}

.card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-btn {
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Home Features / How it works */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  text-align: center;
}

.feature-card {
  padding: 24px;
}

.feature-icon {
  width: 64px;
  height: 64px;
  background-color: #e0f2fe; /* Sky 100 */
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.feature-icon svg {
  width: 32px;
  height: 32px;
}

/* Category Cards */
.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-weight: 600;
  color: var(--text-main);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

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

/* Article / Bula Layout */
.bula-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  margin: 40px auto;
  align-items: start;
}

.bula-content {
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.bula-content h1 {
  font-size: 36px;
  color: var(--primary-hover);
  margin-bottom: 16px;
  line-height: 1.2;
}

.bula-content .intro {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.bula-content h2 {
  font-size: 24px;
  margin: 32px 0 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.bula-content p {
  margin-bottom: 16px;
}

.bula-content ul {
  list-style: disc;
  margin-left: 20px;
  margin-bottom: 24px;
  color: var(--text-muted);
}

.bula-content ul li {
  margin-bottom: 8px;
}

.bula-content ul li strong {
  color: var(--text-main);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
}

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

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

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

/* Danger / Important blocks */
.alert {
  background-color: var(--danger-bg);
  border-left: 4px solid var(--danger);
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 24px;
}

.alert h3 {
  color: var(--danger);
  margin-bottom: 8px;
  font-size: 16px;
}

.alert p, .alert ul {
  color: #991b1b; /* Red 800 */
  margin-bottom: 0;
}

.alert ul {
  margin-top: 8px;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item h4 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--primary);
}

/* Sidebar / AdSense */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.adsense-block {
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
  border-radius: var(--border-radius);
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.adsense-inline {
  margin: 40px auto;
  width: 100%;
  max-width: 728px; /* Tamanho padrão de banner AdSense longo */
  height: 120px;
}

/* Footer */
footer {
  background-color: white;
  border-top: 1px solid var(--border);
  padding: 40px 20px;
  text-align: center;
  margin-top: 60px;
}

.disclaimer {
  max-width: 800px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--text-muted);
  background-color: #f8fafc;
  padding: 16px;
  border-radius: 8px;
}

/* Retenção: Table of Contents */
.table-of-contents a {
  display: block;
  color: var(--text-muted);
  padding: 6px 0;
  text-decoration: none;
  font-weight: 500;
  border-left: 2px solid transparent;
  padding-left: 12px;
  margin-left: -14px;
}

.table-of-contents a:hover {
  color: var(--primary);
  border-left-color: var(--primary);
  background-color: #f8fafc;
}

/* Retenção: WhatsApp Button */
.whatsapp-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  color: white;
}

/* Retenção: Tooltip (Glossário) */
.tooltip-term {
  border-bottom: 1px dashed var(--primary);
  color: var(--primary-hover);
  cursor: help;
  position: relative;
  font-weight: 500;
}

.tooltip-term::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--text-main);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 10;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.tooltip-term::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text-main);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.tooltip-term:hover::after,
.tooltip-term:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Retenção: Calculadora de Gotas */
.calc-container {
  background: #f0fdf4; /* Green 50 */
  border: 1px solid #bbf7d0; /* Green 200 */
  padding: 24px;
  border-radius: var(--border-radius);
  margin: 24px 0;
}

.calc-container h4 {
  color: #166534; /* Green 800 */
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.calc-form input {
  padding: 10px 16px;
  border: 1px solid #86efac;
  border-radius: 8px;
  width: 120px;
  outline: none;
}

.calc-form input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.calc-form button {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.calc-form button:hover {
  background: #059669;
}

.calc-result {
  margin-top: 16px;
  font-size: 16px;
  color: #166534;
  font-weight: 600;
}

/* Prevenção global de overflow horizontal */
html, body {
  overflow-x: hidden;
  width: 100%;
}

/* Responsividade Global & Media Queries */
@media (max-width: 992px) {
  .bula-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .table-of-contents {
    position: static;
    top: auto;
  }
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .nav-wrapper {
    height: auto;
    padding: 12px 0;
    flex-direction: column;
    gap: 12px;
  }

  .nav-links {
    gap: 12px;
    width: 100%;
    justify-content: center;
  }

  .nav-links a {
    padding: 6px 12px;
    font-size: 14px;
  }

  .hero {
    padding: 48px 16px;
    border-radius: 0 0 20px 20px;
    margin-bottom: 24px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .search-bar {
    flex-direction: column;
    width: 100%;
  }

  .search-bar input {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
  }

  .search-bar button {
    width: 100%;
    padding: 14px 24px;
  }

  .bula-content {
    padding: 20px 16px;
    overflow-x: hidden;
  }

  .bula-content h1 {
    font-size: 26px;
  }

  .bula-content h2 {
    font-size: 20px;
  }

  /* Tabelas responsivas */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  th, td {
    padding: 10px 12px;
    font-size: 14px;
  }

  .calc-form {
    flex-direction: column;
    align-items: stretch;
  }

  .calc-form input {
    width: 100%;
  }

  .whatsapp-btn {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }

  .category-card {
    padding: 16px;
    font-size: 15px;
  }

  .adsense-inline {
    height: 90px;
    margin: 24px auto;
  }
}

@media (max-width: 480px) {
  .grid-cards {
    grid-template-columns: 1fr;
  }

  .logo {
    font-size: 20px;
  }

  .hero h1 {
    font-size: 24px;
  }
}
