/* ChemCalc Chatbot Styles */

#chemcalc-chatbot {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1040;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #89CFF0;
    color: #1c1c1e;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    background-color: #70b8d0;
    transform: scale(1.05);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background-color: #2c2c2e;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chatbot-header {
    background-color: #89CFF0;
    color: #1c1c1e;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: #1c1c1e;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.chatbot-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #1c1c1e;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Message Bubbles */
.chatbot-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chatbot-message p {
    margin: 0 0 0.5rem 0;
    color: #ffffff;
}

.chatbot-message p:last-child {
    margin-bottom: 0;
}

.chatbot-message ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.chatbot-message li {
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.bot-message {
    background-color: #48484a;
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-message {
    background-color: #89CFF0;
    color: #1c1c1e;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.user-message p {
    color: #1c1c1e;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #89CFF0;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Section Titles */
.chatbot-section-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #89CFF0;
    margin: 0.75rem 0 0.5rem 0;
}

/* Videos Section */
.chatbot-videos {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chatbot-video-item {
    background-color: #333;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.chatbot-video-item:hover {
    transform: translateX(4px);
}

.chatbot-video-item a {
    display: flex;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
}

.chatbot-video-item .video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.chatbot-video-item img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.chatbot-video-item .video-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #89CFF0;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.chatbot-video-item .video-channel,
.chatbot-video-item .video-meta {
    font-size: 0.8rem;
    color: #aaa;
}

/* Products Section */
.chatbot-products {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chatbot-product-item {
    background-color: #333;
    border-radius: 6px;
    padding: 0.75rem;
    transition: background-color 0.2s;
}

.chatbot-product-item:hover {
    background-color: #3a3a3c;
}

.chatbot-product-item a {
    color: #89CFF0;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
}

.chatbot-product-item a:hover {
    text-decoration: underline;
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #2c2c2e;
    border-top: 1px solid #48484a;
}

.chatbot-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #48484a;
    border-radius: 8px;
    background-color: #1c1c1e;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #89CFF0;
}

.chatbot-input::placeholder {
    color: #888;
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    background-color: #89CFF0;
    color: #1c1c1e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background-color: #70b8d0;
}

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

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #1c1c1e;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #48484a;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #5a5a5c;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #chemcalc-chatbot {
        bottom: 70px;
        right: 10px;
    }

    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: 10px;
    }

    .chatbot-toggle {
        width: 50px;
        height: 50px;
    }

    .chatbot-toggle svg {
        width: 24px;
        height: 24px;
    }

    .chatbot-video-item img {
        width: 100px;
        height: 75px;
    }
}

