.chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00449E 0%, #002D66 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-bubble i {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.chat-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.chat-bubble:hover i {
    transform: scale(1.1);
}

/* Pulse animation */
.chat-bubble::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 68, 158, 0.3);
    z-index: -1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    70% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Entry animation */
.chat-bubble {
    animation: bubble-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bubble-in {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Chat window layout */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: #f8f9fa;
    border-radius: 16px;
    box-shadow: 0 5px 40px rgba(0,0,0,0.16);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

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

/* Header */
.chat-header {
    padding: 16px;
    background: white;
    color: #1c1e21;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid #e4e6eb;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-text {
    flex: 1;
}

.header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.8;
    color: #65676b;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #31a24c;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Messages area */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message bubbles */
.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    position: relative;
}

.message.user {
    align-self: flex-end;
}

.message.underwriter {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.2s ease;
}

/* Bot message style */
.message.underwriter .message-content {
    background: #f0f2f5;
    border-radius: 18px 18px 18px 4px;
    color: #1c1e21;
}

/* User message style */
.message.user .message-content {
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(55, 65, 81, 0.15);
}

/* Message hover effects */
.message.user .message-content:hover {
    background: linear-gradient(135deg, #404955 0%, #2C3440 100%);
    box-shadow: 0 4px 12px rgba(55, 65, 81, 0.2);
}

.message.underwriter .message-content:hover {
    background: #e4e6eb;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.bot-name {
    font-size: 12px;
    color: #65676b;
}

/* Hide avatar and name for user messages */
.message.user .bot-name,
.message.user .message-avatar {
    display: none;
}

/* Footer/Input area */
.chat-footer {
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 8px 16px;
    border-radius: 24px;
    box-sizing: border-box;
    border: 1px solid #e4e6eb;
}

.input-container:focus-within {
    border-color: #d0d3d9;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.input-container input {
    flex: 1;
    min-height: 40px;
    border: none;
    background: none;
    padding: 0 8px;
    font-size: 14px;
    outline: none;
    color: #1c1e21;
    box-sizing: border-box;
}

.input-container input::placeholder {
    color: #65676b;
}

.send-button {
    background: none;
    border: none;
    color: #1a73e8;
    width: 40px;
    height: 40px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    flex-shrink: 0;
    border-radius: 50%;
}

.send-button:hover {
    color: #1557b0;
    background: rgba(26, 115, 232, 0.1);
}

.send-button svg {
    width: 24px;
    height: 24px;
}

/* Notification dot */
.chat-bubble::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

.chat-bubble.has-notification::after {
    display: block;
}

/* Loading indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    width: fit-content;
    margin-right: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.suggested-topic {
    background: #e8f0fe;
    color: #00449E;
    padding: 8px 12px;
    border-radius: 15px;
    margin: 5px;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.suggested-topic:hover {
    background: #d0e0fc;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}

/* Add scrollbar styling */
.messages::-webkit-scrollbar {
    width: 6px;
}

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* Add focus styles for accessibility */
.chat-input:focus {
    border-color: #2C3E50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
    outline: none;
}

/* Add error message styling */
.message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

/* Reset and ensure messages are visible */
.chat-box {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

/* Close button */
.close-chat {
    background: none;
    border: none;
    color: #65676b;
    width: 32px;
    height: 32px;
    padding: 4px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.close-chat:hover {
    background: #f0f2f5;
    transform: rotate(90deg);
}

.close-chat svg {
    width: 24px;
    height: 24px;
}

/* Remove any conflicting styles */
.chat-input,
.chat-box,
.chat-messages {
    display: none;
} 