:root {
    --bg-color-1: #4b79a1;
    --bg-color-2: #283e51;
    --text-color: #f0fdfc;
    --button-color-1: #3498db;
    --button-color-2: #2c3e50;
    --main-bg: #eaf6f6;
    --sidebar-bg: rgba(255, 255, 255, 0.2);
    --chat-bg: rgba(255, 255, 255, 0.5);
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    color: #1e2b27;
    height: 100vh;
    overflow: hidden;
    display: flex;
    position: relative;
    background: linear-gradient(135deg, var(--bg-color-1) 0%, var(--bg-color-2) 100%);
    animation: backgroundShift 20s infinite alternate;
}

#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.app-container {
    display: flex;
    flex: 1;
    width: 100%;
    position: relative;
}

/* Sidebar Toggle Button */
  .hamburger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2000;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: block;
  }

  .hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
  }

  /* Sidebar */
  .sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    height: 100vh;
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease;
  }

  .sidebar.hidden {
    transform: translateX(-100%);
  }

.sidebar-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Chat History Section */
.chat-history-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 20px;
    flex-grow: 1;
  }

  .menu-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    width: 100%;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s ease;
    justify-content: flex-start;
    text-decoration: none;
    margin-bottom: 5px;
  }

  .menu-item:hover {
    opacity: 1;
}

.menu-item .icon {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    fill: currentColor;
  }

  .chat-history {
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 10px;
  }

  .chat-item {
    padding: 8px 12px;
    margin: 2px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }

  .chat-item:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .chat-item.active {
    background: rgba(255, 255, 255, 0.3);
  }

  .chat-name {
    flex: 1;
    font-size: 14px;
    margin-left: 10px;
  }

  .chat-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .chat-item:hover .chat-actions {
    opacity: 1;
  }

  .rename-btn, .delete-btn {
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: background-color 0.2s;
  }

  .rename-btn:hover {
    background-color: #e0e0e0;
  }

  .delete-btn:hover {
    background-color: #ffebee;
  }

/* Sidebar Footer */
  .sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 20px;
    margin-top: auto;
  }

  .footer {
    font-size: 12px;
    color: var(--text-color);
    text-align: center;
    padding: 10px 0;
    opacity: 0.6;
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    z-index: 10;
    width: 100%;
  }

  .profile {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    width: 100%;
    margin-top: 10px;
  }

  .profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
  }

  .profile span {
    font-size: 15px;
    line-height: 1;
  }

  /* Main content */
  .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }

  .chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    transition: margin-left 0.3s ease;
    position: relative;
    height: 100vh;
  }

  .chat-container.has-messages {
    justify-content: flex-start;
    padding-top: 20px;
  }

#welcomeMessage {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.9;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition: opacity 0.3s ease;
  }

#welcomeMessage.hidden {
    opacity: 0;
    display: none;
  }

  .chat-box {
    width: 100%;
    max-width: 800px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    display: none;
    scroll-behavior: smooth;
    /* Hide scrollbar but keep scroll functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.chat-box::-webkit-scrollbar {
    display: none; /* WebKit browsers (Chrome, Safari, Edge) */
}

.chat-box.active {
    display: block;
  }

  .user-msg, .bot-msg {
    margin: 8px 0;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    display: inline-block;
    max-width: 70%;
    min-width: 60px;
    clear: both;
    width: fit-content;
  }

  .user-msg {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    margin-left: auto;
    text-align: right;
    border-bottom-right-radius: 4px;
    float: right;
  }

  .bot-msg {
    background: white;
    color: #333;
    margin-right: auto;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    float: left;
  }

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

  /* Typing indicator */
  .typing-indicator {
    opacity: 0.7;
  }

  .typing-dots {
    display: inline-block;
  }

  .typing-dots span {
    animation: typing 1.4s infinite ease-in-out;
    display: inline-block;
    margin-right: 2px;
  }

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

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

  @keyframes typing {
    0%, 80%, 100% {
      opacity: 0.3;
    }
    40% {
      opacity: 1;
    }
  }

/* Input Container - Fixed at bottom */
  .input-container {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: white;
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 12px 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    z-index: 100;
}

.input-container:focus-within {
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    border-color: #007bff;
}

#userInput {
    flex-grow: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #333;
    padding: 8px 12px;
  }

.icon-button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.icon-button:hover {
    background-color: #f0f0f0;
    color: #007bff;
    transform: scale(1.05);
}

.icon-button i {
    font-size: 16px;
    color: inherit;
}

.icon-button:hover i {
    color: #007bff;
}

/* Animations */
@keyframes backgroundShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Icons - using inline SVG for consistency */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    fill: #1e2b27;
}

.logo-icon {
    fill: var(--text-color);
    height: 30px;
  }

  /* Responsive Design */
  @media (max-width: 768px) {
    .hamburger-btn {
      display: block;
    }

    .sidebar {
      position: fixed;
      height: 100vh;
      top: 0;
      left: 0;
    }

    .main {
      margin-left: 0;
    }

    .input-container {
        width: 95%;
        bottom: 70px;
    }

    .user-msg, .bot-msg {
      max-width: 85%;
    }
  }

  @media (max-width: 480px) {
    .sidebar {
      width: 100%;
    }

    .input-container {
      width: 95%;
      padding: 10px 12px;
        bottom: 60px;
    }

    .footer {
        bottom: 5px;
        font-size: 0.7rem;
    }

    .user-msg, .bot-msg {
      max-width: 90%;
      padding: 10px 14px;
    }
  }
