/* ========================================
   MOLFORGE LANDING PAGE - COMPLETE STYLESHEET
   Variables defined in theme.css
   ======================================== */

/* ========================================
   BASE RESET
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  scroll-behavior: smooth;
  position: relative;
  overflow-x: hidden;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Decorative background orbs */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 30%, var(--glow-orb-1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, var(--glow-orb-2) 0%, transparent 60%);
  z-index: -2;
  animation: gradientShift 15s ease infinite;
  transition: background 0.3s ease;
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Decorative grid lines */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  pointer-events: none;
  transition: background-image 0.3s ease;
}

/* ========================================
   HEADER
   ======================================== */
.header {
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.75rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--card-border);
  transition: all 0.3s ease;
}

.header.scrolled {
  padding: 0.5rem 0;
  background: var(--header-scrolled-bg);
  box-shadow: var(--shadow);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(var(--glow));
}

.logo i {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
  font-size: 1.5rem;
}

.nav-links {
  display: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s;
  position: relative;
  padding: 0.375rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--primary);
}

/* ========================================
   THEME TOGGLE BUTTON
   ======================================== */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--card-bg);
}

/* Icon visibility: show moon in dark, sun in light */
.theme-toggle .fa-moon { display: inline-block; }
.theme-toggle .fa-sun { display: none; }

:root.light-theme .theme-toggle .fa-moon { display: none; }
:root.light-theme .theme-toggle .fa-sun { display: inline-block; }

@media (prefers-color-scheme: light) {
  :root:not(.dark-theme) .theme-toggle .fa-moon { display: none; }
  :root:not(.dark-theme) .theme-toggle .fa-sun { display: inline-block; }
}

/* ========================================
   CTA BUTTON
   ======================================== */
.cta-button {
  background: var(--gradient);
  color: var(--text-on-gradient);
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: var(--cta-glow);
  white-space: nowrap;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.cta-button:hover::before {
  width: 300px;
  height: 300px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--cta-glow-hover);
}

/* ========================================
   HAMBURGER & MOBILE MENU
   ======================================== */
.hamburger {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  color: var(--hamburger-color);
  font-size: 1.5rem;
  padding: 0.5rem;
  background: transparent;
  border: none;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 300px;
  height: 100vh;
  background: var(--mobile-menu-bg);
  backdrop-filter: blur(20px);
  z-index: 1001;
  transition: right 0.3s ease;
  padding: 5rem 2rem 2rem;
  box-shadow: var(--shadow);
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu .nav-link {
  display: block;
  padding: 1rem 0;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--card-border);
}

.mobile-menu .cta-button {
  margin-top: 1.5rem;
  width: 100%;
  text-align: center;
  display: block;
}

.close-menu {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.75rem;
  color: var(--text);
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0.5rem;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  padding: 6rem 0 3rem;
  color: var(--text);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.1;
  background: var(--hero-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 4s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.hero p {
  font-size: 1rem;
  max-width: 100%;
  margin: 0 auto 1.5rem;
  opacity: 0.9;
  line-height: 1.7;
  color: var(--text-light);
  padding: 0 1rem;
}

.hero .cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.hero .cta-buttons .cta-button {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  flex: 1 1 auto;
  min-width: 140px;
}

.hero .cta-buttons .cta-button:nth-child(2) {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.hero .cta-buttons .cta-button:nth-child(2):hover {
  background: var(--card-bg);
  box-shadow: var(--glow);
}

/* ========================================
   3D VIEWER
   ======================================== */
#mol-viewer-container {
  margin-top: 2rem;
  padding: 0 1rem;
}

#mol-viewer {
  width: 100%;
  max-width: 100%;
  height: 300px;
  margin: 1.5rem auto;
  border: 2px solid var(--accent-border);
  border-radius: 12px;
  box-shadow: var(--shadow), inset 0 0 60px var(--glow-orb-1);
  background: var(--mol-viewer-bg);
  backdrop-filter: blur(10px);
  touch-action: none;
}

#mol-name {
  text-align: center;
  font-size: 1rem;
  color: var(--primary);
  margin-top: 0.75rem;
  font-weight: 600;
  text-shadow: var(--glow);
  padding: 0 1rem;
}

/* ========================================
   SEARCH FORM
   ======================================== */
#mol-test-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  align-items: stretch;
  padding: 0 1rem;
}

#mol-test-form input[type="text"] {
  padding: 0.75rem 1.25rem;
  width: 100%;
  border: 2px solid var(--accent-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.95rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

#mol-test-form input[type="text"]::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

#mol-test-form input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow-orb-1);
  background: var(--input-focus-bg);
}

#mol-test-form button {
  padding: 0.75rem 1.75rem;
  border: none;
  background: var(--gradient);
  color: var(--text-on-gradient);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: var(--cta-glow);
}

#mol-test-form button:hover {
  transform: translateY(-2px);
  box-shadow: var(--cta-glow-hover);
}

/* ========================================
   POPULAR DRUG TAGS
   ======================================== */
.popular-drugs {
  margin-top: 2.5rem;
  text-align: center;
}

.popular-drugs > p {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.popular-drugs .drug-explore-link {
  color: var(--primary);
  text-decoration: none;
}

.popular-drugs .drug-explore-link:hover {
  text-decoration: underline;
}

#hero-drug-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.drug-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  color: var(--text);
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.2s ease;
  background: var(--tag-bg);
}

.drug-tag:hover {
  border-color: var(--primary);
  background: var(--card-bg);
  color: var(--primary);
}

/* ========================================
   FEATURES SECTION
   ======================================== */
.features {
  padding: 4rem 0;
  background: linear-gradient(180deg, var(--background) 0%, var(--surface) 100%);
}

.features .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.features h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.features > .container > p {
  text-align: center;
  max-width: 100%;
  margin: 0.75rem auto 2.5rem;
  font-size: 1rem;
  color: var(--text-light);
  padding: 0 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.feature-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.feature-card:hover::before {
  opacity: var(--card-hover-opacity);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), var(--glow);
  border-color: var(--primary);
}

.feature-card > * {
  position: relative;
  z-index: 1;
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: var(--gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
  box-shadow: var(--cta-glow);
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

.feature-card p {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 0.875rem;
  font-size: 0.95rem;
}

.feature-list {
  list-style: none;
  padding-left: 0;
}

.feature-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.625rem;
  color: var(--text-light);
  line-height: 1.6;
  font-size: 0.9rem;
}

.feature-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
  font-size: 1rem;
}

/* ========================================
   BENEFITS SECTION
   ======================================== */
.benefits {
  padding: 4rem 0;
  background: var(--background);
}

.benefits .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.benefits h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.benefits > .container > p {
  text-align: center;
  max-width: 100%;
  margin: 0.75rem auto 2.5rem;
  font-size: 1rem;
  color: var(--text-light);
  padding: 0 1rem;
}

.benefits-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.benefit-card {
  text-align: center;
  padding: 1.75rem;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.benefit-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.benefit-card:hover::before {
  opacity: var(--card-hover-opacity);
}

.benefit-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow), var(--glow);
  border-color: var(--primary);
}

.benefit-card > * {
  position: relative;
  z-index: 1;
}

.benefit-icon {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.benefit-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.625rem;
  font-weight: 700;
  color: var(--text);
}

.benefit-card p {
  color: var(--text-light);
  line-height: 1.7;
  font-size: 0.9rem;
}

/* ========================================
   CTA SECTION
   ======================================== */
.cta {
  padding: 4rem 0;
  background: var(--cta-section-bg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--cta-pulse) 0%, transparent 70%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.cta .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

.cta h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 800;
  color: var(--text);
}

.cta p {
  font-size: 1rem;
  max-width: 100%;
  margin: 0 auto 1.5rem;
  color: var(--text-light);
  line-height: 1.7;
  padding: 0 1rem;
}

.cta .cta-buttons .cta-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.cta .cta-buttons .cta-outline:hover {
  background: var(--card-bg);
  box-shadow: var(--glow);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  padding: 2rem 0;
  background: var(--footer-bg);
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.footer .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-copy {
  color: var(--text-light);
  font-size: 0.85rem;
}

.footer a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--primary);
}

/* ========================================
   BACK TO TOP
   ======================================== */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  background: var(--gradient);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  border: none;
}

.back-to-top.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: var(--cta-glow-hover);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */
@media (min-width: 576px) {
  body {
    font-size: 15px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

  #mol-viewer {
    height: 400px;
  }

  #mol-test-form {
    flex-direction: row;
    align-items: center;
  }

  #mol-test-form input[type="text"] {
    max-width: 280px;
  }

  #mol-test-form button {
    min-width: auto;
  }

  .features h2,
  .benefits h2,
  .cta h2 {
    font-size: 2.5rem;
  }

  .features > .container > p,
  .benefits > .container > p,
  .cta p {
    font-size: 1.1rem;
  }

  .hero .cta-buttons .cta-button {
    flex: 0 1 auto;
  }
}

@media (min-width: 768px) {
  body {
    font-size: 16px;
  }

  .nav {
    padding: 0 2rem;
  }

  .hamburger {
    display: none;
  }

  .nav-links {
    display: flex;
  }

  .logo {
    font-size: 1.5rem;
  }

  .hero {
    padding: 8rem 0 5rem;
  }

  .hero h1 {
    font-size: 3.5rem;
  }

  .hero p {
    font-size: 1.25rem;
    max-width: 900px;
    padding: 0;
  }

  #mol-viewer {
    max-width: 1000px;
    height: 500px;
  }

  .features,
  .benefits,
  .cta {
    padding: 6rem 0;
  }

  .features-grid,
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .feature-card {
    padding: 2.25rem;
  }

  .benefit-card {
    padding: 2.25rem;
  }
}

@media (min-width: 992px) {
  .hero h1 {
    font-size: 4rem;
  }

  #mol-viewer {
    max-width: 1200px;
    height: 550px;
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .feature-card {
    padding: 2.5rem;
  }

  .benefit-card {
    padding: 2.5rem;
  }

  .back-to-top {
    right: 2rem;
    bottom: 2rem;
    width: 50px;
    height: 50px;
  }
}

@media (min-width: 1200px) {
  .benefits-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #000;
  z-index: 10000;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

@supports (touch-action: pan-y) {
  #mol-viewer {
    touch-action: pan-y;
  }
}

@supports (-webkit-touch-callout: none) {
  #mol-test-form input[type="text"] {
    font-size: 16px !important;
  }
}

/* Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}
