* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f0f2f5;
}

#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#chat-widget.closed #chat-container {
    display: none;
}

#chat-icon {
    width: 60px;
    height: 60px;
    background-color: #229ea6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

#chat-icon:hover {
    transform: scale(1.1);
}

#chat-icon i {
    color: white;
    font-size: 24px;
}

#chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background-color: #229ea6;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 5px;
}

.header-text {
    flex: 1;
}

.header-text h1 {
    font-size: 18px;
    margin: 0;
}

.header-text p {
    font-size: 12px;
    margin: 0;
    opacity: 0.8;
}

#minimize-chat {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
}

#minimize-chat:hover {
    opacity: 0.8;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.user-message {
    margin-left: auto;
    background-color: #229ea6;
    color: white;
    padding: 12px 18px;
    border-radius: 18px 18px 0 18px;
}

.bot-message {
    margin-right: auto;
    background-color: #f0f2f5;
    color: #000;
    padding: 12px 18px;
    border-radius: 18px 18px 18px 0;
    position: relative;
    padding-right: 40px; /* Make space for the speaker button */
}

.bot-message.structured {
    background-color: #f8f9fa;
    border-left: 4px solid #229ea6;
}

.bot-message .title {
    font-weight: bold;
    color: #229ea6;
    margin-bottom: 5px;
}

.bot-message .list {
    margin: 5px 0;
    padding-left: 20px;
}

.speaker-button {
    position: absolute;
    right: 8px;
    top: 88%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #4a5568;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.speaker-button:hover {
    color: #2d3748;
}

.speaker-button i {
    font-size: 1.2em;
}

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

#user-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#user-input:focus {
    border-color: #229ea6;
    outline: none;
}

#send-button {
    background-color: #229ea6;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

#send-button:hover {
    background-color: #1b8188;
}

.typing-indicator {
    display: flex;
    padding: 12px 18px;
    background: #f0f2f5;
    border-radius: 18px 18px 18px 0;
    margin-bottom: 15px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #229ea6;
    border-radius: 50%;
    animation: typing 1.4s infinite;
    opacity: 0.5;
}

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

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.disclaimer {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 10px;
    padding: 10px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.option-btn {
    background-color: #229ea6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.option-btn:hover {
    background-color: #1b8188;
}

.option-btn i {
    font-size: 16px;
}

@media screen and (max-width: 480px) {
    #chat-container {
        width: 350px;
        height: 500px;    
    } 
}