/*
Chatbot Styles - Design and Family Dentistry
*/

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chatbot-widget.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Chatbot Toggle */
.chatbot-toggle {
    background: var(--warm-white);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 300px;
    transition: all 0.3s ease;
    border: 2px solid var(--spanish-sand);
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chatbot-widget.open .chatbot-toggle {
    display: none;
}

.chatbot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--spanish-sand);
    flex-shrink: 0;
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-info {
    flex: 1;
}

.chatbot-name {
    font-weight: 600;
    color: var(--deep-brown);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.chatbot-subtitle {
    font-size: 0.8rem;
    color: var(--warm-brown);
}

.chatbot-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--sand-light);
    color: var(--warm-brown);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.chatbot-close:hover {
    background-color: var(--spanish-sand);
    color: var(--deep-brown);
}

/* Chatbot Window */
.chatbot-window {
    display: none;
    flex-direction: column;
    width: 350px;
    height: 500px;
    background: var(--warm-white);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 2px solid var(--spanish-sand);
}

.chatbot-widget.open .chatbot-window {
    display: flex;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--spanish-sand) 0%, var(--sand-medium) 100%);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--warm-white);
}

.chatbot-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-assistant-name {
    font-weight: 600;
    color: var(--deep-brown);
    font-size: 0.9rem;
}

.chatbot-status {
    font-size: 0.8rem;
    color: var(--warm-brown);
}

.chatbot-minimize {
    background: none;
    border: none;
    color: var(--deep-brown);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.chatbot-minimize:hover {
    background-color: var(--sand-light);
}

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--cream-light);
}

.chatbot-message {
    display: flex;
    margin-bottom: 1rem;
    align-items: flex-start;
    gap: 0.75rem;
}

.chatbot-message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--spanish-sand);
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    max-width: 70%;
}

.user-message .message-content {
    text-align: right;
}

.message-text {
    background-color: var(--warm-white);
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--black-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-message .message-text {
    background-color: var(--spanish-sand);
    color: var(--deep-brown);
}

.message-text a {
    color: var(--warm-brown);
    text-decoration: none;
    font-weight: 500;
}

.message-text a:hover {
    text-decoration: underline;
}

.message-time {
    font-size: 0.7rem;
    color: var(--warm-brown);
    margin-top: 0.25rem;
    opacity: 0.8;
}

.user-message .message-time {
    text-align: right;
}

/* Quick Actions */
.quick-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-action-btn {
    background-color: var(--warm-white);
    border: 2px solid var(--sand-light);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.85rem;
    color: var(--deep-brown);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    line-height: 1.3;
}

.quick-action-btn:hover {
    background-color: var(--sand-light);
    border-color: var(--spanish-sand);
    transform: translateY(-1px);
}

/* Chatbot Input Area */
.chatbot-input-area {
    background-color: var(--warm-white);
    border-top: 1px solid var(--sand-light);
    padding: 1rem;
}

.chatbot-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#chatbot-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--sand-light);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--black-primary);
    background-color: var(--cream-light);
    outline: none;
    transition: border-color 0.2s ease;
}

#chatbot-input:focus {
    border-color: var(--spanish-sand);
}

.chatbot-send-btn {
    background-color: var(--spanish-sand);
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--deep-brown);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    min-width: 44px;
}

.chatbot-send-btn:hover {
    background-color: var(--sand-medium);
    transform: scale(1.05);
}

.chatbot-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--warm-brown);
}

.privacy-link {
    color: var(--warm-brown);
    text-decoration: none;
}

.privacy-link:hover {
    text-decoration: underline;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--sand-light);
    border-radius: 2px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--spanish-sand);
    border-radius: 2px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--sand-medium);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-window {
        width: 100%;
        height: 400px;
    }
    
    .chatbot-toggle {
        max-width: none;
    }
    
    .message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        height: 350px;
    }
    
    .chatbot-messages {
        padding: 0.75rem;
    }
    
    .chatbot-input-area {
        padding: 0.75rem;
    }
    
    .message-text {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .quick-action-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Animation for new messages */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message {
    animation: messageSlideIn 0.3s ease;
}

/* Typing indicator (for future enhancement) */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background-color: var(--warm-white);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--warm-brown);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    30% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Enhanced Chatbot Action Buttons */
.message-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    line-height: 1.2;
}

.action-btn.phone-btn {
    background: #28a745;
    color: white;
}

.action-btn.phone-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.action-btn.link-btn {
    background: #007bff;
    color: white;
}

.action-btn.link-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.action-btn.quick-action-btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.action-btn.quick-action-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.action-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #d4af37;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #495057;
    margin-top: 8px;
}

/* Enhanced Quick Actions */
.quick-actions .quick-action-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.quick-actions .quick-action-btn:hover {
    background: linear-gradient(135deg, #b8941f 0%, #a08419 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* Chatbot Footer */
.chatbot-footer {
    padding: 8px 15px;
    text-align: center;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.chatbot-footer small {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Enhanced Message Styling */
.bot-message .message-text {
    line-height: 1.5;
}

.bot-message .message-text br {
    margin-bottom: 8px;
}

/* Mobile Responsiveness for Actions */
@media (max-width: 768px) {
    .message-actions {
        gap: 6px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .action-info {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .quick-actions .quick-action-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

/* Animation for new messages */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message {
    animation: slideInUp 0.3s ease-out;
}

/* Enhanced Avatar Styling */
.chatbot-avatar img,
.chatbot-avatar-small img,
.message-avatar img {
    border-radius: 50%;
    object-fit: cover;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f1f3f4;
    border-radius: 18px;
    margin: 5px 0;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #9aa0a6;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

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

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

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

