/* 
  Anshid's AI Assistant - Chatbot Styling
  Theme: Dark Green Neon
*/

.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    font-family: 'Montserrat', sans-serif;
}

/* Floating Toggle Button */
.chatbot-toggle {
    height: 55px;
    padding: 0 25px;
    background: linear-gradient(135deg, #0B2E2A 0%, #051512 100%);
    border: 2px solid #2EE6A6;
    border-radius: 51px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(46, 230, 166, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(46, 230, 166, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0); }
}

.toggle-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.toggle-label {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.chatbot-toggle:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 30px rgba(79, 255, 176, 0.7);
}

.chatbot-toggle.active {
    width: 60px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.chatbot-toggle.active .toggle-label {
    display: none;
}

/* Floating Bubble */
.chatbot-bubble {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: #0B2E2A;
    color: #FFFFFF;
    border: 1px solid #2EE6A6;
    padding: 12px 20px;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: bubbleFloat 3s ease-in-out infinite;
    z-index: 2001;
    transition: all 0.3s ease;
}

.chatbot-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 15px;
    width: 15px;
    height: 15px;
    background: #2EE6A6;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.chatbot-bubble.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: #050B0A;
    border: 1px solid rgba(46, 230, 166, 0.2);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(46, 230, 166, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
    background: rgba(11, 46, 42, 0.9);
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(46, 230, 166, 0.1);
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(46, 230, 166, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2EE6A6;
    font-size: 1.2rem;
    border: 1px solid rgba(46, 230, 166, 0.3);
}

.chatbot-header-info h4 {
    margin: 0;
    color: #E6FFF7;
    font-size: 1.1rem;
}

.chatbot-status {
    font-size: 0.8rem;
    color: #25D366;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #25D366;
    border-radius: 50%;
    display: inline-block;
}

/* Chat Messages Area */
.chatbot-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 230, 166, 0.15) transparent;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(46, 230, 166, 0.15);
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: msgAppear 0.3s ease forwards;
    word-wrap: break-word;
}

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

.message.bot {
    background: rgba(11, 46, 42, 0.9);
    color: #E6FFF7;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(46, 230, 166, 0.1);
}

.message.user {
    background: linear-gradient(135deg, #1fa378 0%, #0B2E2A 100%);
    color: #FFFFFF;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 5px 15px rgba(46, 230, 166, 0.2);
    border: 1px solid rgba(46, 230, 166, 0.2);
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 12px 18px;
    background: rgba(11, 46, 42, 0.9);
    border-radius: 18px;
    align-self: flex-start;
}

.dot {
    width: 6px;
    height: 6px;
    background: #2EE6A6;
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

/* Quick Replies */
.quick-replies {
    padding: 0 20px 15px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reply-btn {
    padding: 8px 16px;
    background: rgba(46, 230, 166, 0.04);
    border: 1px solid rgba(46, 230, 166, 0.3);
    border-radius: 50px;
    color: #2EE6A6;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reply-btn:hover {
    background: rgba(46, 230, 166, 0.12);
    border-color: #2EE6A6;
    transform: translateY(-2px);
}

/* Permanent CTAs Section */
.chatbot-ctas {
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(46, 230, 166, 0.08);
    background: rgba(11, 46, 42, 0.3);
}

.cta-link {
    flex: 1;
    padding: 8px 10px;
    background: rgba(46, 230, 166, 0.1);
    border: 1px solid rgba(46, 230, 166, 0.4);
    border-radius: 8px;
    color: #FFFFFF;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.cta-link:hover {
    background: #2EE6A6;
    color: #0B2E2A;
    transform: translateY(-2px);
}

/* Input Area */
.chatbot-input-area {
    padding: 15px 20px 25px 20px;
    background: rgba(11, 46, 42, 0.4);
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(46, 230, 166, 0.08);
}

.chatbot-input {
    flex-grow: 1;
    background: rgba(46, 230, 166, 0.04);
    border: 1px solid rgba(46, 230, 166, 0.15);
    border-radius: 12px;
    padding: 10px 15px;
    color: #E6FFF7;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.chatbot-input:focus {
    border-color: #2EE6A6;
    box-shadow: 0 0 12px rgba(46, 230, 166, 0.2);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    background: #0B2E2A;
    border: 2px solid #2EE6A6;
    border-radius: 10px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.chatbot-send:hover {
    background: #1fa378;
    color: #FFFFFF;
    border-color: #4FFFB0;
    box-shadow: 0 0 20px rgba(46, 230, 166, 0.3);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .chatbot-container {
        bottom: 20px;
        right: 20px;
    }
    .chatbot-window {
        width: calc(100vw - 40px);
        height: 500px;
        bottom: 75px;
    }
}
