/**
 * Chatbot - Professional Polish
 * 
 * Production-ready dark theme inspired by modern chatbots
 * Colors are dynamic from admin settings
 */

/* ===============================================
   Container & Layout - Modern Dark Theme
   =============================================== */

#chatbot-chatgpt.chatbot-wide,
#chatbot-chatgpt.chatbot-narrow,
.chatbot-floating-style,
.chatbot-embedded-style {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a2332;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Professional sizing */
#chatbot-chatgpt.chatbot-wide {
    width: 400px !important;
    height: 650px !important;
    max-height: 85vh;
}

#chatbot-chatgpt.chatbot-narrow {
    width: 360px !important;
    height: 580px !important;
    max-height: 80vh;
}

/* ===============================================
   Header - Modern Dark Design
   =============================================== */

#chatbot-chatgpt #chatbot-chatgpt-header,
#chatbot-chatgpt #chatbot-chatgpt-header-embedded,
.chatbot-floating-style #chatbot-chatgpt-header,
.chatbot-embedded-style #chatbot-chatgpt-header {
    /* Admin setting will override this */
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2942 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(244, 244, 244, 0.5);
    position: relative;
}

/* Header title styling */
#chatbot-chatgpt #chatbot-chatgpt-title,
.chatbot-floating-style #chatbot-chatgpt-title,
.chatbot-embedded-style #chatbot-chatgpt-title {
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
    margin: 0;
    padding: 0;
}

/* Header buttons */
#chatbot-chatgpt #chatbot-chatgpt-header button,
.chatbot-floating-style #chatbot-chatgpt-header button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#chatbot-chatgpt #chatbot-chatgpt-header button:hover,
.chatbot-floating-style #chatbot-chatgpt-header button:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Header button icons - Make visible on dark background */
#chatbot-chatgpt #chatbot-chatgpt-header button img,
.chatbot-floating-style #chatbot-chatgpt-header button img {
    width: 18px !important;
    height: 18px !important;
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

/* Header button text/icons */
#chatbot-chatgpt #chatbot-chatgpt-header button *,
.chatbot-floating-style #chatbot-chatgpt-header button * {
    color: #ffffff !important;
}

/* ===============================================
   Conversation Area - Dark Theme
   =============================================== */

#chatbot-chatgpt #chatbot-chatgpt-conversation,
.chatbot-floating-style #chatbot-chatgpt-conversation,
.chatbot-embedded-style #chatbot-chatgpt-conversation {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
    /* Admin setting will override this */
    background: #1a2332;
    scroll-behavior: smooth;
}

/* Custom scrollbar - Professional */
#chatbot-chatgpt #chatbot-chatgpt-conversation::-webkit-scrollbar,
.chatbot-floating-style #chatbot-chatgpt-conversation::-webkit-scrollbar {
    width: 5px;
}

#chatbot-chatgpt #chatbot-chatgpt-conversation::-webkit-scrollbar-track,
.chatbot-floating-style #chatbot-chatgpt-conversation::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

#chatbot-chatgpt #chatbot-chatgpt-conversation::-webkit-scrollbar-thumb,
.chatbot-floating-style #chatbot-chatgpt-conversation::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

#chatbot-chatgpt #chatbot-chatgpt-conversation::-webkit-scrollbar-thumb:hover,
.chatbot-floating-style #chatbot-chatgpt-conversation::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ===============================================
   Message Bubbles - Professional Dark Styling
   =============================================== */

#chatbot-chatgpt .chat-message,
.chatbot-floating-style .chat-message,
.chatbot-embedded-style .chat-message {
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User messages - Right aligned */
#chatbot-chatgpt .user-message,
.chatbot-floating-style .user-message {
    justify-content: flex-end;
}

#chatbot-chatgpt .chatbot-user-text,
.chatbot-floating-style .chatbot-user-text,
.chatbot-embedded-style .chatbot-user-text {
    /* Admin setting will override this */
    background: #000;
    color: #ffffff !important;
    padding: 11px 16px;
    border-radius: 16px 16px 4px 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 75%;
    word-wrap: break-word;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* Bot messages - Left aligned */
#chatbot-chatgpt .bot-message,
.chatbot-floating-style .bot-message {
    justify-content: flex-start;
}

#chatbot-chatgpt .chatbot-bot-text,
.chatbot-floating-style .chatbot-bot-text,
.chatbot-embedded-style .chatbot-bot-text {
    /* Admin setting will override this */
    background: #233244;
    color: #e5e7eb !important;
    padding: 11px 16px;
    border-radius: 16px 16px 16px 4px;
    font-size: 14px;
    line-height: 1.6;
    max-width: 82%;
    word-wrap: break-word;
    font-weight: 400;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Stronger text elements */
#chatbot-chatgpt .chatbot-bot-text strong,
#chatbot-chatgpt .chatbot-bot-text b,
.chatbot-floating-style .chatbot-bot-text strong,
.chatbot-floating-style .chatbot-bot-text b {
    color: #ffffff;
    font-weight: 600;
}

/* Lists in messages */
#chatbot-chatgpt .chatbot-bot-text ul,
#chatbot-chatgpt .chatbot-bot-text ol,
.chatbot-floating-style .chatbot-bot-text ul,
.chatbot-floating-style .chatbot-bot-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

#chatbot-chatgpt .chatbot-bot-text li,
.chatbot-floating-style .chatbot-bot-text li {
    margin: 4px 0;
}

/* Links in bot messages */
#chatbot-chatgpt .chatbot-bot-text a,
.chatbot-floating-style .chatbot-bot-text a {
    color: #60a5fa;
    text-decoration: none;
    border-bottom: 1px solid rgba(96, 165, 250, 0.3);
    transition: all 0.2s ease;
}

#chatbot-chatgpt .chatbot-bot-text a:hover,
.chatbot-floating-style .chatbot-bot-text a:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

/* Code blocks in messages */
#chatbot-chatgpt .chatbot-bot-text pre,
.chatbot-floating-style .chatbot-bot-text pre {
    background: #1a1f2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
}

#chatbot-chatgpt .chatbot-bot-text code,
.chatbot-floating-style .chatbot-bot-text code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    color: #93c5fd;
}

/* ===============================================
   Input Area - Modern Dark Design
   =============================================== */

#chatbot-chatgpt #chatbot-chatgpt-input,
.chatbot-floating-style #chatbot-chatgpt-input,
.chatbot-embedded-style #chatbot-chatgpt-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}

/* Textarea - Clean and prominent */
#chatbot-chatgpt #chatbot-chatgpt-message,
.chatbot-floating-style #chatbot-chatgpt-message,
.chatbot-embedded-style #chatbot-chatgpt-message {
    flex: 1;
    background: #ffffff !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #1f2937 !important;
    resize: none !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
    max-height: 120px;
    min-height: 44px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#chatbot-chatgpt #chatbot-chatgpt-message:focus,
.chatbot-floating-style #chatbot-chatgpt-message:focus,
.chatbot-embedded-style #chatbot-chatgpt-message:focus {
    outline: none !important;
    border-color: #000 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

#chatbot-chatgpt #chatbot-chatgpt-message::placeholder,
.chatbot-floating-style #chatbot-chatgpt-message::placeholder,
.chatbot-embedded-style #chatbot-chatgpt-message::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* ===============================================
   Buttons - Modern Dark Style
   =============================================== */

#chatbot-chatgpt #chatbot-chatgpt-submit,
.chatbot-floating-style #chatbot-chatgpt-submit {
    background: #000 !important;
    border: none !important;
    border-radius: 10px !important;
    width: 42px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
}

#chatbot-chatgpt #chatbot-chatgpt-submit:hover,
.chatbot-floating-style #chatbot-chatgpt-submit:hover {
    background: #2563eb !important;
    transform: translateY(-1px);
}

#chatbot-chatgpt #chatbot-chatgpt-submit:active,
.chatbot-floating-style #chatbot-chatgpt-submit:active {
    transform: translateY(0);
}

/* Submit button icon */
#chatbot-chatgpt #chatbot-chatgpt-submit img,
.chatbot-floating-style #chatbot-chatgpt-submit img {
    filter: brightness(0) invert(1);
    opacity: 1 !important;
}

/* Other action buttons */
#chatbot-chatgpt #chatbot-chatgpt-buttons-container,
.chatbot-floating-style #chatbot-chatgpt-buttons-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* #chatbot-chatgpt #chatbot-chatgpt-buttons-container button,
.chatbot-floating-style #chatbot-chatgpt-buttons-container button {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
} */

#chatbot-chatgpt #chatbot-chatgpt-buttons-container button:hover,
.chatbot-floating-style #chatbot-chatgpt-buttons-container button:hover {
    /* background: rgba(255, 255, 255, 0.15) !important; */
    transform: translateY(-1px);
}

/* Button icons - Make visible */
#chatbot-chatgpt #chatbot-chatgpt-buttons-container button img,
.chatbot-floating-style #chatbot-chatgpt-buttons-container button img {
    width: 18px !important;
    height: 18px !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease;
    filter: brightness(0.5) !important;
}

#chatbot-chatgpt #chatbot-chatgpt-buttons-container button:hover img,
.chatbot-floating-style #chatbot-chatgpt-buttons-container button:hover img {
    opacity: 1 !important;
    filter: brightness(0.3) !important;
}

/* ===============================================
   Typing Indicator - Professional Dark
   =============================================== */

#chatbot-chatgpt .chatbot-typing-indicator,
.chatbot-floating-style .chatbot-typing-indicator {
    background: #233244 !important;
    padding: 11px 16px !important;
    border-radius: 16px 16px 16px 4px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px;
}

#chatbot-chatgpt .chatbot-typing-dot,
.chatbot-floating-style .chatbot-typing-dot {
    width: 8px;
    height: 8px;
    background: #6b7280 !important;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

#chatbot-chatgpt .chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

#chatbot-chatgpt .chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* ===============================================
   Open Button - Professional
   =============================================== */

#chatgpt-open-btn {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: #000 !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

}

#chatgpt-open-btn:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5) !important;
}

#chatgpt-open-btn:active {
    transform: scale(0.95) !important;
}

/* ===============================================
   Avatar/Icon Styling
   =============================================== */

#chatbot-chatgpt .chatbot-avatar,
.chatbot-floating-style .chatbot-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

/* ===============================================
   Responsive Design
   =============================================== */

@media only screen and (max-width: 600px) {
    #chatbot-chatgpt.chatbot-wide,
    #chatbot-chatgpt.chatbot-narrow {
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 80px) !important;
        max-height: calc(100vh - 80px) !important;
        border-radius: 12px;
    }
    
    #chatbot-chatgpt .chatbot-user-text,
    #chatbot-chatgpt .chatbot-bot-text {
        font-size: 13px;
        max-width: 85%;
    }
    
    #chatbot-chatgpt #chatbot-chatgpt-header {
        padding: 14px 16px;
    }
}

/* ===============================================
   Ensure No Message Count Shows
   =============================================== */

#chatbot-chatgpt .chatbot-bot-text::after,
.chatbot-floating-style .chatbot-bot-text::after {
    content: '';
    display: none !important;
}


#chatgpt-open-btn{
    position: fixed !important;
    bottom: 20px !important;
    background-color: #000 !important
}
#chatgpt-open-btn:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 6px 25px 000 !important;
}

 #chatbot-chatgpt #chatbot-chatgpt-input, .chatbot-floating-style #chatbot-chatgpt-input, .chatbot-embedded-style #chatbot-chatgpt-input{
    
 }
 .inputbox-wrap {
    background: #F0F0F0 !important;
    border-radius: 70px !important;
    padding: 10px !important;
    display: flex !important;
    align-items: center !important;
}

.inputbox-wrap {
 
}

.chatgpt-upload-speech-box {
    display: flex;
}

#chatbot-chatgpt-submit, #chatbot-chatgpt-upload-file, #chatbot-chatgpt-upload-mp3, #chatbot-chatgpt-erase-btn, #chatbot-chatgpt-text-to-speech-btn, #chatbot-chatgpt-download-transcript-btn, #chatbot-chatgpt-speech-recognition-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 10px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: var(--chat-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.inputbox-wrap {
       display: flex !important;
    align-items: center !important;
    background: #F0F0F0;
    border-radius: 70px;
    padding: 20px;
}
#chatbot-chatgpt.chatbot-floating-style.chatbot-narrow #chatbot-chatgpt-input {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
}
#chatbot-chatgpt #chatbot-chatgpt-input, .chatbot-floating-style #chatbot-chatgpt-input, .chatbot-embedded-style #chatbot-chatgpt-input{
    padding: 0 !important;
}
#chatbot-chatgpt.chatbot-floating-style.chatbot-narrow #chatbot-chatgpt-input textarea {
    border: 0 !important;
    background: transparent !important;
    height: auto !important;
    padding: 0 10px 0 0 !important;
    vertical-align: middle !important;
    min-height: auto !important;
    outline: none !important;
    box-shadow: none !important;
}
 .inputbox-wrap .chatgpt-upload-speech-box button {
    box-shadow: none !important;
    border: none !important;
}
.inputbox-wrap .chatgpt-upload-speech-box #chatbot-chatgpt-upload-file {
 background: transparent !important;
}
.chatgpt-upload-speech-box #chatbot-chatgpt-speech-recognition-btn {
    background: #000 !important;
    border-radius: 100% !important;
}
.chatgpt-upload-speech-box button::after{
    content: none !important;
}
.chatgpt-upload-speech-box button img {
    display: block !important;
}
.chatgpt-upload-speech-box #chatbot-chatgpt-speech-recognition-btn img {
    height: 18px;
    width: 18px;
}
#chatbot-chatgpt #chatbot-chatgpt-header button, .chatbot-floating-style #chatbot-chatgpt-header button {padding: 0;}
#chatbot-chatgpt #chatbot-chatgpt-header .chatbot-header-actions button img, .chatbot-floating-style #chatbot-chatgpt-header button img {filter: none !important;display: block !important;}
#chatbot-chatgpt #chatbot-chatgpt-header .chatbot-header-actions button:after {display: none !important;}