:root {
  --bg: #ffffff; /* Pure white background */
  --snow: #f4f4f4;
  --surface: #ffffff;
  --text: #1a1a1a;
  --sub: #757575;
  --accent: #111111;
  --border: rgba(0, 0, 0, 0.05);
  --radius: 32px;
  --max-w: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

body {
  font-family:
    "Poppins",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-osx-font-smoothing: grayscale;
}

.main-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 10000;
  background: #ffffff;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.logo-group {
  display: flex;
  align-items: center;
  height: 44px;
}

.header-logo-icon {
  height: 28px;
  width: auto;
  cursor: pointer;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 44px;
}

.header-left {
  justify-content: flex-start;
  margin-right: 8px;
  height: 44px;
}

#headerBackBtn:not(.hidden) {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

#mainLogo.hidden {
  display: none !important;
}

.header-right {
  justify-content: flex-end;
  margin-left: 8px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  max-width: 600px;
  min-width: 0;
}

.header-center .input-container {
  width: 100%;
  max-width: 500px;
  height: 40px;
  background: #eeeeee; /* Gray pill like Mobbin search */
  border-radius: 100px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  border: none;
  transition: all 0.2s ease;
}

.header-center .input-container:focus-within {
  background: #e5e5e5;
}

.step-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: 8px;
}

.step-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 400;
  color: #1a1a1a;
  opacity: 0.3;
  transition: all 0.3s cubic-bezier(0.2, 1, 0.2, 1);
  white-space: nowrap;
  line-height: 1;
}

.step-pill.active {
  opacity: 1;
  transform: scale(1.05);
}

.step-pill.large {
  padding: 8px 20px;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.step-num {
  font-size: 0.9rem;
  font-weight: 400;
  margin-right: 4px;
}

.category-header-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-left: 0.5rem;
  padding-right: 1.5rem;
  min-width: 0;
}

.category-header-pill .step-pill {
  display: inline-flex !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}

.mode-toggle-pill {
  margin-left: auto;
  cursor: pointer;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  border: none;
  flex-shrink: 0;
  white-space: nowrap;
}

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

@media (max-width: 600px) {
  .step-pill {
    padding: 6px 10px;
    font-size: 1rem;
  }
}

.search-icon {
  font-size: 1.1rem;
  color: #000;
  margin-right: 10px;
  font-weight: 600;
}

.header-center input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  padding: 0;
}

.header-actions {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 1, 0.2, 1);
  border: none;
  color: #000;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.app-container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  min-height: 100vh;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6rem 1.5rem 50vh; /* Large bottom padding for middle-scrolling */
}

@media (max-width: 768px) {
  .main-header {
    padding: 0.75rem 0.5rem;
  }
  .header-center {
    padding: 0 4px;
  }
  .header-center .input-container {
    padding: 0 12px;
  }
  .search-icon {
    margin-right: 6px;
  }
  .container {
    padding: 5rem 1rem 50vh; /* Large bottom padding for middle-scrolling */
  }
  .main-content-box {
    border-radius: 32px;
    background: var(--bg);
  }
}

#mainScreen,
#thinkingScreen,
#cardsScreen,
#galleryScreen,
#feedbackScreen {
  display: none;
}

#mainScreen.visible,
#thinkingScreen.visible,
#cardsScreen.visible,
#galleryScreen.visible,
#feedbackScreen.visible {
  display: block;
}

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded' !important;
  font-variation-settings:
    "FILL" 0,
    "wght" 200,
    "GRAD" 0,
    "opsz" 24;
}

/* Helpers */
.hidden {
  display: none !important;
}

.main-content-box {
  background: var(--snow);
  border-radius: 48px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.04);
  border: none;
  overflow: visible;
  position: relative;
  min-height: auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .search-icon {
    display: none;
  }
  .header-center .input-container {
    padding: 0 15px;
  }
  .header-logo-icon {
    height: 28px;
  }
  .header-left,
  .header-right {
    min-width: 36px;
  }
}

/* Footer */
.app-footer {
  width: 100%;
  padding: 4rem 1.5rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.footer-link {
  background: none;
  border: none;
  color: var(--sub);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 1;
}

.footer-note {
  font-size: 0.85rem;
  color: var(--text);
  display: inline-block;
}

/* Feedback Screen */
.feedback-screen {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-w);
  height: 100%;
  background: var(--bg);
  z-index: 6000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6rem 1.5rem 120px;
  overflow-y: auto;
}

.feedback-screen.visible {
  display: flex;
}

.feedback-content-box {
  padding: 4rem 2rem;
  max-width: 600px;
}

.rating-container {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.rating-star {
  background: none;
  border: none;
  cursor: pointer;
  color: #eeeeee;
  transition: all 0.2s cubic-bezier(0.2, 1, 0.2, 1);
}

.rating-star:hover {
  transform: scale(1.2);
}

.rating-container:hover .rating-star {
  color: #ffd700;
  opacity: 0.5;
}

.rating-star:hover ~ .rating-star {
  color: #eeeeee;
  opacity: 1;
}

.rating-container .rating-star:hover {
  opacity: 1;
}

.rating-star .material-symbols-rounded {
  font-size: 2.5rem;
  font-variation-settings:
    "FILL" 0,
    "wght" 200;
  pointer-events: none;
}

.rating-star.active {
  color: #ffd700;
  opacity: 1 !important;
}

.rating-star.active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 200 !important;
}
}

.feedback-input-container {
  width: 100%;
  position: relative;
}

#feedbackText {
  width: 100%;
  min-height: 150px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 20px;
  padding: 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  color: var(--text);
}

.word-count {
  font-size: 0.8rem;
  color: var(--sub);
  text-align: right;
  margin-top: 0.5rem;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 40px !important; /* Force bottom position */
  top: auto !important;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #000000;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.5s cubic-bezier(0.2, 1, 0.2, 1) forwards;
  pointer-events: auto;
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

.toast.fade-out {
  animation: toastOut 0.5s cubic-bezier(0.2, 1, 0.2, 1) forwards;
}

.lang-bubble span, 
.lang-pick-btn,
.bubble span,
.small-pill span {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  line-height: 1;
}

.bubble, .small-pill, .lang-pick-btn, .step-pill {
  display: flex;
  align-items: center;
  justify-content: center;
}

.faded {
  opacity: 0.3;
}

.global-subtitle {
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--sub);
  font-weight: 400;
  letter-spacing: 1px;
}

/* Global Pill Styles */
.bubble-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  width: 100%;
}

.small-pill {
  padding: 0.7rem 1.2rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.small-pill:hover {
  background: #f8f8f8;
  border-color: rgba(0, 0, 0, 0.1);
}

.small-pill.active {
  background: #000;
  color: #fff;
  border-color: #000;
}
.lang-pick-btn {
  background: #ffffff;
  color: var(--text);
  padding: 1rem 2rem;
  border-radius: 100px;
  font-weight: 400;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  white-space: nowrap;
}

.lang-pick-btn:hover {
  background: var(--text);
  color: #fff;
  transform: scale(1.05);
}

.lang-pick-btn.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

@media (max-width: 768px) {
  .lang-pick-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }
}
