html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #222;
  font-family: 'Inter', Arial, sans-serif;
  min-height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

.ai-color {
    background: linear-gradient(90deg, #569ef7, #3b82f6, #2966ea);  
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: brightness(1.1) saturate(1.15);
  }
  

/* Sidebar Styles */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background-color: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-content {
  padding: 1.5rem;
  background-color: #fff;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.profile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.profile-picture {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.5rem;
  border: 1px solid #e5e7eb;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.profile-tagline {
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0 0 1.5rem 0;
  line-height: 1.4;
}

.profile-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #4b5563;
  opacity: 0.65;
  transition: opacity 0.2s, color 0.2s;
  text-decoration: none;
}

.profile-link:hover {
  opacity: 1;
  color: #3b82f6;
}

.profile-link svg {
  width: 16px;
  height: 16px;
}

.sidebar-footer {
  padding: 2.5rem;
  background-color: #fff;
}
.powered-by {
    font-size: 0.7rem;
    color: #9ca3af;
    opacity: 0.6;
    margin: 0 0 0.2rem 0;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 400;
  }

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.sidebar-logo:hover {
  transform: scale(1.05);
}




/* Main Chat Area */
.chat-main {
  margin-left: 280px;
  width: calc(100% - 280px);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  position: relative;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  margin-bottom: 8rem;
}

.chat-messages:not(:empty) {
  padding-bottom: 100px;
}

.chat-main.has-messages .chat-welcome {
  display: none;
}

.chat-main.has-messages .premade-questions {
  display: none;
}


.chat-main.has-messages .chat-input-container {
  position: fixed;
  bottom: 0;
  left: calc(280px + (100% - 280px) / 2);
  transform: translateX(-50%);
  background-color: #ffffff;
  width: calc(100% - 4rem);
  max-width: 768px;
  padding: 2rem;
  top: auto;
}

.chat-welcome {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% - 80px));
  text-align: center;
  width: 100%;
  padding: 0 2rem;
  pointer-events: none;
  z-index: 1;
}

.chat-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
}

.chat-welcome p {
  font-size: 1.1rem;
  color: #4b5563;
  margin-top: 1rem;
}

.chat-input-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 60px));
  width: calc(100% - 4rem);
  max-width: 768px;
  padding: 0;
  z-index: 2;
}

.chat-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background-color: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 1.2rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.chat-form:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15), 
              0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.chat-input {
  flex: 1;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  background: transparent;
  color: #4b5563;
}

.chat-input::placeholder {
  color: #9ca3af;
}

.chat-send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background-color: transparent;
  color: #3b82f6;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
  min-width: 36px;
  min-height: 36px;
}

.chat-send-button:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.chat-send-button:active {
  transform: scale(0.95);
}

.chat-send-button svg {
  width: 18px;
  height: 18px;
}

.premade-questions {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.75rem 0 0 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 100%;
  margin-bottom: 0.5rem;
  cursor: grab;
  user-select: none;
}

.premade-questions:active {
  cursor: grabbing;
}

.premade-questions::-webkit-scrollbar {
  display: none;
}

.premade-question {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  font-size: 0.875rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

.premade-question:hover {
  background-color: #f3f4f6;
  border-color: #3b82f6;
  color: #1f2937;
}

.premade-question:active {
  transform: scale(0.98);
}


/* Message styles */
.message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  max-width: 70%;
  word-wrap: break-word;
  line-height: 1.5;
}

/* List styles in messages */
.message ul {
  padding-left: 1.5rem;
  margin: -1rem 0;
}

.message li {
  padding-left: 0.5rem;
  margin: 0;
}

.message.user {
  align-self: flex-end;
  background-color: #3b82f6;
  color: #ffffff;
}

.message.ai {
  align-self: flex-start;
  background-color: #f3f4f6;
  color: #1f2937;
}

/* Typing indicator styles */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background-color: #f3f4f6;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #6b7280;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typing-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .app-container {
    overscroll-behavior-y: none; /* Prevent pull-to-refresh on the main container */
    touch-action: pan-y; /* Allow vertical scrolling but prevent other gestures */
  }

  /* Hide sidebar on mobile */
  .sidebar {
    display: none;
  }

  /* Full width chat on mobile */
  .chat-main {
    margin-left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Mobile profile header */
  .mobile-profile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    order: 0; /* First element */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 2rem 2rem 0.25rem 2rem;
    background-color: #fff;
    flex-shrink: 0;
    z-index: 200;
  }

  .mobile-profile-picture {
    flex-shrink: 0;
    width: 40%;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .mobile-profile-picture .profile-picture {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
  }

  .mobile-profile-content {
    width: 60%;
    display: flex;
    flex-direction: column;
  }

  .mobile-profile-content .profile-name {
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
    text-align: left;
  }

  .mobile-profile-content .profile-tagline {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    text-align: left;
  }

  .mobile-profile-content .profile-links {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .mobile-profile-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    padding-top: 0;
  }

  .mobile-profile-footer .powered-by {
    font-size: 0.65rem;
    color: #9ca3af;
    opacity: 0.6;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 400;
  }

  .mobile-profile-footer .mobile-profile-logo {
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .mobile-profile-footer .mobile-profile-logo:hover {
    transform: scale(1.05);
  }

  /* Chat messages area */
  .chat-messages {
    flex: 1;
    padding: 1rem;
    margin-bottom: 0;
    margin-top: 200px; /* Space for fixed profile header */
    overflow-y: auto;
    overscroll-behavior-y: contain; /* Contain overscroll within this element */
    min-height: 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }

  .chat-messages:not(:empty) {
    padding-bottom: 180px; /* Space for fixed input + premade questions */
  }

  /* Welcome section - positioned right under profile header */
  .chat-welcome {
    display: block;
    position: static;
    transform: none;
    padding: 4rem 1rem;
    padding-top: 220px; /* Space for fixed profile header */
    text-align: center;
    pointer-events: auto;
    order: 1; /* Show after profile header */
    flex-shrink: 0;
  }

  .chat-messages {
    order: 2; /* Show after welcome */
  }

  .chat-main.has-messages .chat-welcome {
    display: none;
  }

  .chat-title {
    font-size: 1.5rem;
  }

  .chat-welcome p {
    font-size: 1rem;
  }

  /* Input container - fixed at bottom */
  .chat-input-container {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem;
    background-color: #fff;
    z-index: 100;
  }

  .chat-main.has-messages .chat-input-container {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem;
  }

  /* Adjust form for mobile */
  .chat-form {
    max-width: 100%;
  }

  /* Premade questions on mobile */
  .premade-questions {
    padding: 0.5rem 0 0 0;
  }

  /* Adjust message width on mobile */
  .message {
    max-width: 85%;
  }
}

/* Hide mobile profile on desktop */
@media (min-width: 769px) {
  .mobile-profile-header {
    display: none;
  }
}
