@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Outfit:wght@250;300;400;500;600;750&display=swap');

/* --- Modern Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #ffffff; /* Default text color is white for contrast against the rich blue gradient */
  background: linear-gradient(180deg, #1b62f3 0%, #3a7fff 50%, #7bc9ff 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* --- CSS Variables & Color Tokens --- */
:root {
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.85);
  --text-tertiary: rgba(255, 255, 255, 0.6);
  
  /* Glassmorphism settings for input */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 10px 40px rgba(10, 30, 90, 0.15);
  --glass-glow: 0 0 25px rgba(255, 255, 255, 0.35);
  
  /* Floating cards styling (crisp white widgets) */
  --card-bg: #ffffff;
  --card-shadow: 0 12px 36px rgba(10, 30, 90, 0.1);
  --card-border: 1px solid rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-speed: 0.35s;
}

/* --- App Container --- */
.app-container {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  padding: 40px;
  box-sizing: border-box;
  z-index: 2;
}

/* Shifting animated colorful blurs on top of the blue gradient */
.mesh-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background-color: transparent; /* Let the body gradient show through */
  filter: blur(80px);
  will-change: transform;
}

.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.45; /* Increased opacity for visibility */
  will-change: transform;
}

.blob-1 {
  top: -15%;
  left: -5%;
  width: 55vw;
  height: 55vw;
  background-color: #8b5cf6; /* Royal purple */
  animation: drift-slow 28s infinite alternate ease-in-out;
}

.blob-2 {
  top: 15%;
  right: -10%;
  width: 48vw;
  height: 48vw;
  background-color: #06b6d4; /* Neon cyan */
  animation: drift-medium 22s infinite alternate ease-in-out;
}

.blob-3 {
  bottom: -10%;
  left: 15%;
  width: 50vw;
  height: 50vw;
  background-color: #ec4899; /* Deep pink/rose */
  animation: drift-fast 18s infinite alternate ease-in-out;
}

.blob-4 {
  top: 10%;
  left: 30%;
  width: 40vw;
  height: 40vw;
  background-color: #6366f1; /* Indigo */
  animation: drift-slow 32s infinite alternate ease-in-out;
}

@keyframes drift-slow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, 4vh) scale(1.06); }
  100% { transform: translate(-3vw, 8vh) scale(0.94); }
}

@keyframes drift-medium {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-5vw, -6vh) scale(0.96); }
  100% { transform: translate(4vw, 4vh) scale(1.04); }
}

@keyframes drift-fast {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vw, -6vh) scale(1.08); }
  100% { transform: translate(-6vw, 3vh) scale(0.92); }
}

@media (prefers-reduced-motion: reduce) {
  .blob {
    animation: none !important;
  }
}

/* --- Branding Logo --- */
header {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 10;
}

.logo-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity var(--transition-speed) var(--ease-premium);
  user-select: none;
}

.logo-container:hover {
  opacity: 0.8;
}

.logo-svg {
  width: 30px;
  height: 30px;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(10, 30, 90, 0.1));
}

.logo-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 2.1rem; /* Serifs look slightly smaller, so 2.1rem matches a 30px icon perfectly */
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-transform: lowercase;
  transform: translateY(-3px); /* Corrects baseline offset for lowercase italic text, aligning it with the center of the icon */
}

/* --- Centered Main Content Area --- */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-bottom: 12vh;
  z-index: 4;
}

/* --- Hero Section --- */
.hero-content {
  margin-bottom: 32px;
  max-width: 760px;
  animation: fade-in-up var(--transition-speed) var(--ease-premium) forwards;
}

.hero-title {
  font-size: clamp(2.4rem, 4.8vw, 4.4rem);
  font-weight: 250;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
  color: var(--text-primary);
  text-shadow: 0 2px 10px rgba(10, 30, 90, 0.08);
}

.hero-title span {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -0.01em;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
  text-shadow: 0 1px 6px rgba(10, 30, 90, 0.08);
}

/* --- Glassmorphic Command Bar --- */
.search-form-container {
  width: 100%;
  max-width: 640px;
  position: relative;
  margin-bottom: 24px;
  animation: fade-in-up 0.4s var(--ease-premium) 0.1s forwards;
}

.search-bar {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border-radius: 9999px;
  padding: 8px 10px 8px 24px;
  transition: border-color var(--transition-speed) var(--ease-premium),
              box-shadow var(--transition-speed) var(--ease-premium),
              background var(--transition-speed) var(--ease-premium);
}

.search-bar:focus-within {
  border-color: rgba(255, 255, 255, 1);
  box-shadow: var(--glass-shadow), var(--glass-glow);
  background: #ffffff;
}

.search-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(10, 15, 30, 0.4); /* Dark color for readability inside the white bar */
  margin-right: 12px;
}

.search-input {
  flex-grow: 1;
  width: 100%;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  height: 46px;
  color: #0f172a; /* Dark text inside input */
}

.search-input::placeholder {
  color: rgba(10, 15, 30, 0.4);
}

/* Form Controls (Attachment & Submit) */
.form-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition-speed) var(--ease-premium),
              transform var(--transition-speed) var(--ease-premium),
              color var(--transition-speed) var(--ease-premium);
  color: rgba(10, 15, 30, 0.6);
}

.control-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #000000;
}

.control-btn:active {
  transform: scale(0.95);
}

.btn-submit {
  background: #0f172a; /* Dark submit button inside light input */
  color: #ffffff;
}

.btn-submit:hover {
  background: #222222;
  color: #ffffff;
}

.btn-submit:disabled {
  background: rgba(10, 15, 30, 0.25);
  cursor: not-allowed;
  transform: none;
}

/* Image Preview inside Search Box */
.image-preview-container {
  display: none;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 4px 10px 4px 6px;
  margin-right: 12px;
  gap: 6px;
  max-width: 170px;
}

.preview-thumbnail {
  width: 26px;
  height: 26px;
  border-radius: 13px;
  object-fit: cover;
  background: #eaeaea;
}

.preview-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-remove-image {
  cursor: pointer;
  color: rgba(10, 15, 30, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-image:hover {
  color: #ef4444;
}

/* Image input mode style override (transforms capsule to a multi-line input box with top thumbnail card) */
.search-bar.has-image {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  border-radius: 24px;
  padding: 16px 16px 12px 20px;
}

.search-bar.has-image .search-icon-wrapper {
  display: none;
}

.search-bar.has-image .image-preview-container {
  display: flex !important;
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 0 12px 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 8px;
  grid-column: 1 / -1;
  grid-row: 1;
}

.search-bar.has-image .preview-thumbnail {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.search-bar.has-image .preview-name {
  display: none !important;
}

.search-bar.has-image .btn-remove-image {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
  transition: background var(--transition-speed);
}

.search-bar.has-image .btn-remove-image:hover {
  background: #ef4444;
}

.search-bar.has-image .btn-remove-image svg {
  width: 10px;
  height: 10px;
  stroke: #ffffff;
}

.search-bar.has-image .search-input {
  grid-column: 1;
  grid-row: 2;
  height: 42px;
  align-self: center;
}

.search-bar.has-image .form-controls {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
}

#image-upload-input {
  display: none;
}

/* --- Glassmorphic Use-case Pills --- */
.usecase-container {
  display: flex;
  gap: 12px;
  justify-content: center;
  animation: fade-in-up 0.4s var(--ease-premium) 0.2s forwards;
}

.usecase-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #ffffff;
  cursor: pointer;
  transition: all var(--transition-speed) var(--ease-premium);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-shadow: 0 1px 2px rgba(10, 30, 90, 0.1);
  box-shadow: 0 4px 15px rgba(10, 30, 90, 0.02);
}

.usecase-pill:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1.5px);
}

.usecase-pill:active {
  transform: translateY(0);
}

.status-message {
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 10px;
  min-height: 18px;
  color: #ffe4e6; /* Light rose color for errors in blue background */
}

/* --- Subtle Wave Bottom Stage (Centered Footer) --- */
.bottom-stage {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20vh;
  z-index: 3;
  pointer-events: none;
}

.curve-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  fill: #ffffff;
  filter: drop-shadow(0 -12px 24px rgba(10, 25, 75, 0.02));
}

.bottom-stage-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 14vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  padding: 0 40px 10px;
  pointer-events: auto;
  box-sizing: border-box;
}

.starter-prompts-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(10, 15, 30, 0.35); /* Dark tertiary for contrast inside the white area */
  margin-bottom: 12px;
}

.starter-prompts-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.starter-prompt {
  font-size: 0.86rem;
  font-weight: 500;
  color: #334155; /* Slate 700 */
  background: #f1f5f9; /* Slate 100 */
  border: var(--card-border);
  padding: 8px 16px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--transition-speed) var(--ease-premium);
}

.starter-prompt:hover {
  background: #e2e8f0; /* Slate 200 */
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* --- Floating Visual Cards (Vibe layer, hides on mobile/tablet) --- */
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5;
  pointer-events: none;
}

.floating-card {
  position: absolute;
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  transition: transform var(--transition-speed) var(--ease-premium);
  color: #0f172a; /* Dark text inside white cards */
}

.floating-card:hover {
  transform: scale(1.03);
}

/* Widget 1: Out of Stock Card (Left side) */
.widget-brief {
  left: 7%;
  top: 36%;
  animation: float-1 8s infinite alternate ease-in-out;
}

.widget-icon-bg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-size: 1.1rem;
}

.widget-brief-text p {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f172a;
}

.widget-brief-text span {
  font-size: 0.72rem;
  font-weight: 500;
  color: #ef4444;
}

/* Widget 2: Match Percentage Badge (Right side, upper) */
.widget-match {
  right: 9%;
  top: 24%;
  animation: float-2 9s infinite alternate ease-in-out;
}

.widget-match-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.10);
  color: #10b981;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 650;
}

.widget-match p {
  font-size: 0.82rem;
  font-weight: 500;
  color: #0f172a;
}

/* Widget 3: Comparison report widget (Right side, lower) */
.widget-compare {
  right: 8%;
  bottom: 16%;
  flex-direction: column;
  align-items: flex-start;
  width: 210px;
  gap: 8px;
  animation: float-3 7s infinite alternate ease-in-out;
}

.widget-compare-title {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8; /* Slate 400 */
  margin-bottom: 2px;
}

.widget-compare-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.widget-compare-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1b62f3;
}

.widget-compare-item span {
  font-size: 0.8rem;
  font-weight: 500;
  color: #475569; /* Slate 600 */
}

.widget-compare-item.highlight span {
  font-weight: 600;
  color: #1b62f3;
}

/* --- Floating Keyframe Animations --- */
@keyframes float-1 {
  0% { transform: translateY(0px) rotate(-1.5deg); }
  100% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes float-2 {
  0% { transform: translateY(0px) rotate(1deg); }
  100% { transform: translateY(-12px) rotate(-1deg); }
}

@keyframes float-3 {
  0% { transform: translateY(0px) rotate(0.5deg); }
  100% { transform: translateY(-8px) rotate(-0.5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .floating-card {
    animation: none !important;
  }
}

/* --- General Animations --- */
@keyframes fade-in-up {
  0% {
    opacity: 1;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Responsive Media Queries --- */
@media (max-height: 750px) {
  .main-content {
    padding-bottom: 10vh;
  }
  .bottom-stage {
    height: 18vh;
  }
  .bottom-stage-content {
    height: 12vh;
  }
  .starter-prompts-label {
    margin-bottom: 6px;
  }
}

@media (max-width: 1120px) {
  .floating-elements {
    display: none;
  }
}

@media (max-width: 800px) {
  .app-container {
    padding: 24px;
  }
  .bottom-stage {
    height: 22vh;
  }
  .bottom-stage-content {
    height: 15vh;
  }
  .usecase-container {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .usecase-pill {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .bottom-stage {
    height: 26vh;
  }
  .bottom-stage-content {
    height: 18vh;
    padding: 0 16px 12px;
  }
  .search-bar {
    padding: 6px 8px 6px 16px;
  }
  .search-bar.has-image {
    padding: 12px 12px 8px 16px;
  }
  .search-input {
    font-size: 0.95rem;
  }
  .control-btn {
    width: 38px;
    height: 38px;
  }
  .starter-prompts-list {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .starter-prompt {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }
}
