/* Chat Bubble Styles */
.chat-bubble-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-bubble-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
}

.chat-bubble-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.chat-window {
    display: none;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    overflow: hidden;
    flex-direction: column;
}

.chat-window.active {
    display: flex;
}

.chat-header {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h5 {
    margin: 0;
    font-size: 16px;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-message, .assistant-message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 10px;
    word-wrap: break-word;
}

.user-message {
    align-self: flex-end;
    background-color: #e3f2fd;
}

.assistant-message {
    align-self: flex-start;
    background-color: #f1f3f4;
}

.message-content p {
    margin: 0;
}

.chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
}

.chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
}

.send-chat-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.send-chat-btn:hover {
    background-color: #45a049;
}

/* Chat bubble is now visible for all users */
/* No special styling needed for authenticated users */


/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #f1f3f4;
    border-radius: 10px;
    width: fit-content;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    float: left;
    margin: 0 1px;
    background-color: #9E9EA1;
    display: block;
    border-radius: 50%;
    opacity: 0.4;
}

.typing-indicator span:nth-of-type(1) {
    animation: typing 1s infinite 0s;
}

.typing-indicator span:nth-of-type(2) {
    animation: typing 1s infinite 0.25s;
}

.typing-indicator span:nth-of-type(3) {
    animation: typing 1s infinite 0.5s;
}

@keyframes typing {
    0% {
        transform: translateY(0px);
    }
    28% {
        transform: translateY(-5px);
    }
    44% {
        transform: translateY(0px);
    }
}

/* Code formatting */
pre {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

code {
    font-family: monospace;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chat-window {
        width: 300px;
        height: 400px;
        bottom: 80px;
        right: 10px;
    }
    
    .chat-bubble-container {
        bottom: 20px;
        right: 20px;
    }
}
