/* Chatbot Container */
#dsb-chatbot-container {
    max-width: 1800px;
    width: 95%;
    margin: 0 2.5%;
    padding: 14px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: auto !important;
    max-height: 90vh;
    overflow: visible;
    font-family: inherit;
}

/* Login Popup */
#dsb-login-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.dsb-login-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.dsb-login-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 400px;
}

.dsb-login-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #777;
    line-height: 1;
}

.dsb-login-popup-close:hover {
    color: #333;
}

.dsb-login-popup-content p {
    margin: 0;
    padding: 10px 0;
    text-align: center;
    font-size: 16px;
    color: #333;
}

/* Chatbot Header */
#dsb-chatbot-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1;
}

#dsb-chatbot-header img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

#dsb-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* Chatbot Messages */
#dsb-chatbot-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dsb-user-message, .dsb-bot-message {
    max-width: 95%;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 15px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.2;
}

.dsb-user-message {
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.dsb-bot-message {
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

/* Chatbot Input Area */
#dsb-chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

#dsb-chatbot-input {
    padding: 7px 14px 3px 7px;
    width: 100%;
    min-height: 48px;
    max-height: 200px;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
    transition: all 0.2s ease;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 15px;
    color: #333333;
}

#dsb-chatbot-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    outline: none;
}

#dsb-chatbot-input::placeholder {
    color: #777777;
    font-style: italic;
}

#dsb-chatbot-send {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#dsb-chatbot-send:hover {
    background: #005177;
}

/* Typing Indicator */
#dsb-chatbot-typing-indicator {
    display: none;
    padding: 10px;
    font-style: italic;
    color: #666;
    text-align: center;
    position: relative;
    min-height: 20px;
}

.typing-indicator-dots {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 20px;
}

.typing-indicator-dots span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: typing-indicator 1.2s infinite ease-in-out;
}

.typing-indicator-dots span:nth-child(1) {
    left: 0;
    animation-delay: 0s;
}

.typing-indicator-dots span:nth-child(2) {
    left: 20px;
    animation-delay: 0.2s;
}

.typing-indicator-dots span:nth-child(3) {
    left: 40px;
    animation-delay: 0.4s;
}

@keyframes typing-indicator {
    0%, 40%, 100% { transform: translateY(0); }
    20% { transform: translateY(-6px); }
}

/* Responsive Design */
@media (max-width: 480px) {
    #dsb-chatbot-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .dsb-user-message, .dsb-bot-message {
        max-width: 90%;
    }
}

/* Add these new styles at the end */
.dsb-bot-message {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.dsb-bot-message p {
    margin: 0 0 0 0;
}

.dsb-bot-message ul,
.dsb-bot-message ol {
    margin: 1em 0;
    padding-left: 2em;
}

.dsb-bot-message li {
    margin-bottom: 0 0 0 0;
}

.dsb-bot-message code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 14px;
}

.dsb-bot-message pre {
    background: rgba(0,0,0,0.05);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
}

.dsb-bot-message blockquote {
    border-left: 3px solid #ddd;
    padding-left: 1em;
    margin: 1em 0;
    color: #666;
}

/* Add error message styling */
.dsb-bot-message.error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

.dsb-bot-message h1,
.dsb-bot-message h2,
.dsb-bot-message h3,
.dsb-bot-message h4 {
    line-height: 1.2;
    color: var(--bot-text-color, inherit);
    margin: 0px;
}

.dsb-bot-message h1 {
    font-size: 1.5em;
}

.dsb-bot-message h2 {
    font-size: 1.3em;
}

.dsb-bot-message h3 {
    font-size: 1.3em;
}

.dsb-bot-message h4 {
    font-size: 1.3em;
}

.dsb-bot-message ul,
.dsb-bot-message ol {
    padding-left: 2em;
}

.dsb-bot-message li {
    padding-left: 3em;
}

.dsb-bot-message strong {
    font-weight: bold;
}

.dsb-bot-message em {
    font-style: italic;
}

.dsb-bot-message iframe, .dsb-bot-message video, .dsb-bot-message audio, .dsb-bot-message img {
    float: left;
    border-radius: 7px;
    margin: 1em 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 550px;
    padding: 10px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 1em 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 100%;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.dsb-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    margin-bottom: 7px;
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 8px;
}