/* Chatbot Container */
#tti-chatbot-container {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#tti-chatbot-container.tti-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

#tti-chatbot-container.tti-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toggle Button */
.tti-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tti-chatbot-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Chat Widget */
#tti-chatbot-widget {
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
}

#tti-chatbot-widget.tti-chatbot-closed {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

#tti-chatbot-widget.tti-chatbot-open {
    opacity: 1;
    transform: scale(1);
}

/* Header */
.tti-chatbot-header {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tti-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#tti-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    line-height: 1;
    padding: 0;
}

#tti-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
.tti-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

/* Messages */
.tti-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s;
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tti-message p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
}

.tti-user {
    justify-content: flex-end;
}

.tti-user p {
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.tti-assistant {
    justify-content: flex-start;
}

.tti-assistant p {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Typing Indicator */
.tti-typing {
    display: flex;
}

.tti-typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.tti-typing-dots span {
    width: 8px;
    height: 8px;
    background: #00bcd4;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.tti-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.tti-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input Area */
.tti-chatbot-input {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

#tti-chatbot-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

#tti-chatbot-input:focus {
    border-color: #00bcd4;
}

#tti-chatbot-send {
    margin-left: 8px;
    background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#tti-chatbot-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 188, 212, 0.3);
}

#tti-chatbot-send:active {
    transform: translateY(0);
}

/* Scrollbar */
.tti-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.tti-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.tti-chatbot-messages::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 3px;
}

.tti-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #9e9e9e;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #tti-chatbot-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        max-height: 600px;
    }
    
    #tti-chatbot-container.tti-chatbot-bottom-right,
    #tti-chatbot-container.tti-chatbot-bottom-left {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
}

/* Prevent layout shift */
#tti-chatbot-container * {
    box-sizing: border-box;
}
