:root {
  /* Modern Palette */
  --bg-dark: #09090b;
  --bg-card: #18181b;
  --primary: #6366f1; /* Indigo */
  --primary-glow: #4f46e5;
  --accent: #ec4899; /* Pink/Magenta for contrast */
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --border: #27272a;

  --glass-bg: rgba(24, 24, 27, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --radius: 16px;
}

/* GLOBAL RESET & SAFETY NET */
* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;       /* Force width to never exceed viewport */
  overflow-x: hidden;     /* Cut off anything sticking out */
  position: relative;     /* Anchors the hidden overflow */
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

/* Background Glow Effects */
.glow {
  position: absolute;
  width: 600px;
  height: 600px;
  max-width: 100%;        /* ADD THIS: Ensures glow doesn't push width */
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.2;
  pointer-events: none;
}

.glow-1 {
  top: -100px;
  left: -100px;
  background: var(--primary);
}

.glow-2 {
  top: 40%;
  right: -200px;
  background: var(--accent);
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Safari support */
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 40px;
  width: auto;
}

.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.brand-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--border);
}

/* Layout */
.app-container {
  max-width: 900px;
  margin: 60px auto;
  padding: 0 20px;
  text-align: center;
}

/* Typography */
h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
}

.gradient-text {
  background: linear-gradient(135deg, #818cf8, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 50px;
}

.highlight {
  color: var(--text-main);
  font-weight: 600;
}

.badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Glass Panel Card */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 100%; /* Ensures it doesn't overflow container */
}

/* Drag & Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden; /* Contains content */
}

.drop-zone:hover,
.drop-zone.drag-active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.drop-content {
  pointer-events: none;
}

.icon-upload {
  font-size: 3rem;
  margin-bottom: 10px;
}

input[type="file"] {
  display: none;
}

/* Settings Bar */
.settings-bar {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.setting-group {
  flex: 1;
  text-align: left;
  min-width: 150px;
}

.setting-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  background: #27272a;
  border: 1px solid #3f3f46;
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}

.input-wrapper .unit {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
  flex: 2;
  background: linear-gradient(135deg, var(--primary), var(--primary-glow));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 200px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px var(--primary);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: wait;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 8px;
  width: 100%;
  margin-top: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-secondary:disabled {
  display: none;
}

/* Progress Bar */
.progress-area {
  margin-top: 24px;
  text-align: left;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: #27272a;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

#status {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Results */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.result {
  background: #27272a;
  padding: 12px;
  border-radius: 12px;
  animation: fadeIn 0.5s ease;
}

.result img {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #000;
}

.result-header {
  font-size: 0.85rem;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.result a {
  display: block;
  margin-top: 10px;
  background: #3f3f46;
  color: white;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
}

/* SEO Content Sections */
.content-section {
  max-width: 1000px;
  margin: 100px auto;
  padding: 0 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.feature-card {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 16px;
  border: 1px solid var(--border);
  text-align: left;
}

.feature-card h3 {
  margin-top: 0;
  color: var(--text-main);
}

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

.seo-text-block {
  max-width: 800px;
  margin: 60px auto;
  text-align: left;
  color: var(--text-muted);
  padding: 0 20px; /* Kept parent padding */
}

.seo-text-block h2 {
  color: var(--text-main);
  margin-top: 60px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  /* Removed side padding to align with text */
}

.steps-list li,
.faq-item p {
  margin-bottom: 16px;
  /* Removed side padding to prevent text from being pushed in too far */
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 60px 0;
  text-align: center;
  color: var(--text-muted);
  margin-top: 80px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 10px;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  h1 {
    font-size: 2.2rem;
  }

  /* --- FIX STARTS HERE --- */
  /* This stacks the Logo and Button vertically so they don't push the screen width out */
  .navbar {
    flex-direction: column;
    gap: 15px;
    padding: 15px 20px;
    width: 100%;             /* Ensure it doesn't stretch */
    box-sizing: border-box;  /* Includes padding in width calculation */
  }
  
  /* Makes the 'Shop 3D Prints' button full width on mobile */
  .nav-link {
    width: 100%;
    text-align: center;
    justify-content: center;
    display: block;
  }
  
  /* Ensures the brand/logo area fits within the screen */
  .brand {
    width: 100%;
    justify-content: center; /* Optional: centers the logo */
  }
  /* --- FIX ENDS HERE --- */

  .settings-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .glass-panel {
    padding: 20px;
  }
  
  .btn-primary {
    width: 100%;
  }
}