.ai-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Arial', sans-serif;
}

.chat-icon {
    background-color: #4285f4;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.chat-icon:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
}

.chat-icon i {
    margin-right: 10px;
    font-size: 18px;
}

.chat-dialog {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 450px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none; /* Initially hidden, will be set by JavaScript based on device */
}

/* On smaller screens, make the chat dialog take up more space */
@media (max-width: 480px) {
    .chat-dialog {
        width: 90%;
        max-width: 350px;
        height: 70vh;
        right: 0;
        bottom: 70px;
        border-radius: 10px;
    }
    
    .ai-chat-container {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        bottom: 15px;
        right: 15px;
    }
}

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

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

.chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    height: calc(100% - 110px);
    display: flex;
    flex-direction: column;
}

.user-message, .ai-message {
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
}

.user-message {
    background-color: #e6f2ff;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.ai-message {
    background-color: #f2f2f2;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.ai-message ul {
    margin: 5px 0;
    padding-left: 20px;
}

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

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

.chat-input button {
    background-color: #4285f4;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chat-input button:hover {
    background-color: #3367d6;
}

/* Loading animation */
.loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #777;
    border-radius: 50%;
    display: inline-block;
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDots {
    0%, 80%, 100% { 
        transform: scale(0);
    }
    40% { 
        transform: scale(1);
    }
}