/* Dr. Joseph AI Assistant Styles */
.ai-assistant-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 350px;
    max-width: 80vw;
}

.ai-assistant-toggle {
    display: flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: none;
    outline: none;
    font-family: inherit;
    margin-bottom: 10px;
}

.ai-assistant-toggle:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.ai-assistant-toggle img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.ai-assistant-toggle span {
    font-weight: 600;
}

.ai-assistant-chat {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.ai-assistant-chat.active {
    max-height: 500px;
    opacity: 1;
    pointer-events: all;
    margin-bottom: 15px;
}

.ai-chat-header {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.ai-chat-header h3 img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.ai-chat-header .close-chat {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.ai-chat-header .close-chat:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.ai-chat-messages {
    padding: 15px;
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-message {
    display: flex;
    align-items: flex-start;
    max-width: 80%;
}

.ai-message.ai {
    align-self: flex-start;
}

.ai-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message .avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
}

.ai-message.user .avatar {
    margin-right: 0;
    margin-left: 10px;
}

.ai-message .message-content {
    background: #f0f5f0;
    padding: 12px 15px;
    border-radius: 15px;
    border-top-left-radius: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
}

.ai-message.user .message-content {
    background: var(--primary-color);
    color: white;
    border-radius: 15px;
    border-top-right-radius: 0;
}

.ai-chat-input {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

.ai-chat-input input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 15px;
    border-radius: 30px;
    background: #f5f5f5;
    font-size: 0.95rem;
}

.ai-chat-input button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.ai-chat-input button:hover {
    background: var(--secondary-color);
}

/* Typing animation */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f0f5f0;
    border-radius: 15px;
    border-top-left-radius: 0;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
}

.typing-indicator span:nth-child(1) {
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) {
    animation: typing 1s infinite 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation: typing 1s infinite 0.4s;
}

@keyframes typing {
    0% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.4;
        transform: scale(1);
    }
}

/* Responsive styles */
@media (max-width: 576px) {
    .ai-assistant-container {
        width: 300px;
    }
    
    .ai-message {
        max-width: 90%;
    }
}
