/* Chatbot Window Structure */
.chatbot-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: white;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

/* Header Styling */
.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-primary);
    color: white;
    border-radius: 10px 10px 0 0;
}

.chatbot-title {
    font-weight: 500;
    font-size: 1.1em;
}

/* Window Controls */
.window-controls {
    display: flex;
    gap: 8px;
}

.control-button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    font-size: 1.2em;
    transition: transform 0.2s ease;
}

.control-button:hover {
    transform: scale(1.1);
}

.maximize-btn, .restore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

.restore-btn {
    display: none;
}

/* Maximized State */
.chatbot-window.maximized {
    width: 100%;
    height: 100vh;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
}

.chatbot-window.maximized .maximize-btn {
    display: none;
}

.chatbot-window.maximized .restore-btn {
    display: flex;
}

/* Chat Content Area */
.chatbot-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    overflow-y: auto;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

/* Input Area */
.chat-input-container {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: white;
}

#chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#send-message {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#send-message:hover {
    background: var(--color-primary-dark);
}

.chat-message {
    max-width: 80%;
    margin: 8px;
    padding: 12px 16px;
    border-radius: 20px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-message.user {
    background: #4CAF50;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-message.bot {
    background: #f0f0f0;
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

#chat-window {
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
  #chatbot-container {
      position: fixed;
      bottom: 80px; /* Increased from bottom to avoid overlap */
      right: 20px;
      z-index: 1000;
  }

  #chatbot-toggle {
      position: fixed;
      bottom: 20px;
      right: 20px;
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background: #4CAF50;
      color: white;
      border: none;
      cursor: pointer;
      z-index: 999;
  }
#chatbot-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

@media screen and (max-width: 768px) {
    .chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 60vh;
        border-radius: 12px 12px 0 0;
        transform: translateZ(0); /* Enable hardware acceleration */
    }

    .mobile-scroll-indicator {
        position: absolute;
        bottom: 60px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.5);
        color: white;
        padding: 4px 8px;
        border-radius: 12px;
        opacity: 0;
        transition: opacity 0.3s;
        pointer-events: none;
    }

    .mobile-scroll-indicator.visible {
        opacity: 1;
    }

    .chat-input-container {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 12px;
        border-top: 1px solid #eee;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    #chat-input {
        font-size: 16px;
        line-height: 20px;
        padding: 8px 12px;
        margin-right: 8px;
        border-radius: 20px;
        border: 1px solid #ddd;
        flex: 1;
    }

    #send-message {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chatbot-header {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .chat-messages {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding-bottom: 60px;
    }
}