/* Embedded Chatbot Styles */
.vet-chatbot-embedded {
    width: 100%;
    max-width: 100%;
    height: 100vh; /* Full viewport height */
    background: white;
    border-radius: 0; /* Remove border-radius for full-width look */
    box-shadow: none; /* Remove shadow for seamless integration */
    border: none; /* Remove border */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Remove all floating/toggle button styles */
.vet-chatbot-toggle,
.vet-chatbot-overlay,
.vet-chatbot-close {
    display: none !important;
}

/* Sidebar styles */
.vet-chatbot-sidebar {
    position: absolute;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100%;
    background: white;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: left 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.vet-chatbot-sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
}

.new-chat-btn, .clear-all-chats-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.clear-all-chats-btn {
    background: #e53e3e;
}

.new-chat-btn:hover {
    background: #5a67d8;
}

.clear-all-chats-btn:hover {
    background: #c53030;
}

.sidebar-close {
    background: none;
    border: none;
    color: #374151;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: #f3f4f6;
}

.sidebar-chats-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.chat-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
}

.chat-item:hover {
    background: #f8fafc;
}

.chat-item:last-child {
    border-bottom: none;
}

.chat-title {
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 4px;
    line-height: 1.4;
}

.chat-time {
    font-size: 12px;
    color: #9ca3af;
}

.delete-chat-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-chat-btn:hover {
    background: #fee2e2;
    color: #e53e3e;
}

/* Messages container - full width and height */
.vet-chatbot-messages {
    flex: 1;
    width: 100%;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
}

/* Input container - fixed at bottom */
.vet-chatbot-input-container {
    position: sticky;
    bottom: 0;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.vet-chatbot-tools {
    display: flex;
    gap: 8px;
    width: 100%;
}

.tool-button {
    flex: 1;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
    min-width: 0;
}

.tool-button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.tool-button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.vet-chatbot-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.vet-chatbot-menu {
    background: #667eea;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.vet-chatbot-menu:hover {
    background: #5a67d8;
}

.vet-chatbot-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
}

.vet-chatbot-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
    height: 36px;
    font-family: inherit;
    line-height: 1.5;
}

.vet-chatbot-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.vet-chatbot-send {
    background: #667eea;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.vet-chatbot-send:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.vet-chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.message.user {
    align-items: flex-end;
}

.message.ai {
    align-items: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.ai .message-bubble {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 6px;
    padding: 0 8px;
}

/* Welcome dashboard styles */
.welcome-dashboard {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.welcome-message {
    font-size: 18px;
    color: #374151;
    margin-bottom: 30px;
    line-height: 1.6;
    max-width: 600px;
}

.welcome-dashboard .animated-gif {
    width: 100%;
    max-width: 300px;
    height: 120px;
    background-image: url('https://i.gifer.com/2GU.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 20px 0;
    opacity: 0.6;
    border-radius: 12px;
}

.welcome-dashboard .time-saving-text {
    font-size: 14px;
    color: #667eea;
    margin-top: 10px;
    font-style: italic;
    font-weight: 500;
}

/* Testimonial Carousel */
.testimonial-carousel {
    width: 100%;
    max-width: 600px;
    margin: 30px auto 0;
    overflow: hidden;
    position: relative;
    height: 80px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.testimonial-item {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
    font-size: 14px;
    color: #374151;
    font-style: italic;
}

.testimonial-item.active {
    opacity: 1;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 20px;
    background: white;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    max-width: 80px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.8); }
    40% { transform: scale(1); }
}

/* Reference links */
.reference-link {
    color: #667eea;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.reference-link:hover {
    color: #5a67d8;
}

/* Scrollbar styling */
.vet-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.vet-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.vet-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.vet-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.sidebar-chats-list::-webkit-scrollbar {
    width: 6px;
}

.sidebar-chats-list::-webkit-scrollbar-track {
    background: #f8fafc;
}

.sidebar-chats-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar-chats-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive design */
@media (max-width: 768px) {
    .vet-chatbot-embedded {
        height: 100vh;
    }
    
    .vet-chatbot-messages {
        padding: 16px;
    }
    
    .vet-chatbot-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 12px;
        gap: 6px;
    }
    
    .vet-chatbot-tools {
        gap: 6px;
    }
    
    .tool-button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .vet-chatbot-menu {
        width: 32px;
        height: 32px;
    }
    
    .vet-chatbot-input {
        height: 32px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .vet-chatbot-send {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    
    .vet-chatbot-sidebar {
        width: 300px;
        left: -300px;
    }
    
    .welcome-dashboard {
        padding: 30px 16px;
    }
    
    .welcome-message {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .testimonial-carousel {
        height: 70px;
        margin-top: 20px;
    }
    
    .testimonial-item {
        padding: 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .vet-chatbot-embedded {
        height: 100vh;
    }
    
    .vet-chatbot-messages {
        padding: 12px;
        padding-bottom: 120px; /* Add padding to prevent overlap with fixed input */
    }
    
    .vet-chatbot-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px 10px;
        gap: 6px;
    }
    
    .vet-chatbot-tools {
        gap: 6px;
    }
    
    .tool-button {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .tool-button svg {
        width: 12px;
        height: 12px;
    }
    
    .vet-chatbot-input-row {
        gap: 6px;
    }
    
    .vet-chatbot-menu {
        width: 30px;
        height: 30px;
        padding: 6px;
    }
    
    .vet-chatbot-input {
        height: 30px;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .vet-chatbot-send {
        width: 30px;
        height: 30px;
        padding: 6px;
    }
    
    .vet-chatbot-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .message-bubble {
        max-width: 95%;
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .welcome-dashboard {
        padding: 20px 16px;
    }
    
    .welcome-message {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    .welcome-dashboard .animated-gif {
        max-width: 250px;
        height: 100px;
        margin: 15px 0;
    }
    
    .testimonial-carousel {
        height: 60px;
        margin-top: 15px;
    }
    
    .testimonial-item {
        padding: 12px;
        font-size: 12px;
    }
}