/* Custom CSS Design System - Yu Sleep Supplement Review */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #0f172a;     /* Deep Slate / Dark Navy */
  --text-secondary: #475569;   /* Muted Slate */
  --text-light: #94a3b8;
  
  --color-primary: #0ea5e9;     /* Soft Blue accent */
  --color-primary-dark: #0284c7;
  --color-secondary: #059669;   /* Trust-focused Green accent */
  --color-secondary-dark: #047857;
  --color-accent: #f59e0b;      /* Alert Orange */
  
  --border-color: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.03);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  border-left: 4px solid var(--color-primary);
  padding-left: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

a {
  color: var(--color-primary-dark);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

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

/* Layout */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  padding: 3rem 0;
}

/* Global Header */
.header-wrapper {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background-color: var(--text-primary);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}

.logo-moon {
  position: absolute;
  top: 4px;
  left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: -4px 4px 0 0 #fef08a; /* Moon shape */
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
}

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

/* Global Footer */
.footer-wrapper {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem 0;
  margin-top: 4rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.footer-disclosure {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-nav h4 {
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.footer-nav li {
  margin-bottom: 0.75rem;
}

.footer-nav a {
  color: var(--text-secondary);
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-disclaimers {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-copyright {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Trust Components & Banners */
.disclosure-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  font-size: 0.88rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.disclosure-box-icon {
  font-size: 1.2rem;
  color: var(--color-primary);
}

.disclaimer-box {
  background-color: #fef3c7; /* Amber bg */
  border: 1px solid #fde68a;
  border-left: 4px solid var(--color-accent);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  font-size: 0.88rem;
  color: #78350f;
}

.disclaimer-box p {
  color: #78350f;
  margin-bottom: 0;
}

/* Above the Fold Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}

.hero-content {
  padding-right: 1rem;
}

.hero-tagline {
  display: inline-block;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.hero-satisfaction {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--color-secondary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0 2rem 0;
}

.hero-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.hero-image {
  max-width: 100%;
  height: auto;
  max-height: 380px;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

/* Affiliate CTABox */
.cta-box {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  text-align: center;
  margin: 3rem 0;
  box-shadow: var(--shadow-md);
}

.cta-box h3 {
  margin-top: 0;
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.cta-box p {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.cta-btn {
  display: inline-block;
  background-color: var(--color-secondary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.15rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.4);
  transition: all 0.2s ease-in-out;
  border: none;
  cursor: pointer;
}

.cta-btn:hover {
  background-color: var(--color-secondary-dark);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(5, 150, 105, 0.5);
}

.cta-disclaimer {
  display: block;
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 1rem;
  line-height: 1.4;
}

/* Sticky Mobile CTA (Only visible on mobile screens) */
.sticky-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  display: none;
  justify-content: space-between;
  align-items: center;
  z-index: 90;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
  backdrop-filter: blur(8px);
}

.sticky-mobile-cta .cta-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sticky-mobile-cta .cta-btn-sm {
  background-color: var(--color-secondary);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
}

/* Tables and Verdict boxes */
.quick-verdict {
  background-color: #f0fdf4; /* Light green bg */
  border: 1px solid #dcfce7;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2.5rem 0;
}

.quick-verdict-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  color: var(--color-secondary-dark);
  margin-bottom: 1.25rem;
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.verdict-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.verdict-card h4 {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.verdict-card p {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--text-primary);
}

/* Comparison Tables */
.table-container {
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  font-family: var(--font-heading);
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: var(--bg-secondary);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.badge-success {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-warning {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Extractable Checklist Blocks */
.checklist-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2.5rem 0;
}

.checklist-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.checklist-items {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.checklist-item {
  position: relative;
  padding-left: 2rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.checklist-item::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-secondary);
  font-weight: 800;
  font-size: 1.1rem;
}

.checklist-item.warning::before {
  content: '⚠';
  color: var(--color-accent);
}

/* Internal Links Box */
.internal-links-box {
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2.5rem 0;
}

.internal-links-box h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.internal-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.internal-links-grid a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.internal-links-grid a::before {
  content: '→';
  color: var(--color-primary);
}

/* FAQ Accordion Styling */
.faq-section {
  margin-top: 4rem;
}

.faq-item-details {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  transition: all 0.2s ease-in-out;
}

.faq-item-details[open] {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.faq-item-summary {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
}

.faq-item-summary::-webkit-details-marker {
  display: none;
}

.faq-item-summary::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--text-light);
  transition: transform 0.2s ease;
}

.faq-item-details[open] .faq-item-summary::after {
  content: '−';
  color: var(--color-primary);
}

.faq-item-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* MELBY Quick Verdict Boxes */
.melby-verdict-box {
  background-color: #f0f9ff; /* Blue tint */
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.melby-verdict-box h4 {
  color: var(--color-primary-dark);
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.melby-verdict-box p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Interactive Interactive Sleep Dosage Widget (UX Delighter) */
.dosage-widget {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 3rem 0;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.dosage-widget-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dosage-widget-desc {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.widget-control {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.widget-btn {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

.widget-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  min-width: 120px;
}

.widget-result {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
}

/* Custom Sleep SVG animation (UX Delighter) */
.sleep-scene {
  width: 100%;
  height: 120px;
  margin: 2rem 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.animated-moon {
  position: absolute;
  top: 25px;
  left: 45px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: -10px 10px 0 0 #fef08a;
  animation: floatMoon 6s ease-in-out infinite alternate;
}

.floating-stars {
  position: absolute;
  width: 100%;
  height: 100%;
}

.star {
  position: absolute;
  background-color: #ffffff;
  border-radius: 50%;
  width: 2px;
  height: 2px;
  opacity: 0.3;
  animation: pulseStar 3s infinite alternate;
}

.star:nth-child(1) { top: 20%; left: 30%; animation-delay: 0.5s; }
.star:nth-child(2) { top: 50%; left: 70%; animation-delay: 1.5s; }
.star:nth-child(3) { top: 75%; left: 45%; animation-delay: 0.8s; }
.star:nth-child(4) { top: 30%; left: 85%; animation-delay: 2s; }

.feathers-stream {
  position: absolute;
  bottom: 10px;
  right: -50px;
  display: flex;
  gap: 30px;
  animation: driftFeathers 12s linear infinite;
}

.svg-feather {
  width: 24px;
  height: 24px;
  opacity: 0.6;
}

/* Animations */
@keyframes floatMoon {
  0% { transform: translateY(0) rotate(-5deg); }
  100% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes pulseStar {
  0% { opacity: 0.2; }
  100% { opacity: 0.8; }
}

@keyframes driftFeathers {
  0% { transform: translateX(0) translateY(0) rotate(0deg); }
  50% { transform: translateX(-400px) translateY(-15px) rotate(180deg); }
  100% { transform: translateX(-800px) translateY(0) rotate(360deg); }
}

/* Accessibility settings */
@media (prefers-reduced-motion: reduce) {
  .animated-moon, .star, .feathers-stream {
    animation: none !important;
  }
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs span.separator::after {
  content: '/';
  color: var(--text-light);
}

/* Responsive Grid and Media Queries */
@media (max-width: 900px) {
  .hero-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-content {
    padding-right: 0;
  }
  .hero-image-container {
    max-width: 450px;
    margin: 0 auto;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.4rem;
  }
  .header-container {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 1rem;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
  }
  .checklist-items {
    grid-template-columns: 1fr;
  }
  .verdict-grid {
    grid-template-columns: 1fr;
  }
  .internal-links-grid {
    grid-template-columns: 1fr;
  }
  .sticky-mobile-cta {
    display: flex;
  }
  .main-content {
    padding-bottom: 80px; /* offset for sticky cta */
  }
}
