@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg-body: #f6f7fb;
  --text-main: #101828;
  --text-muted: #475467;
  --text-heading: #1d2939;
  --card-bg: linear-gradient(140deg, rgba(255, 255, 255, 0.9), rgba(250, 250, 255, 0.65));
  --card-border: rgba(99, 102, 241, 0.16);
  --card-shadow: rgba(15, 23, 42, 0.08);
  --card-shadow-hover: rgba(79, 70, 229, 0.18);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-text: #1f2937;
  --nav-text-hover: #4f46e5;
  --dropdown-bg: #ffffff;
  --modal-bg: rgba(15, 23, 42, 0.85);
  --modal-content-bg: #ffffff;
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont,
    'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-body: #0f172a;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-heading: #f8fafc;
  --card-bg: linear-gradient(140deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.8));
  --card-border: rgba(99, 102, 241, 0.4);
  --card-shadow: rgba(0, 0, 0, 0.4);
  --card-shadow-hover: rgba(99, 102, 241, 0.5);
  --nav-bg: rgba(15, 23, 42, 0.85);
  --nav-text: #e2e8f0;
  --nav-text-hover: #818cf8;
  --dropdown-bg: #1e293b;
  --modal-bg: rgba(0, 0, 0, 0.9);
  --modal-content-bg: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.app {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding-top: 5rem; /* Room for navbar */
  padding-bottom: 4rem;
}

/* NAVBAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--nav-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.nav-link:hover {
  color: var(--nav-text-hover);
}

/* Dropdown */
.nav-item-dropdown {
  position: relative;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--dropdown-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 15px 35px var(--card-shadow);
  border-radius: 12px;
  padding: 0.5rem 0;
  list-style: none;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1001;
}

.nav-item-dropdown:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown li a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--nav-text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-dropdown li a:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--nav-text-hover);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--nav-text);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  padding: 0.5rem;
  border-radius: 50%;
}
.theme-toggle:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--nav-text-hover);
}

/* MOBILE NAV (Basic) */
@media (max-width: 900px) {
  .nav-links { display: none; }
  /* In a real scenario we would add a hamburger menu */
}

/* BACKGROUNDS */
.background-blur {
  position: fixed;
  inset: -25% -25% -10% -25%;
  background: radial-gradient(115% 120% at 50% 10%, rgba(255, 255, 255, 0.92), rgba(218, 231, 255, 0.95));
  filter: blur(40px);
  z-index: -5;
}
[data-theme="dark"] .background-blur {
  background: radial-gradient(115% 120% at 50% 10%, rgba(15, 23, 42, 0.92), rgba(30, 58, 138, 0.95));
}

.background-gradient {
  position: fixed;
  inset: -15% -25% auto -25%;
  height: 160vh;
  background:
    radial-gradient(65% 65% at 18% 22%, rgba(99, 102, 241, 0.25), transparent 70%),
    radial-gradient(55% 55% at 82% 18%, rgba(56, 189, 248, 0.25), transparent 75%),
    radial-gradient(80% 80% at 50% 90%, rgba(249, 168, 212, 0.25), transparent 80%);
  opacity: 0.9;
  animation: glowDrift 30s linear infinite, glowPulse 18s ease-in-out infinite;
  z-index: -4;
}

.background-aurora {
  position: fixed;
  inset: -30% -25% -15% -25%;
  background:
    radial-gradient(42% 60% at 18% 22%, rgba(129, 140, 248, 0.32), transparent 70%),
    radial-gradient(38% 55% at 78% 32%, rgba(45, 212, 191, 0.26), transparent 75%),
    radial-gradient(48% 62% at 48% 80%, rgba(147, 197, 253, 0.26), transparent 80%);
  mix-blend-mode: multiply;
  opacity: 0.65;
  filter: saturate(1.05);
  animation: auroraDrift 24s ease-in-out infinite alternate;
  will-change: transform, filter, opacity;
  z-index: -3;
}
[data-theme="dark"] .background-aurora { mix-blend-mode: color-dodge; opacity: 0.3; }

.background-grid {
  position: fixed;
  inset: -10% -10% -10% -10%;
  background-image: linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 0),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 0);
  background-size: 140px 140px;
  mix-blend-mode: multiply;
  opacity: 0.3;
  animation: gridDrift 28s linear infinite;
  z-index: -2;
}
[data-theme="dark"] .background-grid { background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 0); mix-blend-mode: normal; }

.background-spotlight {
  position: fixed;
  inset: -20% -15% -15% -20%;
  background:
    radial-gradient(38% 48% at 18% 32%, rgba(59, 130, 246, 0.28), transparent 72%),
    radial-gradient(45% 55% at 78% 22%, rgba(196, 181, 253, 0.22), transparent 75%),
    radial-gradient(55% 65% at 58% 78%, rgba(14, 165, 233, 0.25), transparent 78%);
  filter: blur(28px) saturate(1.08);
  opacity: 0.65;
  animation: spotlightDrift 26s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes glowDrift {
  0% { transform: translate3d(0, 0, 0) scale(1.04); }
  50% { transform: translate3d(-3%, -2%, 0) scale(1.07); }
  100% { transform: translate3d(0, 0, 0) scale(1.04); }
}

@keyframes glowPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes auroraDrift {
  0% { transform: translate3d(-2%, 1%, 0) scale(1.02); filter: hue-rotate(-6deg) saturate(1.03); opacity: 0.58; }
  50% { transform: translate3d(3%, -2%, 0) scale(1.07); filter: hue-rotate(8deg) saturate(1.12); opacity: 0.8; }
  100% { transform: translate3d(-1%, 2%, 0) scale(1.04); filter: hue-rotate(-4deg) saturate(1.05); opacity: 0.62; }
}

@keyframes gridDrift {
  0% { background-position: 0 0, 0 0; }
  50% { background-position: 70px 55px, 40px 80px; }
  100% { background-position: 0 0, 0 0; }
}

@keyframes spotlightDrift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1.02); filter: blur(28px) saturate(1.05) hue-rotate(-4deg); opacity: 0.58; }
  50% { transform: translate3d(3%, 2%, 0) scale(1.06); filter: blur(24px) saturate(1.16) hue-rotate(6deg); opacity: 0.74; }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.03); filter: blur(28px) saturate(1.08) hue-rotate(-2deg); opacity: 0.62; }
}

.hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 6rem 2rem 3.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-logos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.hero-logos .hero-logo {
  width: min(420px, 80vw);
  filter: drop-shadow(0 25px 55px rgba(79, 70, 229, 0.18));
}
[data-theme="dark"] .hero-logos .hero-logo { filter: drop-shadow(0 25px 55px rgba(255, 255, 255, 0.1)); }

.hero-logos .hero-gif {
  width: min(420px, 80vw);
  border: none;
  border-radius: 0;
  box-shadow: none;
  filter: none;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw + 1rem, 4.1rem);
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.hero p {
  margin: 0;
  max-width: 720px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Feature Tool */
.featured-tool {
  max-width: 1100px;
  margin: 2rem auto 4rem;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.tool-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 32px;
  padding: 3rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: center;
  color: white;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.tool-content h2 { font-size: 2.5rem; margin: 0 0 1rem; letter-spacing: -0.03em; line-height: 1.1; color: #fff;}
.tool-content p { color: #94a3b8; font-size: 1.05rem; margin-bottom: 2rem; }

.tool-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.tool-image {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-primary {
  display: inline-block;
  background: #3b82f6;
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 16px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 35px rgba(59, 130, 246, 0.5); background: #2563eb; }

/* Grid items */
.simulator-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  padding: 0 2rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

@media (min-width: 960px) {
  .simulator-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
}

.simulator-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem;
  background: var(--card-bg);
  border-radius: 24px;
  border: 1px solid var(--card-border);
  box-shadow: 0 30px 60px var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.simulator-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 40px 70px var(--card-shadow-hover);
}

.simulator-preview {
  overflow: hidden;
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.1);
  background: rgba(248, 250, 255, 0.9);
}
[data-theme="dark"] .simulator-preview { background: rgba(30, 41, 59, 0.9); }

.simulator-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.preview-logo {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  width: 56px;
  max-width: 28%;
  filter: drop-shadow(0 10px 25px rgba(15, 23, 42, 0.18));
  opacity: 0.9;
}

.simulator-card h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--text-heading);
}

.simulator-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.creator-note {
  margin: 0.35rem 0 0;
  font-weight: 600;
  font-size: 0.8rem;
}

.collaborators {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.simulator-link {
  margin-top: auto;
  align-self: flex-start;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #6366f1, #0ea5e9);
  color: #ffffff;
  box-shadow: 0 15px 35px rgba(79, 70, 229, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.simulator-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 45px rgba(14, 165, 233, 0.28);
}

/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-bg);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-container {
  width: 95%;
  height: 90vh;
  background: var(--modal-content-bg);
  border-radius: 24px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-container {
  transform: scale(1);
}
.modal-header {
  padding: 1rem 1.5rem;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-heading);
  margin: 0;
}
.modal-close {
  background: var(--card-border);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  font-size: 1.2rem;
  transition: background 0.2s, color 0.2s;
}
.modal-close:hover {
  background: #ef4444;
  color: #fff;
}
.modal-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
}

.insight-section {
  max-width: 960px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
  display: grid;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.insight-card {
  background: var(--card-bg);
  border-radius: 28px;
  padding: 2.5rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 35px 70px var(--card-shadow);
}

.insight-card h3 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  color: var(--text-heading);
}

.insight-card p {
  margin: 0;
  color: var(--text-muted);
}

.footer {
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  max-width: 960px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--text-muted);
}

.footer img {
  width: min(100px, 22.5vw);
  margin: 1.5rem auto 0;
  filter: drop-shadow(0 12px 35px rgba(79, 70, 229, 0.18));
}

@media (max-width: 900px) {
  .tool-banner { grid-template-columns: 1fr; text-align: center; padding: 2rem; }
  .tool-image { order: -1; }
  .hero { padding-top: 4.5rem; }
  .insight-card { padding: 2rem; }
}

/* AUTH MODAL STYLES */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-bg);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.auth-container {
  width: min(400px, 90vw);
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 2.5rem;
  box-shadow: 0 40px 80px var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}
.auth-overlay.active .auth-container {
  transform: translateY(0) scale(1);
}
.auth-header img {
  width: 80px;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.2));
}
.auth-container h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}
.auth-container p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}
.auth-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.auth-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-heading);
  padding-left: 0.2rem;
}
.auth-form input {
  padding: 0.85rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
[data-theme="dark"] .auth-form input {
  background: rgba(15, 23, 42, 0.4);
}
.auth-form input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  background: rgba(255, 255, 255, 0.8);
}
[data-theme="dark"] .auth-form input:focus {
  background: rgba(15, 23, 42, 0.6);
}
.auth-submit {
  margin-top: 0.5rem;
  padding: 1rem;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
  transition: all 0.3s ease;
}
.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(79, 70, 229, 0.35);
  filter: brightness(1.1);
}
.auth-submit:active {
  transform: translateY(0);
}
.auth-error {
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.5rem;
  min-height: 1.2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.auth-error.visible {
  opacity: 1;
}
.auth-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}
.auth-close:hover {
  color: #ef4444;
}
