
/* Floating Chatbot Button - Fixed Version */
.chatbot-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    background: #3deaa4;
    color: #111318;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(61, 234, 164, 0.5);
    cursor: pointer;
    font-size: 28px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10000; /* Increased z-index */
    border: 2px solid #22252d;
    /* Ensure button stays visible and clickable */
    will-change: transform;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

/* Add these styles to your existing CSS */

/* Message content container */
.message-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Specific link styling */
.message a {
    color: #3deaa4;
    text-decoration: none;
    border-bottom: 1px dotted #3deaa4;
    transition: all 0.2s ease;
    word-break: break-all; /* This is key for long URLs */
    display: inline-block;
    max-width: 100%;
}

.message a:hover {
    color: #61fdb0;
    border-bottom-color: transparent;
}

/* For very long links that need to wrap */
.message-content a[href^="http"] {
    display: inline;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.chatbot-button:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 25px rgba(61, 234, 164, 0.7);
    background: #61fdb0;
}

.chatbot-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid #3deaa4;
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0;
}

/* Link preview styling */
.link-preview-container {
    max-width: 90%;
    margin: 10px auto;
    padding: 10px;
    background: #323641;
    border-radius: 8px;
    border-left: 3px solid #3deaa4;
    display: none;
}

.link-preview-container a {
    color: #3deaa4;
    text-decoration: none;
    word-break: break-word;
}

.link-preview-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.link-preview-description {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 5px;
}

.link-preview-url {
    font-size: 0.8em;
    color: #999;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    70% {
        transform: scale(1.1);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

.chatbot-button.active::after {
    animation: pulse 2s infinite;
}

/* Chatbot Container - Fixed Version */
#chat-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: calc(100vw - 40px);
    max-width: 350px;
    max-height: 70vh;
    background: #22252d;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: 'Poppins', sans-serif;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999; /* One less than button */
    border: 1px solid #323641;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
                opacity 0.3s ease;
    /* Mobile viewport fixes */
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    /* Ensure it doesn't block button */
    pointer-events: auto;
}

/* Add this to prevent any parent from blocking clicks */
body {
    position: relative;
    overflow-x: hidden;
}


#chat-container.active {
    transform: scale(1);
    opacity: 1;
    display: flex;
}

#chat-header {
    background: linear-gradient(135deg, #22252d 0%, #111318 100%);
    color: #61fdb0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    border-bottom: 1px solid #323641;
}

#chat-header span {
    cursor: pointer;
    color: #ccc;
    font-size: 20px;
    transition: all 0.3s ease;
}

#chat-header span:hover {
    color: #3deaa4;
    transform: rotate(90deg);
}

/* Chat Messages Area */
#chat-box {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #1a1c22;
    scrollbar-width: thin;
    scrollbar-color: #3deaa4 #1a1c22;
}

/* Custom scrollbar */
#chat-box::-webkit-scrollbar {
    width: 6px;
}

#chat-box::-webkit-scrollbar-track {
    background: #1a1c22;
}

#chat-box::-webkit-scrollbar-thumb {
    background-color: #3deaa4;
    border-radius: 3px;
}

/* Message Styles */
.message {
    max-width: 80%;
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    position: relative;
    animation: fadeIn 0.3s ease;
    word-wrap: break-word;
}

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

.user-message {
    background: #3deaa4;
    color: #111318;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background: #323641;
    color: #eee;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.bot-message::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #323641;
    border-left: 0;
    margin-top: 10px;
    margin-left: -10px;
}

.user-message::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 0;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-left-color: #3deaa4;
    border-right: 0;
    margin-top: 10px;
    margin-right: -10px;
}

.message-time {
    display: block;
    font-size: 10px;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    padding: 10px 15px;
    background: #323641;
    border-radius: 18px;
    width: fit-content;
    margin-bottom: 15px;
    border-bottom-left-radius: 5px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #61fdb0;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.5s infinite ease-in-out;
}

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

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

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Input Area */
#chat-input-container {
    display: flex;
    border-top: 1px solid #323641;
    background: #22252d;
    padding: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    outline: none;
    background: #1a1c22;
    color: #eee;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    margin-right: 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

#chat-input:focus {
    border-color: #3deaa4;
    box-shadow: 0 0 0 2px rgba(61, 234, 164, 0.2);
}

#send-btn {
    background: #3deaa4;
    color: #111318;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#send-btn:hover {
    background: #61fdb0;
    transform: rotate(15deg) scale(1.1);
}

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 20px;
    background: #1a1c22;
    border-top: 1px solid #323641;
}

.quick-reply-btn {
    padding: 8px 12px;
    background: #323641;
    color: #eee;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-reply-btn:hover {
    background: #3deaa4;
    color: #111318;
    transform: translateY(-2px);
}

/* Chatbot Status Indicator */
.chatbot-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #ccc;
    padding: 5px 20px;
    background: #1a1c22;
    border-top: 1px solid #323641;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3deaa4;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .chatbot-button {
        width: 56px;
        height: 56px;
        font-size: 24px;
        bottom: 20px;
        right: 15px;
    }
    
    #chat-container {
        width: calc(100vw - 30px);
        right: 15px;
        bottom: 86px;
    }
    
    #chat-box {
        height: calc(70vh - 150px);
    }
}

@media (max-width: 480px) {
    .chatbot-button {
        width: 50px;
        height: 50px;
        font-size: 22px;
        bottom: 15px;
        right: 10px;
    }
    
    #chat-container {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 75px;
        max-height: 65vh;
    }
    
    #chat-box {
        height: calc(65vh - 150px);
    }
}

/* Keyboard open adjustments */
.keyboard-open #chat-container {
    bottom: 20px !important;
    max-height: 50vh;
}

.keyboard-open #chat-box {
    height: calc(50vh - 150px);
}


/* Loading Animation */
.loading-animation {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 20px;
    margin-left: 10px;
}

.loading-animation div {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #3deaa4;
    border-radius: 50%;
    animation: loading 1.2s linear infinite;
}

.loading-animation div:nth-child(1) {
    animation-delay: 0s;
    top: 8px;
    left: 0;
}

.loading-animation div:nth-child(2) {
    animation-delay: 0.2s;
    top: 4px;
    left: 4px;
}

.loading-animation div:nth-child(3) {
    animation-delay: 0.4s;
    top: 0;
    left: 8px;
}

.loading-animation div:nth-child(4) {
    animation-delay: 0.6s;
    top: 4px;
    left: 12px;
}

.loading-animation div:nth-child(5) {
    animation-delay: 0.8s;
    top: 8px;
    left: 16px;
}

@keyframes loading {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Social Media Styling */
.social-media-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.social-media-label {
    min-width: 120px;
    color: #e0e0e0;
    font-weight: 500;
}

.social-link {
    color: #3deaa4;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: 5px;
    font-weight: 500;
}

.social-link:hover {
    background-color: rgba(61, 234, 164, 0.1);
}

/* Platform-specific colors */
.linkedin-link { color: #0a66c2; }
.github-link { color: #f0f6fc; }
.youtube-link { color: #ff0000; }
.discord-link { color: #5865f2; }

.social-link:hover {
    transform: translateY(-1px);
    text-decoration: underline;
}

/* Link Styling in Messages */
.message a {
    color: #3deaa4;
    text-decoration: none;
    border-bottom: 1px dotted #3deaa4;
    transition: all 0.2s ease;
}

.message a:hover {
    color: #61fdb0;
    border-bottom-color: transparent;
}

/* Code Block Styling */
.code-block {
    background: #111318;
    border: 1px solid #323641;
    border-radius: 5px;
    padding: 10px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    overflow-x: auto;
    color: #61fdb0;
}

/* System Message Styling */
.system-message {
    background: rgba(61, 234, 164, 0.1);
    border-left: 3px solid #3deaa4;
    padding: 10px 15px;
    margin: 10px 0;
    font-size: 13px;
    color: #61fdb0;
    border-radius: 0 5px 5px 0;
}

/* Message Options */
.message-options {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.option-btn {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 12px;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover {
    color: #3deaa4;
}

