.chat-widget-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chat-icon {
    width: 52px;
    height: 52px;
    background: #1a73e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.4);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.chat-icon:hover {
    box-shadow: 0 6px 16px rgba(26, 115, 232, 0.5);
    transform: translateY(-4px);
}

.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 600px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.chat-window.hidden {
    display: none;
}

.chat-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0;
}

.org-banner {
    max-height: 40px;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: 10px;
}

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

.chat-input {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    font-size: 16px;
}

#send-message {
    background: #1a73e8;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.error-message {
    color: #dc3545;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

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

.user-message {
    background: #1a73e8;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.ai-message {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-title {
    margin: 0;
    font-size: 16px;
    flex: 1;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

#maximize-chat {
    cursor: pointer;
}

.chat-window.maximized {
    position: fixed !important;
    width: 60vw !important;
    height: 80vh !important;
    right: 20px;
    bottom: 20px;
}

/* Speech button styles */
.speak-btn {
    width: 28px;
    height: 28px;
    border-radius: 35%;
    background-color: white;
    border: 1px solid #5fa9f3;
    color: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin-top: 5px;
    transition: all 0.5s ease;
}

.speak-btn:hover {
    background-color: #1a73e8;
    border-color: #1a73e8;
    color: white;
}

.speak-btn-active {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.4);
}

.speak-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading dots animation */
.loading-dots-small {
    display: inline-block;
    position: relative;
    width: 14px;
    height: 14px;
}

.loading-dots-small:after {
    content: '.';
    animation: loading-dots 1.2s infinite;
    font-weight: bold;
}

@keyframes loading-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* SVG icon styles */
.volume-icon, .stop-icon {
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Powered by section */
.powered-by {
    text-align: center;
    padding: 8px 0;
    font-size: 12px;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

.powered-by-brand {
    font-weight: 700;
}

.powered-by-brand a {
    color: #6c757d;
    text-decoration: none;
}

.powered-by-brand a:hover {
    text-decoration: underline;
}

.powered-by-icon {
    width: 17px;
    height: 14px;
    margin-right: 2px;
    margin-left: 2px;
    margin-bottom: 3px;
    vertical-align: middle;
}

/* Mobile styles for chat window */
@media screen and (max-width: 1023px) {
    .chat-window {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        z-index: 9999 !important;
    }
    
    /* Hide maximize button on mobile */
    #maximize-chat {
        display: none !important;
    }
    
    /* Ensure maximize button doesn't affect mobile view */
    .chat-window.maximized {
        width: 100% !important;
        height: 100% !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    
    .chat-header {
        border-radius: 0 !important;
    }
    
    /* Ensure the chat input stays at the bottom */
    .chat-messages {
        flex: 1;
        height: calc(100% - 130px); /* Adjust based on header and input heights */
    }
}