/* ----------------------------------------------------------------
   1. IMPORTS
---------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap');

/* ----------------------------------------------------------------
   2. ROOT VARIABLES
---------------------------------------------------------------- */
:root {
  --bg-dark: #000000;
  --bg-navy: #0C111F;
  --text-gradient-start: #00E5FF;
  --text-gradient-end: #FF8C42;
  --button-gradient-start: #00E5FF;
  --button-gradient-end: #FF8C42;
  --followup-gradient-start: #FF8C42;
  --followup-gradient-end: #FF5E62;
}

/* ----------------------------------------------------------------
   3. GLOBAL BASE ELEMENTS (html, body)
---------------------------------------------------------------- */

/* Keep them flexible, but allow scrolling if content grows
   If you truly want to avoid page scrolling, re-add `overflow-y: hidden;`
   but that can cause the "pinning" effect. */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* No forced overflow here, so the page can scroll if needed */
  overflow-x: hidden;
  /* overflow-y: hidden; // remove or uncomment if you want to block vertical scrolling */
}

body {
  font-family: 'Poppins', sans-serif;
  background: #000000 fixed; /* Pure black background */
  color: #ffffff;
  min-height: 100vh;
  flex: 1;
  position: relative;
  background-attachment: fixed;
}

/* ----------------------------------------------------------------
   4. GLOBAL UTILITY / ANIMATION KEYFRAMES
   (Used throughout the stylesheet, including chat)
---------------------------------------------------------------- */

/* fadeIn & fadeOut, slideUp, glowCycle, gradientShift, etc. */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes glowCycle {
  0% {
    text-shadow: 0px 0px 8px var(--text-gradient-start);
  }
  50% {
    text-shadow: 0px 0px 15px var(--text-gradient-end);
  }
  100% {
    text-shadow: 0px 0px 8px var(--text-gradient-start);
  }
}
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes glow {
  0% {
    filter: drop-shadow(0 0 8px var(--text-gradient-start))
            drop-shadow(0 0 16px var(--text-gradient-start));
  }
  50% {
    filter: drop-shadow(0 0 8px var(--text-gradient-end))
            drop-shadow(0 0 16px var(--text-gradient-end));
  }
  100% {
    filter: drop-shadow(0 0 8px var(--text-gradient-start))
            drop-shadow(0 0 16px var(--text-gradient-start));
  }
}
@keyframes coffeeGlowHover {
  0% {
    filter: drop-shadow(0 0 8px var(--text-gradient-start))
           drop-shadow(0 0 15px var(--text-gradient-start));
    transform: scale(1.1);
  }
  50% {
    filter: drop-shadow(0 0 12px var(--text-gradient-end))
           drop-shadow(0 0 20px var(--text-gradient-end));
    transform: scale(1.1);
  }
  100% {
    filter: drop-shadow(0 0 8px var(--text-gradient-start))
           drop-shadow(0 0 15px var(--text-gradient-start));
    transform: scale(1.1);
  }
}
@keyframes supportGlowHover {
  0% {
    filter: drop-shadow(0 0 8px var(--text-gradient-start))
            drop-shadow(0 0 16px var(--text-gradient-start));
    transform: scale(1.1);
  }
  50% {
    filter: drop-shadow(0 0 8px var(--text-gradient-end))
            drop-shadow(0 0 16px var(--text-gradient-end));
    transform: scale(1.1);
  }
  100% {
    filter: drop-shadow(0 0 8px var(--text-gradient-start))
            drop-shadow(0 0 16px var(--text-gradient-start));
    transform: scale(1.1);
  }
}
@keyframes shineEffect {
  0% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
  100% {
    background-position: 0% center;
  }
}
@keyframes typingAnimation {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}
@keyframes premiumPulse {
  0% {
    opacity: 0.3;
    transform: scale(0.95);
    background: radial-gradient(circle, rgba(0,229,255,0.1) 0%, rgba(255,140,66,0.1) 70%);
  }
  50% {
    opacity: 0.5;
    transform: scale(1);
    background: radial-gradient(circle, rgba(255,140,66,0.1) 0%, rgba(0,229,255,0.1) 70%);
  }
  100% {
    opacity: 0.3;
    transform: scale(0.95);
    background: radial-gradient(circle, rgba(0,229,255,0.1) 0%, rgba(255,140,66,0.1) 70%);
  }
}
@keyframes gradient-cycle {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes newsearch-button-glow {
  0% {
    box-shadow: 0 0 10px var(--button-gradient-start),
                0 0 20px rgba(0,229,255,0.3);
  }
  50% {
    box-shadow: 0 0 15px var(--button-gradient-start),
                0 0 30px rgba(0,229,255,0.5);
  }
  100% {
    box-shadow: 0 0 10px var(--button-gradient-start),
                0 0 20px rgba(0,229,255,0.3);
  }
}
@keyframes followup-input-glow {
  0% {
    box-shadow: 0 0 15px var(--followup-gradient-start),
                0 0 30px rgba(255,140,66,0.3);
  }
  50% {
    box-shadow: 0 0 20px var(--followup-gradient-start),
                0 0 40px rgba(255,140,66,0.4);
  }
  100% {
    box-shadow: 0 0 15px var(--followup-gradient-start),
                0 0 30px rgba(255,140,66,0.3);
  }
}
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideIn {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
    height: auto;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
    height: 0;
  }
}
/* There's a second "slideUp" used in some code, 
   but we've combined them for reference above. */

/* Fade classes */
.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}
.fade-in {
  opacity: 1;
  transition: opacity 0.8s ease;
}

/* ----------------------------------------------------------------
   5. BASE CONTAINER + "chat-mode" OVERRIDES
---------------------------------------------------------------- */
/*
   We want .container to center items in normal mode,
   but allow content to expand in chat mode.
*/
.container {
  /* Let container fill vertical space, center content: */
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center in normal mode */
  width: 100%;
  max-width: 1100px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0; /* remove extra top/bottom? or keep? */
  text-align: center;
  min-height: calc(100vh - 100px); /* or 100vh, depending on your design */
  transition: padding 0.5s ease;
}

/*
   When in chat mode, we want it left‐top aligned or special logic?
   According to chat-fix, we push everything up, remove forced 100vh.
*/
.container.chat-mode {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* move items to top in chat mode */
  align-items: center; /* keep them horizontally centered, if you prefer */ 
  min-height: auto;
  padding: 0; /* remove all padding */
  margin-bottom: 0;
  flex: 1 0 auto;
  gap: 0;
  height: auto;
}

/*
   Keep the footers etc from messing with container.
   If you want the logo or tagline left‐aligned in chat mode,
   remove "align-items: center" from .container.chat-mode
*/

/* ----------------------------------------------------------------
   6. LOGO & TAGLINE
---------------------------------------------------------------- */
.logo {
  font-family: 'Merriweather', serif;
  font-size: 4.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: #ffffff;
  text-shadow: 0px 0px 8px var(--text-gradient-start);
  animation: glowCycle 3s infinite alternate;
  margin-bottom: 0;
  margin-top: 15px;
  white-space: nowrap;
  line-height: 1.2;
  transition: transform 0.5s ease, margin-bottom 0.5s ease;
  width: fit-content; /* Make the width fit the content */
  margin-left: auto; /* Center the logo */
  margin-right: auto; /* Center the logo */
  text-align: center; /* Center the text within the logo */
}

.tagline {
  font-size: 1.2rem;
  background: linear-gradient(90deg, var(--text-gradient-start), var(--text-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0px;
  margin-bottom: 15px;
  transition: transform 0.5s ease, margin-bottom 0.5s ease;
  width: fit-content; /* Make the width fit the content, same as the logo */
  margin-left: auto; /* Center the tagline */
  margin-right: auto; /* Center the tagline */
  text-align: center; /* Center the text within the tagline */
}
/* In chat mode, move logo/tagline up, shrink size and spacing properly */
.container.chat-mode .logo {
  position: relative;
  font-size: 4rem; /* reduced size by 50% */
  margin-top: 0;      /* significantly reduced margin-top to close gap */
  margin-bottom: 0;   /* tightly packed below the notice */
  margin-left: auto;  /* Center the logo */
  margin-right: auto; /* Center the logo */
  text-align: center; /* Ensure text is centered */
  width: 100%;        /* Take full width of parent */
  /* transition: opacity 2s ease-in; // REMOVED - Handled by JS fade-in */
}

.container.chat-mode .tagline {
  position: relative;
  font-size: 1rem; /* reduced tagline font by 50% */
  margin-top: 0px;   /* slight space between logo and tagline */
  margin-left: auto; /* Center the tagline */
  margin-right: auto; /* Center the tagline */
  margin-bottom: 5px; /* Add a small margin at the bottom to create minimal space before chat container */
  text-align: center; /* Ensure text is centered */       /* Take full width of parent */
  /* transition: opacity 2s ease-in; // REMOVED - Handled by JS fade-in */
}

/* PRO/CORE superscript for logo */
.logo-pro-indicator {
  display: inline-block;
  position: relative;
  top: -0.7em;
  font-size: 0.4em;
  margin-left: 0.2em;
  font-weight: 900;
  letter-spacing: 0.05em;
  font-family: 'Merriweather', serif;
  text-transform: uppercase;
  transition: all 0.3s ease;
  /* Default style (CORE) - plain white with border effect */
  color: white;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.8);
  -webkit-text-fill-color: white; /* Ensure CORE is white */
  background: none; /* Remove any background for CORE */
}

/* PRO style with gradient and glow effect */
.logo-pro-indicator.active {
  background: linear-gradient(90deg, #00c6ff, #FF8C42);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
  filter: drop-shadow(0 0 2px rgba(0, 198, 255, 0.5));
  color: transparent; /* Ensure text is transparent for the gradient to show */
  text-shadow: none; /* Remove text shadow for PRO */
}

/* ----------------------------------------------------------------
   7. PRE-ALPHA & VERSION NOTICES
   (unchanged, just reorganized)
---------------------------------------------------------------- */
.pre-alpha-notice,
.version-notice {
  position: relative;
  top: 0;
  left: 0;
  transform: none;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  z-index: 1000;
  width: 60%;  /* Reduced from 80% */
  max-width: 800px;  /* Reduced from 1000px */
  line-height: 1.4;
  margin: 0 auto;
  padding: 10px 10px 0 10px;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}

.version-notice {
  padding: 10px 10px 5px 10px; /* Reduced bottom padding */
}

.pre-alpha-notice.fade,
.version-notice.fade {
  opacity: 0.2;
  pointer-events: none;
}

.pre-alpha-notice:hover,
.version-notice:hover {
  opacity: 1;
}

.pre-alpha-notice strong {
  color: red;
  font-weight: bold;
}

/* ----------------------------------------------------------------
   8. SEARCH BOX / INPUT / BUTTONS
---------------------------------------------------------------- */
/* Base styling for search interface */
.search-interface {
  display: block;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Update search box to include the new button */
.search-box {
  display: flex; /* Using flexbox */
  flex-direction: column; /* Stacks children vertically */
  align-items: center;
  position: relative;
  justify-content: center;  
  width: 100%;
  max-width: 1100px; /* Increased from 1000px to match search interface */
  margin: 0 auto;
  background: rgba(30, 30, 50, 0);
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0);
  overflow: visible;/* Add padding to accommodate the PRO notice */
  transition: all 0.3s ease-in-out;
}

/* Make the form element transparent to the flex layout */
#search-form {
  display: contents; /* Allows children to inherit parent flex/grid context */
  width: 100%; /* Ensure it takes full width like its container */
}

/* Add a container for the search input and buttons to keep them on one line */
.search-box-inputs {
  display: flex; /* Using flexbox */
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start; /* Changed from center to flex-start to make elements align at the top */
  width: 100%;
  max-height: 42px; /* Moved from search-box */
}

/* Hide search box in chat mode */
.container.chat-mode .search-box {
  display: none;
}

/* Fade-out effect for search box */
.search-box.fade-out {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Ensure search interface remains visible in chat mode */
.container.chat-mode .search-interface {
  position: relative; /* Change from absolute to relative for better flow */
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  opacity: 1;
  pointer-events: auto;
  /* transition: opacity 0.5s ease; // REMOVED - Should be instantly visible, children fade */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -40px; /* Remove bottom margin */
}

.search-input {
  font-size: 1.1rem;
  padding: 8px 15px;
  border-radius: 25px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: var(--bg-dark);
  color: #ffffff;
  resize: none;
  min-height: 36px; /* Reduced from 40px to better align with the button */
  max-height: 120px;
  height: 36px; /* Reduced from 40px to better align with the button */
  line-height: 22px; /* Adjusted to complement the new height */
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: 'Poppins', sans-serif;
  box-sizing: border-box;
  overflow-y: auto;
  width: calc(100% - 220px); /* Changed from fixed 800px to be responsive */
  flex: 1; /* Allow input to take available space */
  margin: 0; /* Ensure no margin */
  vertical-align: top; /* Ensure the textarea grows downward */
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
  opacity: 1;
}

.search-input:hover {
  box-shadow: 0 0 15px var(--button-gradient-end);
  border-color: rgba(255, 255, 255, 1);
}

.search-input:focus {
  border-color: var(--button-gradient-start);
  box-shadow: 0 0 15px var(--button-gradient-start);
  color: #ffffff;
}

/* Paper clip button styling with tooltip */
.search-attach-button {
  background: rgba(12, 17, 31, 0.7);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0 8px; /* Reduced from 5px */
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
  flex-shrink: 0; /* Prevent button from shrinking */
}

/* Tooltip for paperclip button */
/* REMOVED CSS Tooltip Rule */

.search-attach-button:hover {
  background: linear-gradient(
    135deg,
    var(--button-gradient-start),
    var(--button-gradient-end)
  );
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.search-attach-button:hover::before {
  animation: shine-effect 1.5s infinite;
  opacity: 1;
}

.search-attach-button i {
  position: relative;
  z-index: 2;
}

/* File preview styling */
.search-file-preview {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  display: none; /* Hidden by default */
}

.search-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
}

.search-file-item:last-child {
  margin-bottom: 0;
}

.search-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 30px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.search-remove-file {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
  margin-left: 8px;
}

.search-remove-file:hover {
  color: var(--text-gradient-end);
}

/* Follow-up mode styling */
.search-input.follow-up-mode {
  border-color: var(--followup-gradient-start);
  box-shadow: 0 0 15px var(--followup-gradient-start),
              0 0 30px rgba(255, 140, 66, 0.3);
  animation: followup-input-glow 3s infinite;
}

.search-input.follow-up-mode:hover {
  box-shadow: 0 0 20px var(--followup-gradient-start),
              0 0 40px rgba(255, 140, 66, 0.4);
}

.search-input.follow-up-mode:focus {
  border-color: var(--followup-gradient-start);
  box-shadow: 0 0 25px var(--followup-gradient-start),
              0 0 50px rgba(255, 140, 66, 0.5);
}

/* The main search button */
.search-button {
  font-size: 1.1rem;
  padding: 5px 20px; /* Reduced horizontal padding from 30px */
  height: 40px;
  min-width: 140px; /* Reduced from 120px */
  background: linear-gradient(135deg, var(--button-gradient-start), var(--button-gradient-end));
  color: #ffffff;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  animation: gradient-cycle 3s linear infinite;
  background-size: 200% 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 400;
  white-space: nowrap;
  margin-left: 2px; /* Added to reduce space */
  flex-shrink: 0; /* Prevent button from shrinking */
}

.search-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--button-gradient-end);
}

/* Follow-up variant */
.search-button.follow-up-mode {
  background: white;
  color: var(--followup-gradient-start);
  box-shadow: 0 0 10px var(--followup-gradient-start),
              0 0 20px rgba(255, 140, 66, 0.3);
  animation: followup-button-glow 3s infinite;
  position: relative;
  overflow: hidden;
  font-weight: 400;
  min-width: 200px;
  white-space: nowrap;
}

.search-button.follow-up-mode:hover {
  box-shadow: 0 0 20px var(--followup-gradient-start),
              0 0 40px rgba(255, 140, 66, 0.6);
}

.search-button.follow-up-mode i {
  color: var(--followup-gradient-start);
}

.search-button.follow-up-mode::before {
  display: none;
}

/* New Search mode button */
.search-button.new-search-mode {
  background: white;
  color: var(--button-gradient-start);
  box-shadow: 0 0 10px var(--button-gradient-start),
              0 0 20px rgba(0, 229, 255, 0.3);
  animation: newsearch-button-glow 3s infinite;
  position: relative;
  overflow: hidden;
  font-weight: 400;
  min-width: 180px;
  white-space: nowrap;
}

.search-button.new-search-mode:hover {
  box-shadow: 0 0 20px var(--button-gradient-start),
              0 0 40px rgba(0, 229, 255, 0.6);
}

.search-button.new-search-mode i {
  color: var(--button-gradient-start);
}

.search-button.new-search-mode::before {
  display: none;
}

/* The separate .new-search-button for the bottom position */
.new-search-button {
  position: relative;
  margin: 20px auto 40px auto;
  background: white;
  color: var(--button-gradient-start);
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 1.1rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 0 10px var(--button-gradient-start),
              0 0 20px rgba(0, 229, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  max-width: fit-content;
  height: 40px;
  animation: newsearch-button-glow 3s infinite;
  overflow: hidden;
  white-space: nowrap;
}

.new-search-button.visible {
  opacity: 1;
  transform: translateY(0);
}

.new-search-button:hover {
  box-shadow: 0 0 20px var(--button-gradient-start),
              0 0 40px rgba(0, 229, 255, 0.6);
  transform: scale(1.05) translateY(-2px);
}

.new-search-button i {
  font-size: 18px;
  color: var(--button-gradient-start);
}

.new-search-button::before {
  display: none;
}

/* ----------------------------------------------------------------
   9. RESPONSE BOX
---------------------------------------------------------------- */
.response-box {
  margin-top: 20px;
  padding: 20px;
  background: transparent;
  border-radius: 10px;
  color: #ffffff;
  font-size: 1.1rem;
  max-height: 300px;
  overflow-y: auto !important;
  animation: slideUp 0.5s ease-in-out;
  border: none;
  box-shadow: none;
  position: relative;
  overflow-x: hidden;
  text-align: justify;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  transition: -webkit-mask-image 0.3s ease-in-out, mask-image 0.3s ease-in-out;
  pointer-events: auto !important;
  z-index: 10;
}

.response-box:not(:empty) {
  border: 1px solid rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.response-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 229, 255, 0.05) 0%,
    rgba(255, 140, 66, 0.05) 100%
  );
  animation: gradientShift 8s ease infinite;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
}

.response-box:not(:empty)::before {
  opacity: 1;
}

.response-box > * {
  position: relative;
  z-index: 1;
}

.response-box.at-bottom {
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 100%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 100%);
  overflow-y: auto;
}

.response-box:focus-within {
  max-height: 500px;
  overflow-y: auto;
}

.response-box.chat-mode {
  display: none; /* Hide in chat mode */
}

/* Markdown headings in .response-box */
.response-box h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.2rem;
  margin-bottom: 0.8rem;
  color: #ffffff;
}

.response-box h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.2rem;
  margin-bottom: 0.8rem;
  color: #ffffff;
}

.response-box h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.6rem;
  color: #ffffff;
}

.response-box h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.8rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

/* ----------------------------------------------------------------
   10. SPECIAL TEXT STYLES (Sections, citations, headings)
---------------------------------------------------------------- */
.section-heading {
  font-weight: 900;
  color: #ffffff;
  position: relative;
  display: inline-block;
}

/* default strong is normal weight so .section-heading stands out */
strong {
  font-weight: normal;
}

.subsection-bold {
  font-weight: bold;
  color: #00E5FF;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.7),
               0 0 10px rgba(255, 255, 255, 0.5);
}

/* Citation styling */
.citations-section {
  text-align: left !important;
  margin-top: 20px;
}

.citations-section .section-heading {
  /* same concept as above */
  font-weight: 900;
  color: #ffffff;
}

.citation-link {
  color: var(--text-gradient-start);
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease;
  overflow-x: auto;
}

/* Only apply margin-left for citation links in the citations section */
.citations-section .citation-link {
  display: block;
  margin-left: 20px;
}

.citation-link:hover {
  color: var(--text-gradient-end);
  text-shadow: 0 0 8px var(--text-gradient-end);
}

.citation-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(
    90deg,
    var(--text-gradient-start),
    var(--text-gradient-end)
  );
  transition: width 0.3s ease;
}

.citation-link:hover::after {
  width: 100%;
}

/* ----------------------------------------------------------------
   11. FOOTER
---------------------------------------------------------------- */
.footer {
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  background: transparent;
  margin-top: auto;
  box-sizing: border-box;
}

.footer a {
  color: var(--text-gradient-start);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/*
   chat-fix would make the footer remain visible even in chat mode.
   If you want it pinned to bottom, make it `position: relative;`
   or do nothing if it's working as is.
*/

/* ----------------------------------------------------------------
   12. COFFEE ICON / SUPPORT MESSAGE
---------------------------------------------------------------- */
/* All your coffee corner code is unchanged, but integrated */
.corner-coffee {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  transition: all 0.3s ease;
  text-decoration: none;
}

.coffee-icon {
  width: 25px;
  height: auto;
  animation: glow 2s ease-in-out infinite !important;
}

.coffee-tooltip {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--bg-navy), var(--bg-dark));
  border: 1px solid var(--text-gradient-start);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.coffee-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent var(--text-gradient-start);
}

.corner-coffee:hover .coffee-tooltip {
  opacity: 1;
  visibility: visible;
  right: 60px;
}

.support-message {
  margin-top: 20px;
  text-align: center;
  padding: 15px;
  border-radius: 10px;
  animation: fadeIn 0.5s ease-in-out;
  position: relative;
  z-index: 100;
}

.support-message a {
  position: relative;
  z-index: 101;
  display: inline-block;
}

.support-message img {
  max-width: 200px;
  height: auto;
  animation: glow 2s ease-in-out infinite !important;
  will-change: filter, transform;
}

.corner-coffee:hover .coffee-icon {
  animation: coffeeGlowHover 3s infinite !important;
}

.support-message a:hover img {
  animation: supportGlowHover 3s ease-in-out infinite;
}

/* ----------------------------------------------------------------
   13. NAV MENUS (user-nav, social-nav, hamburger, slide-menu)
---------------------------------------------------------------- */
.user-nav {
  position: fixed;
  top: 10px;
  right: 20px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  z-index: 1000;
}

.user-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  background: rgba(12, 17, 31, 0.7);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.user-nav a:hover {
  background: linear-gradient(
    135deg,
    var(--button-gradient-start),
    var(--button-gradient-end)
  );
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.user-nav a i {
  font-size: 1rem;
}

.user-nav .login-btn {
  padding: 8px 16px;
  border-radius: 20px;
}

.user-nav .register-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.user-profile-pic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--text-gradient-start);
  box-shadow: 0 0 10px var(--text-gradient-start);
}

.user-nav .profile-link {
  background: linear-gradient(
    135deg,
    var(--button-gradient-start),
    var(--button-gradient-end)
  );
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 20px;
  gap: 8px;
}

/* social-nav */
.social-nav {
  position: fixed;
  top: 10px;
  left: 20px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  z-index: 1000;
}

.social-nav .social-btn {
  color: #ffffff;
  text-decoration: none;
  font-size: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  background: rgba(12, 17, 31, 0.7);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.social-nav .social-btn:hover {
  background: linear-gradient(135deg, #001e3c, #00398f);
  border-color: rgba(0, 198, 255, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
}

/* x-icon styling */
.x-icon {
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1em;
}

.x-icon:before {
  font-family: sans-serif;
  content: "𝕏";
  font-weight: bold;
}

.social-btn .x-icon {
  fill: currentColor;
}

/* hamburger menu */
.hamburger-menu {
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 1000;
}

.menu-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(12, 17, 31, 0.7);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.menu-toggle-btn:hover {
  background: linear-gradient(135deg, #001e3c, #00398f);
  border-color: rgba(0, 198, 255, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
}

/* slide-menu */
.slide-menu {
  position: fixed;
  top: 0;
  right: -200px;
  width: 200px;
  height: 100vh;
  background: linear-gradient(135deg, rgba(12, 17, 31, 0.85), rgba(0, 0, 0, 0.88));
  backdrop-filter: blur(15px);
  z-index: 2000;
  transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.slide-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 229, 255, 0.03),
    rgba(255, 140, 66, 0.03)
  );
  pointer-events: none;
}

.slide-menu.open {
  right: 0;
}

.slide-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
}

.sidebar-logo {
  font-family: 'Merriweather', serif;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  color: #ffffff;
  text-shadow: 0px 0px 5px var(--text-gradient-start);
  animation: glowCycle 3s infinite alternate;
  margin: 0;
  padding-left: 10px;
}

.close-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 0;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 5px;
}

.close-menu-btn:hover {
  color: #ffffff;
  background: transparent;
}

.close-menu-btn i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.close-menu-btn:hover i {
  transform: rotate(90deg);
}

.slide-menu-content {
  display: flex;
  flex-direction: column;
  padding: 15px;
  gap: 12px;
  position: relative;
  z-index: 10;
}

.menu-item {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  width: auto;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Adjust font size for the longer 'Support nunn.ai' text in slide menu */
/* REMOVED this rule to use default .menu-item size
#slide-menu #upgrade-link {
  font-size: 0.8rem; 
}
*/

.menu-item:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.2), rgba(255, 140, 66, 0.2));
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: -1;
  transform: translateX(0);
}

.menu-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
}

.menu-item:hover:before {
  transform: translateX(100%);
}

.menu-item:hover i {
  transform: scale(1.2);
  color: var(--text-gradient-start);
}

.menu-item i {
  transition: transform 0.3s ease, color 0.3s ease;
}

.menu-item.profile-link {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-item.profile-link:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
  text-shadow: none;
}

.menu-item.profile-link:before {
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.2), rgba(255, 140, 66, 0.2));
}

/* ----------------------------------------------------------------
   14. LEGAL CONTENT
---------------------------------------------------------------- */
.legal-content {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  line-height: 1.6;
  color: #ffffff;
  text-align: left;
  overflow-y: auto;
  font-size: 0.9rem;
}

.legal-text {
  white-space: pre-wrap;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  display: block; /* Change to block to allow centering */
  width: fit-content; /* Make the width fit the content */
  margin-left: auto; /* Center the logo link */
  margin-right: auto; /* Center the logo link */
}

.logo-link:hover {
  text-decoration: none;
}

.logo-link .logo {
  transition: text-shadow 0.3s ease;
}

.logo-link:hover .logo {
  text-shadow: 0px 0px 15px var(--text-gradient-end);
}

.legal-content h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  background: linear-gradient(90deg, var(--text-gradient-start), var(--text-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ----------------------------------------------------------------
   16. CHAT HISTORY / FULL HISTORY
---------------------------------------------------------------- */
.login-prompt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0); /* Changed from 0.8 to 0 to make it transparent */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.login-prompt.visible {
  opacity: 1;
}

.login-prompt-content {
  background-color: #0C111F;
  border-radius: 10px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
  border: 1px solid rgba(0, 229, 255, 0.2);
  animation: fadeIn 0.5s ease-out;
}

.login-prompt-content h3 {
  margin-top: 0;
  font-size: 24px;
  background: linear-gradient(135deg, var(--text-gradient-start), var(--text-gradient-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
}

.login-prompt-content p {
  margin-bottom: 25px;
  font-size: 16px;
  line-height: 1.5;
}

.login-prompt-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.login-button,
.register-button {
  padding: 10px 25px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.login-button {
  background: linear-gradient(135deg, var(--button-gradient-start), var(--button-gradient-end));
  color: white;
  border: none;
}

.register-button {
  background: transparent;
  color: white;
  border: 2px solid var(--button-gradient-start);
}

.cancel-button {
  background: transparent;
  color: #aaa;
  border: none;
  padding: 10px 15px;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.login-button:hover,
.register-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.cancel-button:hover {
  color: white;
}

/* ----------------------------------------------------------------
   18. CONVERSATION SEPARATORS & FOLLOW-UP RESPONSES
---------------------------------------------------------------- */
.conversation-separator {
  margin: 30px 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  width: 100%;
}

.conversation-separator hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
  margin: 10px 0;
}

.separator-text {
  font-size: 14px;
  font-weight: 500;
  padding: 0 15px;
  display: inline-block;
  background: var(--bg-navy);
  position: relative;
  top: -10px;
  border-radius: 4px;
}

.follow-up-response {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  animation: fadeInSlideUp 0.5s forwards;
  margin-top: 20px;
  padding-top: 5px;
  border-left: 2px solid rgba(0, 229, 255, 0.3);
  padding-left: 15px;
  pointer-events: auto !important;
  overflow: visible !important;
}

.follow-up-response pre,
.follow-up-response code {
  background-color: rgba(12, 17, 31, 0.7);
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  max-width: 100%;
}

.follow-up-response pre {
  padding: 12px;
  margin: 15px 0;
}

.follow-up-response code {
  padding: 2px 5px;
}

.follow-up-response p {
  margin: 10px 0;
}

/* ----------------------------------------------------------------
   19. CHAT CONTAINER & MESSAGES
---------------------------------------------------------------- */
.chat-container {
  /* Merged from chat-fix so we can keep a single CSS file */
  display: none; /* Initially hidden */
  width: 90%; /* narrower so it doesn't push out horizontally */
  max-width: 900px;
  margin: 20px auto 5px auto; /* top 20px for breathing; bottom 5px before footer */
  border-radius: 10px;
  overflow: visible; /* Changed from hidden to allow elements to be visible outside the container */
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(0);
  position: relative;
  z-index: 10;
  flex: 1 0 auto; /* let it grow but not shrink */
  min-height: 250px;
  height: auto;
  max-height: calc(100vh - 240px); /* can fill screen up to near the footer */
  border: 1px solid rgba(0, 229, 255, 0.25); /* slightly more visible border */
  background: rgba(0, 0, 0, 0.35); /* slightly darker background */
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 229, 255, 0.15);
  overscroll-behavior: contain; /* no scroll chaining */
}

.container.chat-mode .chat-container {
  margin-top: 20px; /* Remove top margin in chat mode to position directly under tagline */
  display: flex;
  flex-direction: column;
  width: 95%; /* Take full width in chat mode */
  max-width: 1000px; /* Match the container max-width */
  border-top-left-radius: 45; /* Optional: Remove top border radius for a more integrated look */
  border-top-right-radius: 45; /* Optional: Remove top border radius for a more integrated look */
}

.chat-container.visible {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}



/* Chat messages area */
.chat-messages {
  height: 100%;
  width: 100%;
  overflow-y: hidden;
  padding: 15px; /* Increase padding to accommodate borders */
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  overscroll-behavior: contain;
  -ms-overflow-style: none; /* hide scrollbar in IE/Edge */
  scrollbar-width: thin; /* thin scrollbar in Firefox */
  background-color: rgba(0, 0, 0, 0.7); /* Add a semi-transparent black background */
  backdrop-filter: blur(5px); /* Optional: adds a blur effect to what's behind */
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.5);
}

/* Fade effect for indicating more content */
.chat-fade-indicator {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,30,0.7));
  pointer-events: none; opacity: 0;
  transition: opacity 0.3s ease; z-index: 10;
  border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;
}
.chat-fade-indicator.visible { opacity: 1; }

/* Individual messages */
.message {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  animation: fadeInSlideUp 0.3s ease-in-out;
  font-size: 0.95rem;
  margin-bottom: 10px; /* Add some spacing between messages */
  position: relative; /* Ensure position relative for absolute positioning of buttons */
}

.message.ai {
  align-self: flex-start;
  background: rgba(12, 17, 31, 0.7);
  border-radius: 15px 15px 0 15px;
  padding: 15px 20px;
  border-left: 3px solid var(--text-gradient-start);
  box-shadow: 0 6px 16px rgba(0, 229, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.3);
  margin-bottom: 50px; /* Increased to accommodate action buttons */
  /* width: fit-content; Removed */
  /* min-width: 150px; Removed */
  /* transition: max-width 1s ease-in-out; /* Moved to inner content */
}

.message.ai .message-content h1 {
  font-size: 1rem; /* Match normal header size */
  margin-bottom: 0.8rem; /* Match h2 margins */
  color: #ffffff;
  font-weight: bold;
  position: relative;
  display: inline-block;
}

.message.ai .message-content h2 {
  font-size: 0.95rem; /* Slightly smaller than h1 */
  margin-bottom: 0.7rem;
  color: #ffffff;
  font-weight: bold;
  position: relative;
  display: inline-block;
}

.message.ai .message-content h3 {
  font-size: 0.9rem; /* Slightly smaller than h2 */
  margin-bottom: 0.6rem;
  color: #ffffff;
  font-weight: bold;
  position: relative;
  display: inline-block;
}

.message.ai .message-content h4 {
  font-size: 0.85rem; /* Slightly smaller than h3 */
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-weight: bold;
  position: relative;
  display: inline-block;
}

.message.user {
  align-self: flex-end;
  background: rgba(20, 25, 40, 0.7);
  border-radius: 15px 15px 15px 0;
  padding: 15px 20px;
  border-right: 3px solid var(--text-gradient-end);
  box-shadow: 0 6px 16px rgba(255, 140, 66, 0.25), 0 4px 10px rgba(0, 0, 0, 0.3);
  margin-right: 20px; /* Add a small right margin */
  margin-bottom: 50px; /* Increased to accommodate action buttons */
}

/* Hide the message header and avatar but keep the CSS for reference */
.message-header, .message-avatar {
  display: none;
}

.message-content {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Apply flex only to the typing indicator's content div */
.message.ai.typing-message .message-content {
  display: flex;
  align-items: center;
  gap: 8px; /* Space between status text and dots */
  /* max-width: fit-content; /* Removed */
  /* transition: max-width 1s ease-in-out; /* Removed - will be handled by JS */
}

/* Helper class for JS-controlled width transition */
.smooth-width-transition {
  transition: max-width 3s ease-in-out;
}

.message.ai .message-content {
  text-align: left;
}

.message.user .message-content {
  text-align: right;
}

/* ----------------------------------------------------------------
   20. CHAT INPUT CONTAINER
---------------------------------------------------------------- */
.chat-input-container {
  position: relative;
  bottom: 0;
  width: 100%;
  margin-top: auto; /* push to bottom */
  flex-shrink: 0;
  padding: 10px;
  background: rgba(12, 17, 31, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 10px 10px;
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.chat-input-container.chat-search-box {
  padding: 10px;
  background: rgba(12, 17, 31, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 10px 10px;
  position: sticky;
  bottom: 0;
}

/* The chat input itself */
.chat-input {
  flex: 1;
  font-size: 0.95rem;
  padding: 8px 15px;
  border-radius: 25px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: var(--bg-dark);
  color: #ffffff;
  resize: none;
  min-height: 42px;
  max-height: calc(24px * 7 + 16px);
  line-height: 24px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: 'Poppins', sans-serif;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  width: calc(100% - 220px);
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
  opacity: 1;
}

.chat-input:hover {
  box-shadow: 0 0 15px rgba(255, 140, 66, 0.5);
  border-color: rgba(255, 255, 255, 1);
}

.chat-input:focus {
  border-color: #FF8C42;
  box-shadow: 0 0 15px rgba(255, 140, 66, 0.7);
  color: #ffffff;
}

/* Chat send button matches new chat button font size, etc. */
.chat-send-button {
  font-size: 0.9rem;
  padding: 8px 15px;
  height: 42px;
  min-width: 120px;
  background: rgba(38, 10, 0, 0.8);
  color: #ff9955;
  border: 1px solid rgba(255, 140, 66, 0.3);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 0 5px rgba(255, 140, 66, 0.3);
}

.chat-send-button:hover {
  background: rgba(51, 15, 0, 0.9);
  border-color: rgba(255, 140, 66, 0.6);
  box-shadow: 0 0 10px rgba(255, 140, 66, 0.5);
  transform: scale(1.03);
}

.chat-send-button i {
  font-size: 0.9rem;
  color: #ff9955;
}

.chat-send-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* new-chat-button used in some flows */
.new-chat-button {
  position: absolute;
  top: -50px;
  right: 20px;
  background: rgba(0, 17, 26, 0.8);
  color: #00ccff;
  border: 1px solid rgba(0, 204, 255, 0.3);
  border-radius: 50px;
  padding: 8px 15px;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 204, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 120px;
  max-width: fit-content;
  height: 34px;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(20px);
}

.new-chat-button:hover {
  background: rgba(0, 26, 38, 0.9);
  border-color: rgba(0, 204, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
  transform: scale(1.03) translateY(-1px);
}

.new-chat-button i {
  font-size: 0.9rem;
  color: #00ccff;
}

.container.chat-mode .new-chat-button {
  position: absolute;
  top: -40px;
  right: 0px; /* Align with the right edge of the chat container with some padding */
  display: flex;
  opacity: 1;
  transform: translateY(0);
  z-index: 1001; /* Ensure it's above other elements */
}

/* ----------------------------------------------------------------
   21. TYPING INDICATOR
---------------------------------------------------------------- */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 0;
  margin: 5px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: rgba(0, 229, 255, 0.7);
  border-radius: 50%;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.message.ai .typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  margin: 0;
}

@keyframes typingAnimation {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ----------------------------------------------------------------
   22. LOADING ANIMATION
---------------------------------------------------------------- */
.loading-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none !important; /* forcibly remove from normal flow */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 100;
}

.loading-animation.show {
  display: none !important; /* keep it hidden anyway */
}

.search-interface.fade-out .loading-animation {
  display: none !important;
}

.container.chat-mode .loading-animation {
  display: none !important;
}

/* chat-search-box merges with chat fix approach */
.chat-search-box {
  position: relative;
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.container.chat-mode .chat-search-box {
  position: relative;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  z-index: 10;
}

/* ----------------------------------------------------------------
   23. HOME BUTTON
---------------------------------------------------------------- */
.home-button {
  position: fixed;
  top: 10px;
  right: 70px;
  z-index: 1000;
}

.home-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(12, 17, 31, 0.7);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.home-btn:hover {
  background: linear-gradient(135deg, #001e3c, #00398f);
  border-color: rgba(0, 198, 255, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 198, 255, 0.3);
}

/* ----------------------------------------------------------------
   24. RESPONSIVE MEDIA QUERIES
---------------------------------------------------------------- */
/* Chat messages wrapper */
.chat-messages-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

/* Chat messages area */
.chat-messages {
  height: 96%;
  width: 100%;
  overflow-y: auto;
  padding: 15px; /* Increase padding to accommodate borders */
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95rem;
  overscroll-behavior: contain;
  -ms-overflow-style: none; /* hide scrollbar in IE/Edge */
  scrollbar-width: thin; /* thin scrollbar in Firefox */
  background-color: rgba(0, 0, 0, 0.7); /* Add a semi-transparent black background */
  backdrop-filter: blur(5px); /* Optional: adds a blur effect to what's behind */
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.5);
}

/* Fade effect for indicating more content */
.chat-fade-indicator {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,30,0.7));
  pointer-events: none; opacity: 0;
  transition: opacity 0.3s ease; z-index: 10;
  border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;
}
.chat-fade-indicator.visible { opacity: 1; }

/* Chat attach button (paperclip) */
.chat-attach-button {
  background: rgba(12, 17, 31, 0.7);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0 1px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(5px);
  position: relative;
  overflow: visible; /* allow tooltip overflow while overlay shapes itself */
}

/* Tooltip for chat paperclip button */
.chat-attach-button::after {
  content: 'Attach files';
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10;
}

.chat-attach-button:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: -35px;
}

/* Dimming overlay for chat attach button */
.chat-attach-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1; /* behind icon but above button background */
}
.chat-attach-button:hover::before {
  opacity: 1;
}

/* Dim the icon on hover to enhance overlay effect */
.chat-attach-button:hover i {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.chat-attach-button i {
  position: relative;
  z-index: 2;
}

/* Chat file preview */
.chat-file-preview {
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  transform: translateY(-100%);
  background: rgba(12, 17, 31, 0.9);
  border-radius: 10px 10px 0 0;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 5;
}

.chat-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  margin-bottom: 5px;
}

.chat-file-item:last-child {
  margin-bottom: 0;
}

.chat-file-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.chat-remove-file {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 5px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.chat-remove-file:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

/* Adjust chat input width when attach button is present */
.chat-input-container .chat-input {
  width: calc(100% - 220px);
}

/* ----------------------------------------------------------------
   Message Action Buttons (Copy and Retry)
---------------------------------------------------------------- */
.message-actions {
  display: flex;
  position: absolute;
  bottom: -30px;
  right: 5px; /* Move more to the right */
  opacity: 1; /* Always visible, not just on hover */
  transition: opacity 0.2s ease-in-out;
  gap: 4px; /* Reduce gap between buttons to move them closer together */
  z-index: 10; /* Ensure buttons are above other elements */
}

/* Remove hover effect since buttons are always visible now */
/* .message:hover .message-actions {
  opacity: 1;
} */

.message.user .message-actions {
  right: 5px; /* Adjust for user messages */
}

.message.ai .message-actions {
  right: 5px; /* Adjust for AI messages */
}

.message-action-btn {
  background: transparent; /* Completely transparent background */
  border: none; /* Remove border */
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
  padding: 0;
  font-size: 0.8rem;
}

.message-action-btn:hover {
  background: transparent; /* Keep background transparent on hover */
  transform: translateY(-2px);
}

.message-action-btn:active {
  transform: translateY(0);
}

/* User message buttons turn orange on hover */
.message.user .message-action-btn:hover {
  color: var(--text-gradient-end); /* Orange color from your gradient */
}

/* AI message buttons turn blue on hover */
.message.ai .message-action-btn:hover {
  color: var(--text-gradient-start); /* Blue color from your gradient */
}

/* Ensure message has position relative for absolute positioning of buttons */
.message {
  position: relative;
}

/* Styles for editable content */
.message-content[contenteditable="true"] {
  border: 1px solid #4a90e2;
  padding: 8px;
  border-radius: 4px;
  background-color: rgba(74, 144, 226, 0.1);
  outline: none;
}

/* Edit button styles */
.edit-btn {
  color: #4a90e2;
}

.edit-btn:hover {
  color: #2a70c2;
}

/* Save button styles */
.save-btn {
  color: #4caf50;
}

.save-btn:hover {
  color: #388e3c;
}

.about-section .about-section {
  background: rgba(0, 0, 60, 0.3);
  border-radius: 10px;
  padding: 20px 25px;
  margin-top: 30px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.about-section .about-section h3 {
  margin-top: 0;
  color: #fff;
  text-align: center;
}

.about-section .about-section h4 {
  border-left: 3px solid #00c6ff;
  padding-left: 15px;
  margin-top: 25px;
}

.about-section .about-section p {
  margin-left: 18px;
  color: rgba(255, 255, 255, 0.9);
}

/* PRO SEARCH TOGGLE
---------------------------------------------------------------- */
.pro-mode-toggle-container {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin-top: -25px;
  margin-right: -3px; /* Changed from 0px to -3px to shift 3px to the right */
  margin-bottom: 15px;
  position: relative;
  width: auto;
  padding-right: 0px;
  flex-wrap: wrap;
  z-index: 10;
}

/* Position the PRO toggle in chat mode */
.container.chat-mode .pro-mode-toggle-container {
  right: -310px; /* Updated */
  top: -2px; /* Reverted */
  /* Adjust this value to position it below the search button in chat mode */
  margin: 0;
  z-index: 1000;
  max-width: 760px;
  position: relative !important;
  z-index: 9999 !important;
}

/* Remove the extra margin-top added specifically for chat mode toggle */
.container.chat-mode .pro-mode-toggle {
  margin-top: 0; /* Reset margin-top */
  padding: 6px 10px;
  font-size: 0.85rem;
}

.pro-mode-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 30px;
  background: rgba(30, 30, 50, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.pro-mode-toggle:hover {
  background: rgba(40, 40, 60, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

.pro-mode-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background-color: transparent; /* Changed from semi-transparent white to fully transparent */
  border: 1px solid rgba(255, 255, 255, 0.2); /* Added a subtle border to maintain the toggle outline */
  border-radius: 20px;
  transition: all 0.25s ease;
  margin-right: 10px;
}

.pro-mode-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: rgba(255, 255, 255, 0.5); /* Semi-transparent white for the knob */
  border-radius: 50%;
  transition: all 0.25s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pro-mode-label {
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
  font-family: 'Poppins', sans-serif; /* Added to match search button */
}

/* Add styling for pro-mode-text and search-text to ensure consistency */
.pro-mode-text {
  font-weight: 500;
}

.search-text {
  font-weight: 500;
}

/* Active state styles (replacing input:checked selectors) */
.pro-mode-toggle.active .pro-mode-slider {
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  border: none; /* Remove border when active */
}

.pro-mode-toggle.active .pro-mode-slider:before {
  transform: translateX(16px);
  background-color: white; /* Keep it white when active */
}

.pro-mode-toggle.active .pro-mode-label {
  color: #00c6ff;
}
/* PRO search counter styles */
.pro-search-counter {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 5px;
  width: 100%;
  text-align: right;
  padding-right: 10px;
  transition: all 0.3s ease;
  position: absolute;
  top: 100%;
  right: 0;
  background: rgba(30, 30, 50, 0.7);
  border-radius: 4px;
  padding: 4px 10px;
  margin-top: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  border-left: 2px solid rgba(0, 198, 255, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.pro-search-counter.depleted {
  color: rgba(255, 100, 100, 0.8);
  border-left: 2px solid rgba(255, 100, 100, 0.5);
}

/* Active state for PRO mode toggle */
.pro-mode-toggle input:checked ~ .pro-mode-slider {
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  box-shadow: 0 0 8px rgba(0, 198, 255, 0.5);
}

.pro-mode-toggle input:checked ~ .pro-mode-label {
  color: #00c6ff;
  text-shadow: 0 0 10px rgba(0, 198, 255, 0.3);
}

/* Add a subtle glow effect when the toggle is active */
.pro-mode-toggle input:checked ~ .pro-mode-slider:after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 22px;
  background: transparent;
  border: 1px solid rgba(0, 198, 255, 0.3);
  pointer-events: none;
  animation: glowCycle 2s infinite;
}

/* Disabled state for PRO mode toggle */
.pro-mode-toggle.disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: rgba(50, 50, 70, 0.25);
  border-color: rgba(255, 255, 255, 0.08);
}

.pro-mode-toggle.disabled:hover {
  background: rgba(50, 50, 70, 0.35);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Active state for PRO mode toggle */
.pro-mode-toggle.active .pro-mode-slider {
  background: linear-gradient(90deg, #00c6ff, #0072ff);
  box-shadow: 0 0 8px rgba(0, 198, 255, 0.5);
}

.pro-mode-toggle.active .pro-mode-label {
  color: #00c6ff;
  text-shadow: 0 0 10px rgba(0, 198, 255, 0.3);
}

/* Add a subtle glow effect when the toggle is active */
.pro-mode-toggle input:checked ~ .pro-mode-slider:after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 22px;
  background: transparent;
  border: 1px solid rgba(0, 198, 255, 0.3);
  pointer-events: none;
  animation: glowCycle 2s infinite;
}

.container.chat-mode .search-text {
  display: none;
}

/* Adjust the new chat button position if needed (might not be necessary now) */
/* .container.chat-mode .new-chat-button { */
  /* Adjust if needed based on new toggle position */
/* } */

.pro-mode-notice {
  position: relative;
  bottom: auto;
  right: auto;
  left: auto;
  margin-top: 10px; /* Increased from 2px to create more space */
  margin-left: 0; /* Change from 0 to auto for right alignment */
  margin-right: 0; /* Add right margin of 0 to align with right edge */
  width: calc(100% - 420px); /* Match the width of the search input */
  font-size: 0.75rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.0);
  padding: 4px 0px;
  border-radius: 4px;
  max-width: 800px;
  text-align: right; /* Change from left to right to align text with right edge */
  opacity: 0;
  transition: opacity 2s ease-in; /* Only transition opacity, not position */
  pointer-events: none;
  display: block; /* Ensure it's always in the DOM */
}

.pro-mode-notice.visible {
  opacity: 1;
  transform: none; /* Ensure no transform is applied */
  display: block; /* Show when visible class is added */
}

.message.ai .typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  margin: 0;
}
/* Chat PRO mode notice */
/* Adjust the PRO mode notice position in chat mode */
.container.chat-mode .search-interface .pro-mode-notice {
  position: relative;
  bottom: auto;
  margin-top: 0; /* Remove top margin, let container handle spacing */
  margin-bottom: 10px;
  margin-left: auto;
  margin-right: auto;
  display: block;
  z-index: 10; /* Lower than toggle container */
  width: 90%;
  max-width: 700px;
  text-align: center;
  font-size: 0.8rem;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  transition: opacity 0.5s ease;
  /* Removed order: 0 */
}

/* Chat PRO mode notice */
/* Adjust the PRO mode notice position in chat mode */
.container.chat-mode .search-interface .pro-mode-notice {
  position: relative;
  bottom: 40px;
  margin-top: 10px;
  margin-bottom: -20px;
  margin-left: 30px;
  display: block;
  z-index: 10;
  /* Center it in the search interface */
  width: 80%;
  max-width: 600px;
  transition: opacity 2s ease-in; /* Only transition opacity, not position */
}

/* ----------------------------------------------------------------
   25. RESPONSIVE HIDING BASED ON VIEWPORT WIDTH
---------------------------------------------------------------- */

/* Hide Upgrade Nudge and Version Notice below 1200px */
@media (max-width: 1200px) {
  #upgrade-nudge-button,
  .version-notice {
    display: none !important;
  }
}

/* Hide Coffee Cup below 800px */
@media (max-width: 800px) {
  .corner-coffee {
    display: none !important;
  }
}


/* Keyframes for synchronized 0 -> 1 -> 0 opacity cycle */
@keyframes messageFadeCycle {
  0% { opacity: 0; transform: translateY(5px); }
  5% { opacity: 1; transform: translateY(0); } /* Fade in quickly */
  95% { opacity: 1; transform: translateY(0); } /* Hold visibility */
  100% { opacity: 0; transform: translateY(-5px); } /* Fade out quickly */
}

/* Style for the status text span next to the dots */
.search-status-text {
  color: transparent; /* Make text transparent to show gradient */
  font-size: 0.9rem;
  font-style: italic;
  display: inline-block;
  position: relative;
  opacity: 0; /* Start hidden */
  transition: opacity 0.5s ease-in-out; /* Add transition for smooth fade */
  /* Define the gradient: normal -> bright -> normal */
  background-image: linear-gradient(
    90deg,
    rgba(0, 229, 255, 0.8) 0%,
    rgba(0, 229, 255, 0.8) 40%,
    rgba(180, 255, 255, 1) 50%, /* Brighter peak */
    rgba(0, 229, 255, 0.8) 60%,
    rgba(0, 229, 255, 0.8) 100%
  );
  background-size: 200% 100%; /* Make gradient wider than element */
  background-clip: text;
  -webkit-background-clip: text;
  /* Base styles only, animations applied via .animating-status */
}

/* Apply BOTH animations only when the .animating-status class is present */
.search-status-text.animating-status {
  /* Adjust duration based on the interval for the specific message if needed, */
  /* but using a fixed reasonable duration (e.g., 5s) might be simpler. */
  animation:
    messageFadeCycle 5s ease-in-out 1, /* Opacity cycle */
    travelingHighlight 5s linear 1;    /* Highlight scan */
}


/* Keyframes for the traveling highlight effect */
@keyframes travelingHighlight {
  0% { background-position: 100% 0; } /* Start with highlight off-screen right */
  100% { background-position: -100% 0; } /* Move highlight off-screen left */
}

/* Continue Chat Button Styling */
.continue-chat-button {
  position: absolute;
  top: -50px;
  right: 140px; /* Adjust spacing from container edge */
  background: rgba(0, 17, 26, 0.8);
  color: #00ccff;
  border: 1px solid rgba(0, 204, 255, 0.3);
  border-radius: 50px;
  padding: 8px 15px;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 204, 255, 0.3);
  transition: all 0.3s ease;
  z-index: 1002;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 120px;
  height: 34px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(20px);
}

.continue-chat-button.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.container.chat-mode .continue-chat-button {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  z-index: 2000; /* Ensure it's above chat-container */
}

.container.chat-mode .search-interface {
  pointer-events: none; /* Disable to allow interactions with chat container below */
}

/* Allow pointer events on key interactive elements within search-interface */
.container.chat-mode .search-interface .logo-link,
.container.chat-mode .search-interface .tagline,
.container.chat-mode .search-interface .pro-mode-notice,
.container.chat-mode .search-interface .continue-chat-button {
  pointer-events: auto;
  cursor: pointer;
}

.search-tip-notice {
  font-size: .7em;
  color: #807f7f;
  position: relative;
  top: -97px;
  left: 110px;
  z-index: -10;
}

/* Hide the search tip notice when in chat mode */
.container.chat-mode .search-tip-notice {
  display: none;
}

.pro-mode-notice.visible {
  display: block;
  opacity: 0;
  transform: none;
  top: 15px;
  left: 6px;
  font-size: .7em;
}

/* Hide the pro mode notice specifically in chat mode */
.container.chat-mode .pro-mode-notice.visible {
  top: -40px;
  left: 0px;
  opacity: 1;
}

