/* pfoa-animation.css
   Simplified + fixed styles for the scroll-driven PFOA animation.
   Put this in your static CSS file (already referenced by layout.html).
*/

/* Remove all default margins and padding */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Make only the animation section full-screen while keeping header/footer */
.scroll-container {
  /* Let the document body be the scroll container (normal page scrolling). */
  min-height: 100vh;
  overflow: visible;
  background: transparent;
  margin: 0;
  padding: 0;
  /* Ensure no bottom margin to prevent gaps */
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  position: relative;
  z-index: 1;
}

/* Make the animation section break out of its container to be full-screen */
.animation-section {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  width: 100vw !important;
  margin: 0 !important;
  padding: 60px 0 40px 0 !important; /* reduced top padding for thinner navbar */
  background: #12121b;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* changed from center to flex-start to move content up */
  padding-top: 200px !important; /* much more padding to fix overcrowding */
  z-index: 1000 !important;
  overflow: visible;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

/* molecule container that holds the layer; it's responsive */
.molecule-container {
  position: relative;
  width: 72vmin;
  max-width: 720px;
  height: 72vmin;
  max-height: 720px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* keep molecule contained */
  pointer-events: none;
  border: none; /* ensure no border */
  outline: none; /* ensure no outline */
  background: transparent; /* ensure no background */
  border-radius: 50%; /* create circular container */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1); /* subtle circular outline */
}

/* absolute layer whose coordinate system is used for atom positions */
.molecule-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  transform-origin: 50% 50%;
  /* We keep the translate(-50%,-50%) base; JS will append extra translate(px,px) */
  transform: translate(-50%, -50%) scale(1);
  transition: transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  filter: drop-shadow(0 0 24px rgba(0, 255, 136, 0.18));
  pointer-events: none;
}

/* generic atom styles */
.atom {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 220ms cubic-bezier(.2,.9,.2,1), opacity 200ms ease, box-shadow 220ms ease;
  will-change: transform, opacity;
}

/* fluorine visual */
.atom.fluorine {
  background: radial-gradient(circle, #00ff88 0%, #00cc66 100%);
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 12px rgba(0,255,136,0.35);
  width: 20px;
  height: 20px;
}

/* carbon */
.atom.carbon {
  background: #cfcfcf;
  border: 2px solid #fff;
  width: 14px;
  height: 14px;
}

/* bonds (simple lines) */
.bond {
  position: absolute;
  height: 2px;
  background: rgba(255,255,255,0.85);
  transform-origin: left center;
}

/* bubble shown inside the fluorine atom when zoomed */
.bubble {
  position: absolute;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle at 50% 50%, rgba(0,255,136,0.3), rgba(0,0,0,0.9) 70%);
  color: #eafff0;
  padding: 3px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0,255,136,0.4), inset 0 0 10px rgba(0,255,136,0.3);
  opacity: 0;
  transition: opacity 400ms ease, transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 50;
  pointer-events: none;
  text-align: center;
  font-weight: 300;
  line-height: 0.95;
  font-size: 0.28rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* show */
.bubble.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(0.85);
}

/* key page layout (JS will create pages) */
.content-sections {
  position: relative;
  z-index: 1;
  /* Break out of Bootstrap container */
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  width: 100vw !important;
  /* Add space for footer */
  margin-bottom: 200px !important;
  padding-bottom: 0 !important;
}

/* each generated page consumes full viewport so scrolling is one-page-per-fluorine */
.content-page {
  min-height: 100vh;
  padding: 12vh 2rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: white;
  background: #12121b;
}

/* Make invisible pages transparent but keep height for scroll detection */
.invisible-page {
  opacity: 0 !important;
  pointer-events: none !important;
  /* Keep height for scroll detection but make content invisible */
  background: transparent !important;
}

.invisible-page .content-card {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* page column */
.content-card {
  max-width: 760px;
  text-align: center;
}

.content-card h2 {
  font-size: 2.6rem;
  font-weight: 300;
  margin: 0 0 0.75rem 0;
  color: white;
  text-shadow: 0 6px 20px rgba(0,0,0,0.45);
}

.content-card p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
  line-height: 1.6;
  font-weight: 300;
}

/* top title inside sticky area */
.main-title {
  position: absolute;
  top: 110px; /* much more space from navbar */
  left: 50%;
  transform: translateX(-50%);
  color: #e3d4ad !important;
  font-size: 3.6rem;
  font-weight: 300;
  opacity: 1;
  text-shadow: 0 6px 20px rgba(0,0,0,0.45);
  z-index: 50;
}

/* scroll indicator */
.scroll-indicator {
  position: absolute;
  top: 250px; /* more space below the main title */
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
  opacity: 0.9;
  z-index: 50;
  pointer-events: none;
}

/* progress bar across top (JS controls width) */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #00ff88, #00cc66);
  z-index: 9999;
  transition: width 120ms linear;
}

/* responsive */
@media (max-width: 800px) {
  .main-title { 
    font-size: 2.2rem; 
    top: 12%; 
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 0 20px;
    box-sizing: border-box;
  }
  .bubble { 
    max-width: 300px; 
    padding: 12px; 
    font-size: 0.35rem;
  }
  .molecule-layer { 
    width: 320px; 
    height: 320px; 
  }
  .scroll-indicator {
    font-size: 0.75rem;
    top: 200px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 0 20px;
    box-sizing: border-box;
  }
  .content-card h2 {
    font-size: 2.2rem;
    padding: 0 20px;
  }
  .content-card p {
    font-size: 1rem;
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .main-title { 
    font-size: 1.8rem; 
    top: 10%; 
    padding: 0 15px;
  }
  .scroll-indicator {
    font-size: 0.7rem;
    top: 180px;
    padding: 0 15px;
  }
  .content-card h2 {
    font-size: 1.8rem;
    padding: 0 15px;
  }
  .content-card p {
    font-size: 0.9rem;
    padding: 0 15px;
  }
  .molecule-container {
    width: 60vmin;
    height: 60vmin;
  }
  .molecule-layer {
    width: 280px;
    height: 280px;
  }
}

