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

 .chat-button {
     background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);;
     color: white;
     border: none;
     border-radius: 50px;
     padding: 12px 20px;
     font-size: 16px;
     cursor: pointer;
     box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .chat-button:hover {
     transform: translateY(-2px);
     box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
 }

 .chat-container {
     width: 600px;
     /* Slightly wider for code blocks */
     height: 600px;
     background: white;
     border-radius: 20px;
     box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
     display: none;
     flex-direction: column;
     overflow: hidden;
     border: 1px solid #e1e5e9;
 }

 .chat-header {
     background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);;
     color: white;
     padding: 20px;
     text-align: center;
     position: relative;
 }

 .chat-header h3 {
     margin: 0;
     font-size: 18px;
     font-weight: 600;
     color: #ffffff;
 }

 .close-chat {
     position: absolute;
     right: 15px;
     top: 15px;
     background: none;
     border: none;
     color: white;
     font-size: 20px;
     cursor: pointer;
     padding: 5px;
 }

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

 .message {
     margin-bottom: 15px;
     display: flex;
 }

 .user-message {
     justify-content: flex-end;
 }

 .ai-message {
     justify-content: flex-start;
 }

 .message-bubble {
     max-width: 85%;
     padding: 12px 16px;
     border-radius: 18px;
     font-size: 15px;
     line-height: 1.4;
 }

 .user-bubble {
    background: #ebedf7;
    color: #393737;
     border-bottom-right-radius: 4px;
 }

 .ai-bubble {
     background: white;
     color: #333;
     border: 1px solid #e1e5e9;
     border-bottom-left-radius: 4px;
 }

 /* Markdown styling for AI messages */
 .ai-bubble strong {
     font-weight: 600;
     color: #2d3748;
 }

 .ai-bubble em {
     font-style: italic;
     color: #4a5568;
 }

 .ai-bubble code:not(pre code) {
     background: #edf2f7;
     padding: 2px 6px;
     border-radius: 4px;
     font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
     font-size: 0.9em;
     color: #e53e3e;
 }

 /* Improved code block styling */
 .ai-bubble pre {
     background: #f6f8fa;
     border: 1px solid #e1e4e8;
     border-radius: 8px;
     padding: 16px;
     overflow-x: auto;
     margin: 12px 0;
     font-size: 13px;
     line-height: 1.45;
     white-space: pre-wrap;
     /* This ensures code wraps properly */
     word-wrap: break-word;
 }

 .ai-bubble pre code {
     background: none;
     color: #24292e;
     padding: 0;
     font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
     white-space: pre-wrap;
     /* Important for line wrapping */
     word-wrap: break-word;
     display: block;
 }

 /* Language label */
 .code-language {
     display: inline-block;
     background: #667eea;
     color: white;
     padding: 4px 8px;
     border-radius: 4px 4px 0 0;
     font-size: 11px;
     font-weight: 600;
     margin-bottom: -1px;
     position: relative;
     z-index: 1;
 }

 /* Ensure code blocks don't overflow */
 .chat-messages {
     max-width: 100%;
 }

 .ai-bubble {
    /* max-width: 85%; */ 
    max-width: 100%;
     word-wrap: break-word;
 }

 /* Header styling for AI messages */
.ai-bubble h1 {
    margin: 24px 0 16px 0 !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #2d3748 !important;
    line-height: 1.3 !important;
}

.ai-bubble h2 {
    margin: 20px 0 12px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #2d3748 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding-bottom: 8px !important;
    line-height: 1.3 !important;
}

.ai-bubble h3 {
    margin: 16px 0 8px 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    line-height: 1.3 !important;
}

/* Paragraph and text styling */
.ai-bubble p {
    margin: 12px 0 !important;
    line-height: 1.5 !important;
    color: #4a5568 !important;
}

/* List styling */
.ai-bubble ul,
.ai-bubble ol {
    margin: 12px 0 !important;
    padding-left: 24px !important;
}

.ai-bubble li {
    margin: 6px 0 !important;
    line-height: 1.4 !important;
    color: #4a5568 !important;
}

/* Ensure proper spacing between elements */
.ai-bubble > *:first-child {
    margin-top: 0 !important;
}

.ai-bubble > *:last-child {
    margin-bottom: 0 !important;
}
 .chat-input {
     padding: 20px;
     border-top: 1px solid #e1e5e9;
     background: white;
 }

 .input-group {
     display: flex;
     gap: 10px;
 }

 .chat-input-field {
     flex: 1;
     padding: 12px 16px;
     border: 1px solid #e1e5e9;
     border-radius: 25px;
     outline: none;
     font-size: 15px;
     transition: border-color 0.3s ease;
 }

 .chat-input-field:focus {
     border-color: #667eea;
 }

 .send-button {
     background: #17b4d3;
     color: white;
     border: none;
     border-radius: 50%;
     width: 44px;
     height: 44px;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: background 0.3s ease;
 }

 .send-button:hover {
     background: #5a6fd8;
 }

 .typing-indicator {
     display: none;
     padding: 12px 16px;
     background: white;
     border-radius: 18px;
     border: 1px solid #e1e5e9;
     max-width: 80%;
 }

 .typing-dots {
     display: flex;
     gap: 4px;
 }

 .typing-dot {
     width: 8px;
     height: 8px;
     background: #999;
     border-radius: 50%;
     animation: typing 1.4s infinite ease-in-out;
 }

 .typing-dot:nth-child(1) {
     animation-delay: -0.32s;
 }

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

 @keyframes typing {

     0%,
     80%,
     100% {
         transform: scale(0.8);
         opacity: 0.5;
     }

     40% {
         transform: scale(1);
         opacity: 1;
     }
 }

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

 .chat-messages::-webkit-scrollbar-track {
     background: #f1f1f1;
     border-radius: 3px;
 }

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

 .chat-messages::-webkit-scrollbar-thumb:hover {
     background: #a8a8a8;
 }


@media (max-width: 768px) {
    .chat-button {
        padding: 10px 15px;
    }
    .chat-widget {
        bottom: 6px;
        right: 15px;
    }
      .chat-container {
        width: 400px;
    }
}

@media (max-width: 420px) {
    .chat-button {
        padding: 8px 15px;
        font-size: 15px;
    }

    .chat-widget {
        bottom: 6px;
        right: 15px;
    }

    .chat-container {
        width: 334px;
        height: 535px;
    }
}

@media (max-width: 352px) {
    .chat-button {
        padding: 2px 4px;
        font-size: 12px;
    }

    .chat-container {
        width: 280px;
        height: 535px;
    }
}
