:root {
  /* Colors */
  --bg-dark: #0f172a;
  --bg-darker: #050505;
  --panel-bg: rgba(30, 41, 59, 0.85);
  --panel-bg-solid: #1e293b;
  --accent: #06b6d4;
  --accent-secondary: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --border-light: rgba(255, 255, 255, 0.1);
  --border-lighter: rgba(255, 255, 255, 0.05);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.7) 100%);
  
  /* Typography */
  --font-main: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'Inter', system-ui, monospace;
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-round: 50%;
  
  /* Effects */
  --backdrop-heavy: blur(16px);
  --backdrop-md: blur(12px);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.5);
  --shadow-lg: 0 30px 60px rgba(0,0,0,0.6);
  --shadow-glow: 0 10px 25px -5px rgba(6, 182, 212, 0.4), 0 8px 10px -6px rgba(6, 182, 212, 0.1);
  --shadow-glow-hover: 0 20px 35px -5px rgba(6, 182, 212, 0.5), 0 10px 15px -6px rgba(6, 182, 212, 0.2);
}

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

body, html {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Landing Page Background */
body {
  background: radial-gradient(circle at 15% 50%, rgba(6, 182, 212, 0.15), transparent 25%),
              radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 25%),
              var(--bg-dark);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Navbar */
.navbar {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: var(--backdrop-heavy);
  -webkit-backdrop-filter: var(--backdrop-heavy);
  border-bottom: 1px solid var(--border-lighter);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 32px;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

/* Hero Section (Two Column Layout) */
.hero {
  padding: 280px 24px 100px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at center, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero h1 {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
  background: linear-gradient(to right, #ffffff 20%, #a5f3fc 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.35rem;
  color: var(--text-muted);
  margin-bottom: 48px;
  line-height: 1.6;
  font-weight: 400;
  max-width: 700px;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  filter: drop-shadow(0 20px 40px rgba(6, 182, 212, 0.3));
  animation: float 6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

/* Call to Action Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent);
  color: #ffffff;
  padding: 16px 40px;
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-light);
  cursor: pointer;
  box-shadow: var(--shadow-glow);
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow-hover);
}

/* Editor Wrapper */
.editor-container-wrapper {
  max-width: 1400px;
  margin: 0 auto 120px;
  padding: 0 24px;
}

.app-container {
  position: relative;
  width: 100%;
  height: 850px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-lighter);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-lighter);
  background: var(--bg-darker);
  transition: all 0.3s ease;
}

.app-container.fullscreen-mode {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
  border: none;
  margin: 0;
  max-width: none;
}

.editor-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: var(--backdrop-md);
  -webkit-backdrop-filter: var(--backdrop-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  text-align: center;
  padding: 40px;
}

.editor-overlay h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: #fff;
  font-weight: 700;
}

.editor-overlay p {
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 1.2rem;
  max-width: 500px;
  line-height: 1.5;
}

.mobile-only {
  display: none;
}

/* Landing Sections */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 24px;
}

h2 {
  font-size: 2.75rem;
  text-align: center;
  margin-bottom: 70px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Cards (Features, Steps) */
.features-grid, .steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.feature-card, .step-card, .faq-item {
  background: var(--gradient-card);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.feature-card::before, .step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover, .step-card:hover {
  transform: translateY(-5px);
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5), 0 0 20px rgba(6, 182, 212, 0.1);
}

.feature-card:hover::before, .step-card:hover::before {
  opacity: 1;
}

.feature-card h3, .step-card h3, .faq-item h4 {
  font-size: 1.35rem;
  color: #fff;
  margin-bottom: 16px;
  font-weight: 600;
}

.feature-card p, .step-card p, .faq-item p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.step-num {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  color: var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.ad-placement {
  background: rgba(15, 23, 42, 0.3);
  border-top: 1px solid var(--border-lighter);
  border-bottom: 1px solid var(--border-lighter);
}

.ad-placeholder {
  height: 120px;
  background: var(--border-lighter);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

.faq-list {
  display: grid;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  padding: 32px;
}

.faq-item h4 {
  font-size: 1.25rem;
}

.footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-lighter);
  text-align: center;
  padding: 60px 0;
}

.footer p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 16px;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Adjustments for existing UI elements inside the container */
.ui-shell, #viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .hero-container {
    flex-direction: column;
    text-align: center;
  }
  .hero-content {
    text-align: center;
  }
  .hero h1, .hero p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
  .nav-links {
    display: none;
  }
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }
  .app-container {
    height: 500px;
  }
}

/* EDITOR SPECIFIC STYLES */
/* Three.js Canvas */
#viewport {
  z-index: 1;
  display: block;
}

/* Floating UI Container */
.ui-shell {
  z-index: 2; /* above canvas */
  pointer-events: none; /* Let clicks pass through to canvas... */
  display: flex;
  padding: 20px;
  gap: 20px;
}

/* Re-enable pointer events for UI elements */
.panel, .top-toolbar, .progress-pill {
  pointer-events: auto;
}

/* Left Parameter Panel */
.left-panel {
  flex: 0 0 300px;
  height: 100%;
  background: var(--panel-bg);
  backdrop-filter: var(--backdrop-md);
  -webkit-backdrop-filter: var(--backdrop-md);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.left-panel h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

.control-group label span {
  margin-bottom: 10px;
}

.control-group label.inline-checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 0px;
}

.control-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.control-group span {
  font-size: 0.75rem;
  color: var(--text-muted);
  align-self: flex-end;
}

.control-group input[type="number"],
.control-group select {
  background: rgba(0,0,0,0.2);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.control-group input[type="number"]:focus,
.control-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
  background: rgba(0,0,0,0.3);
}

.control-group input[type="number"]::-webkit-inner-spin-button,
.control-group input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.7;
  cursor: pointer;
}

/* Custom Checkbox Toggle Switch */
.control-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  background: rgba(0,0,0,0.4);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  outline: none;
  border: 1px solid var(--border-light);
  transition: 0.3s ease;
  flex-shrink: 0;
}

.control-group input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: var(--radius-round);
  transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.control-group input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.control-group input[type="checkbox"]:checked::after {
  left: 18px;
  background: #fff;
}

/* Label headers and info tooltips */
.label-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-round);
  background: rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: bold;
  font-family: monospace;
  font-style: normal;
  cursor: help;
  position: relative;
  transition: all 0.2s;
}

.info-icon:hover {
  background: var(--accent);
  color: #fff;
}

/* Action Group Buttons */
.action-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.panel-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-dark);
  color: var(--text-main);
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.primary-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.danger-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: translateY(-1px);
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #0f172a;
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 400;
  white-space: pre-wrap;
  width: max-content;
  max-width: 200px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  line-height: 1.4;
}

.info-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.control-group select option {
  background: var(--bg-dark);
}

/* Right Area Layout */
.right-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Top Drop Zone */
.top-toolbar {
  background: var(--panel-bg);
  backdrop-filter: var(--backdrop-md);
  -webkit-backdrop-filter: var(--backdrop-md);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  text-align: center;
  align-self: center;
  width: 100%;
  max-width: 600px;
  transition: background 0.2s, border-color 0.2s;
}

.top-toolbar.drag-over {
  background: rgba(6, 182, 212, 0.2);
  border-color: #fff;
}

.file-label {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}
.file-label:hover {
  color: #fff;
}

/* Progress Pill */
.progress-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: var(--backdrop-heavy);
  border: 1px solid var(--accent);
  border-radius: 30px;
  padding: 12px 24px;
  font-weight: 600;
  color: var(--accent);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.2);
  transition: opacity 0.3s;
}

.progress-pill.hidden {
  opacity: 0;
  pointer-events: none;
}
