:root {
  font-size: calc(10px + 0.3vw); /* Responsive base font size */
}

body, html {
background-color:#FCFCF9;
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    font-family: 'Montserrat';
    font-style: normal;
    -webkit-text-size-adjust: 100%; /* Prevents font size inflation on iOS */
}



body:not(.welcome-title), 
body *:not(.welcome-title):not(.welcome-title *):not(.answerheader):not(.answerheader *):not(.userresponse):not(.userresponse *):not(.botresponse):not(.botresponse *):not(.related-container):not(.related-container *):not{.searching-text}{
    font-size: 1rem !important; /* Fixed size (adjust if needed) */
    line-height: 1.5 !important;
    color:#13343B;
}


/* Main boxed layout */
.boxed {
background-color:#FCFCF9;
    position: fixed; /* or 'absolute' if you need different positioning */
    width: 50% /* 90% of viewport width */
    height: 100%; /* Optional: match height proportion */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden; /* Ensures content doesn't affect dimensions */
     max-width: 1200px; /* Optional maximum width */
   
}

/* Chatbox scroll area */
#chatbox {
  position: relative;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column; /* This makes new messages appear at bottom */
    
     scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
       height: 80dvh;
}
#userInput {
    position: relative;
     bottom: auto;
    width: 100%;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
    z-index:5000;
    transform: translateX(-50%); /* Adjust for element's width */
    left: 50%
}

.textbox {
    display: flex;
    align-items: center;
   
   
    padding: 0.5rem 1rem;
    gap: clamp(8px, 1vw, 16px);
    border: 1px solid #ccc;
    border-radius: 19px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    /* width: 400px; */
    height: clamp(50px, 8vh, 70px);
    align-items: center;
}
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 6vw; /* Approximately 60px on most screens */
  min-width: 5vh; /* Prevent becoming too narrow */
  max-width: 10vh; /* Base expanded width will override this */
  background-color: #F3F3EE;
  border-right: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Expanded state */
.sidebar:hover,
.sidebar.expanded {
  width: 50vw; /* Approximately 250px */
  max-width: 250px;
}

.sidebar:hover .sidebar-text,
.sidebar.expanded .sidebar-text {
  opacity: 1;
}

/* Typography */
.sidebar-title {
  font-weight: bold;
  padding: 1vh 1.5vw;
  color: #1F2937;
  font-size: 1vh;
  text-transform: uppercase;
}

.sidebar-group {
  font-size: 1vh;
  font-weight: bold;
  color: #555;
  padding: 1vh 1.5vw 0.5vh;
  margin-top: 1.5vh;
}

/* Navigation */
.sidebar-nav {
  list-style: none;
  padding-left: 0.5vw;
  padding-top: 6vh;


}

.sidebar-nav li {
  list-style-type: none;
  margin-left: 0;
  padding-left: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 1.5vh 1.5vw;
  cursor: pointer;
  white-space: nowrap;
  color: #333;
  text-decoration: none;
}

.sidebar-item:hover {
  background-color: #e9ecef;
}

.sidebar-icon {
  margin-right: 0.8vw;
  font-size: 2.5vh !important;
  color: #555;
}

.sidebar-text {
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease 0.1s;
  font-size: 1.75vh;
}

/* Logo at bottom */
.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 2vh 1.5vw;
  margin-top: auto; /* Pushes to bottom */
  margin-bottom: 2vh;
  background-color: #F3F3EE;
  position: static; /* Remove fixed positioning */
}

/* Toggle button */
.sidebar-toggle {
  position: fixed;
  top: 1vh;
  left: 1vw;
  background: none;
  border: none;
  font-size: 2vh;
  z-index: 1100;
  cursor: pointer;
}

/* Mobile styles */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 65vw; /* More appropriate for mobile */
    max-width: 250px;
  }

  .sidebar.expanded {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
    left: 3vw;
    top: 2vh;
  }

  .sidebar-logo {
    padding: 3vh 4vw;
    margin-bottom: 3vh;
  }
  
}
.logo-image {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transition: all 0.3s ease;
}

.logo-text {
  margin-left: 12px;
  font-weight: 600;
  color: #13343B;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s ease 0.1s;
}

 /* Adjust main content to account for sidebar */
 .boxed {
    
     width: 50%;
     transition: margin-left 0.3s ease, width 0.3s ease;
     height:100%;
 }



 /* Keep header full width */
 .chat-header {
     margin-left: 60px;
     width: calc(100% - 60px);
     transition: margin-left 0.3s ease, width 0.3s ease;
     
 }

 .sidebar:hover ~ .chat-header {
     margin-left: 250px;
     width: calc(100% - 250px);
 }
#textInput {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    padding: 0.5rem 1rem;
    outline: none;
    font-size: clamp(1rem, 4vw, 2rem);
    overflow-y: auto;
    font-family: 'Montserrat'; 
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight:500;
}

/* Icons + Send button */
.icon-bar {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 16px);
}

.icon-bar svg {
    width: 24px;
    height: 24px;
    cursor: pointer;
    fill: #5f6368;
    transition: fill 0.2s;
}

.icon-bar svg:hover {
    fill: #000;
}

button.submit {
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6368;

}

button.submit:hover {
    color: #000;
}
 
.welcome-box{
background-color:#FCFCF9;
width: 90%;
max-width: 600px;
    padding: 2rem;
  
     text-align: center;
    transform: translate(-50%, -50%);
     
     position: absolute;
    top: 50%;
    left: 50%;
     animation: fadeInCenter 0.5s ease forwards;
 animation-delay: 0.6s;
  opacity: 0; /* Start hidden */

 }

/* Existing styles */
.welcome-title {
     font-size: clamp(1.8rem, 4vw, 1.5rem);
    font-weight: 600;
    color: #13343B;
    margin: clamp(5px, 0.5rem, 10px);
    line-height:2;
}

.welcome-text {
    font-size: clamp(1rem, 2vw, 1rem);
    color: #555;
    line-height: 1.5;
     margin: clamp(5px, 0.5rem, 10px)
}


/* Fade-out animation */
.welcome-box.fade-out {
    opacity: 0;
    transform: translateY(-50px);
    pointer-events: none;
}
        
        
        /* Feedback */
        .feedback {
            height: 100%;
            width: 80%;
            margin-top: 1%;
            border: 1px solid gray;
            padding: 1%;
        }

        .feedback h {
           margin: clamp(5px, 0.5rem, 10px)
        }

        /* Code Highlighting */
        .var-highlight {
            color: #C0AD60;
        }

        .string-highlight {
            color: rgba(253, 149, 90, 0.8);
        }
        /* Buttons */
        .btn {
            background: transparent;
            border: none;
            color:grey;
        }

        .btn:hover {
            cursor: pointer;
        }
        
        .userresponse{
        flex-shrink: 0; /* Prevents shrinking */
          
         font-size:1.75rem;
       background-color:#FCFCF9
   
            font-weight: 600;
            flex-direction: column;
        
            border-radius:13px;
            
            display:block;
         color:#13343B;
         margin-top:2rem;
        
        }
        .botresponse{
        font-size:1rem;
        flex-grow: 1;
  overflow-y: auto;

             
          
            line-height: 1.5rem;
            font-weight: 400;
            flex-direction: column;
         
            border-radius:13px;
            
           display:block;
            
        }
        /* Answer Header Style */
.answerheader {
  position: relative;
  display: flex;
  align-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  color: #13343B;
  font-size: 1rem;
  letter-spacing: 0.03em;
  padding-bottom: 4px; /* space for underline */
  width: 100%;
}

.answerheader::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1px;
  width: 100%;
  background-color: rgba(19, 52, 59, 0.3); /* light version of #13343B */
}

.answer-text {
  position: relative;
  z-index: 1;
}

.answer-text::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #13343B; /* bold underline */
}



/* Only the LAST user message sticks */


/* Regular user messages (non-sticky) */
/* First .userText only (sticky header style) */
.userText {
border-top: 1px solid #eee;
     top:0;
    
    background: #FCFCF9;



    text-align: left;
    width: 90%;
    font-size: large;
    color: #333333;
    font-weight: 600;
    display: table;
    animation: fadeIn 0.5s ease;
    margin: 0rem 4%;
}

/* All other .userText (non-sticky) */


.botText{

            text-align: left;
            float: left;
            width: 90%;
            font-size: large;
            color: #333333;
            display:table;
            animation: fadeIn 0.5s ease;
              margin: 0rem 4%;

font-weight: 400;
}
            
        }
.message-actions {
    margin: clamp(5px, 0.5rem, 10px)
    border-top: 1px solid #eee;
    padding: clamp(5px, 1vh, 15px);
}

.botbuttons {
    display: flex;
    gap: clamp(8px, 1vw, 16px);
}

.feedback {
    margin: clamp(5px, 0.5rem, 10px)
    padding: clamp(5px, 1vh, 15px);
    background: #f8f8f8;
    border-radius: 8px;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.feedback-input {
    display: flex;
    gap: 8px;
}

.feedback-input input {
    flex: 1;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Smooth message appearance */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* For welcome box (new) */
@keyframes fadeInCenter {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}
.searching-text {
  font-size: 1rem !important;
  color: #555;
  font-weight: 400;
  line-height: 1.5rem;
  padding:4px;
 font-style:italic;

  display: inline;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: none;   
   word-break: keep-all;           
   overflow-y: auto; 
    -ms-overflow-style: none;      /* IE and Edge */
  scrollbar-width: none;    
  scroll-behavior: smooth;
}
#statusText::-webkit-scrollbar {
  display: none;                 /* Chrome, Safari, Opera */
}
.header-box
{
min-width:100%;
}
.chat-header {
    position: sticky;
    top: 0;
   
    width: 100vw; /* Use 100% instead of 100vw */
    left: 0; /* Ensure alignment with viewport edge */
    right: 0; /* Ensure alignment with viewport edge */
    background: white;
    padding: 10px 0; /* Vertical padding only */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box; /* Include padding in width calculation */
    margin: 0; /* Remove any default margins */
}

.header-logo {
  height: 40px; /* Adjust as needed */
  width: auto;
}

.company-name {
  margin: 0;
  font-size: 1.5rem;
  color: #7F64FE; /* Your brand color */
  font-weight: 600;
  
}

/* Tablet */
@media (max-width: 768px) {
  .boxed {
    width: 80vw;
    height: 95vh;
  }
  
  #userInput {
    width: 100%;
    bottom: auto;
    
  
  }
  
  .textbox {
    height: auto;
    min-height: 50px;
    max-width: 90%;
  }
  #chatbox {
         height: calc(100% - 20%)
  }
}
/* Mobile */
@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }
  
  .boxed {
    width: 80vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .chat-header {
    padding: 0.5rem 0;
  }
  
  .userText, .botText {
    width: 88%;
  
  }
  #chatbox {
         height: calc(100% - 30%)
  }
 #userInput {
   width: 100%;
   bottom: auto;
 
 }
}
.related-container {
      max-width: 100%;
    background:#FCFCF9;
    margin-top:3rem;
     
    }

    .related-title {
      font-weight: 500;
      font-size: 1.25rem;
      margin: 10px 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }
.related-title::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background-image: url('relatedicon.png'); /* <-- Replace with correct path */
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 8px;
}
   

    .related-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .related-item {
      display: flex;
      justify-content: space-between;
      padding: 10px 0;
      border-bottom: 1px solid #eee;
      cursor: pointer;
    }

   .related-item:last-child {
  border-bottom:none;
}

    .related-item:hover {
      color: #368C97;
    }

    .plus-icon {
      color: #368C97;
      font-weight: bold;
    }
/* Glowing red pulse for the mic icon */
.recording {
  animation: mic-pulse 1s infinite;
  fill: red; /* For inline SVG */
  color: red; /* For font icons if any */
}

@keyframes mic-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: drop-shadow(0 0 4px red);
  }
  50% {
    transform: scale(1.1);
    opacity: 0.6;
    filter: drop-shadow(0 0 8px red);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: drop-shadow(0 0 4px red);
  }
}


@keyframes fadeChar {
  0% {
    background-position: 0% center;
    opacity: 1;
  }
  100% {
    background-position: 100% center;
    opacity: 1;
  }
}


.rainbow-char {
  display: inline-block;
  font-style: italic;
  color: #0f172a; /* dark slate (base text color) */
    animation-name: perplexityFlow;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-play-state: running;
   animation-duration: 0.8s;
}

@keyframes perplexityFlow {
  0% {
    color: #616161;
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    color: black;
    transform: scale(1);
    opacity: 1;
  }
  100% {
    color: #616161;
    transform: scale(1);
    opacity: 0.7;
  }
}

.typing-dots::after {
  content: '';
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: '';     }
  33%  { content: '.';    }
  66%  { content: '..';   }
  100% { content: '...';  }
}
#powered-by-footer {
  flex-shrink: 0;
  background-color: #fafafa;
  padding: 0.75em 1em;
  font-style: italic;
  text-align: center;
   padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
#powered-by-footer img {
  height: 1.25em;              /* image height scales with font size */
  width: auto;
  vertical-align: middle;
  max-width: 100%;             /* prevent overflow */
}

