#chatgpt-popup-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

#chatgpt-toggle {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#chatgpt-toggle:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#chatgpt-toggle:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

/* Chat Widget Container */
#chatgpt-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

/* Header */
#chatgpt-header {
    background-color: #007bff;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

#chatgpt-header span {
    font-size: 18px;
    font-weight: 500;
}

#chatgpt-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    transition: transform 0.2s ease;
}

#chatgpt-close:hover {
    transform: scale(1.1);
}

/* Messages Area */
#chatgpt-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto; /* Enables vertical scrolling */
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f9f9f9;
    max-height: calc(100% - 60px); /* Ensures it does not exceed container */
}

/* Scrollbar Styling */
#chatgpt-messages::-webkit-scrollbar {
    width: 6px;
}

#chatgpt-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#chatgpt-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#chatgpt-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Input Container */
#chatgpt-input-container {
    padding: 15px;
    border-top: 1px solid #eee;
    background: white;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Input Field */
#chatgpt-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#chatgpt-input:focus {
    border-color: #0056b3;
    box-shadow: 0 0 5px rgba(0, 91, 179, 0.5);
}

#chatgpt-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Send Button */
#chatgpt-send {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#chatgpt-send:hover:not(:disabled) {
    background-color: #0056b3;
    transform: translateY(-1px);
}

#chatgpt-send:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Message Bubbles */
.user-msg, .bot-msg, .error-msg {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    margin: 5px 0;
    word-wrap: break-word;
    line-height: 1.4;
}

.user-msg {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.bot-msg {
    background-color: #f0f0f0;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.error-msg {
    background-color: #ffebee;
    color: #c62828;
    align-self: center;
    text-align: center;
    font-size: 0.9em;
}

/* Typing Indicator */
#chatgpt-typing-indicator {
    padding: 10px 15px;
    display: flex;
    gap: 5px;
    align-items: center;
}

#chatgpt-typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #007bff;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

#chatgpt-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

#chatgpt-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #chatgpt-widget {
        width: 100%;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    #chatgpt-toggle {
        bottom: 10px;
        right: 10px;
    }
}