/* ==========================================================================
   AI CHATBOT WIDGET STYLES - FEAR-LINK TECHNOLOGY CORPORATE PLATFORM
   ========================================================================== */

:root {
    --fl-primary: #0077FE;
    --fl-cyan: #00F0FF;
    --fl-bg-header: #0B132B;
    --fl-bg-body: #1C2541;
    --fl-gradient: linear-gradient(135deg, #0077FE 0%, #00F0FF 100%);
    --fl-border: rgba(0, 240, 255, 0.2);
    --fl-text-main: #f8fafc;
    --fl-text-muted: #a0aec0;
    --fl-bot-msg-bg: #0B132B;
    --fl-user-msg-bg: linear-gradient(135deg, #0077FE 0%, #0056b3 100%);
    --fl-shadow: 0 20px 40px rgba(11, 19, 43, 0.7);
}

/* Floating Action Button (FAB) */
#fl-chatbot-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--fl-gradient);
    color: #ffffff;
    border: 2px solid var(--fl-cyan);
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 240, 255, 0.4);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#fl-chatbot-fab:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(0, 240, 255, 0.6);
}

#fl-chatbot-fab .fl-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    z-index: -1;
    animation: fl-pulse-animation 2.2s infinite ease-out;
}

@keyframes fl-pulse-animation {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.65);
        opacity: 0;
    }
}

#fl-chatbot-fab .fl-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 14px;
    height: 14px;
    background: #00F0FF;
    border: 2px solid #0B132B;
    border-radius: 50%;
}

/* Chat Window Container */
#fl-chatbot-window {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 390px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - 130px);
    background: var(--fl-bg-body);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--fl-border);
    border-radius: 20px;
    box-shadow: var(--fl-shadow);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

/* Header */
.fl-header {
    background: var(--fl-bg-header);
    padding: 16px 20px;
    border-bottom: 1px solid var(--fl-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fl-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fl-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--fl-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 240, 255, 0.3);
}

.fl-title-group h4 {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.fl-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--fl-cyan);
    margin-top: 3px;
    font-weight: 600;
}

.fl-status-dot {
    width: 7px;
    height: 7px;
    background: var(--fl-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--fl-cyan);
}

.fl-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fl-btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--fl-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.fl-btn-icon:hover {
    background: rgba(0, 240, 255, 0.2);
    color: #ffffff;
}

/* Messages Body */
.fl-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
    background: #111827;
}

.fl-body::-webkit-scrollbar {
    width: 5px;
}
.fl-body::-webkit-scrollbar-track {
    background: transparent;
}
.fl-body::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.2);
    border-radius: 10px;
}

/* Message Bubble */
.fl-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fl-fade-in 0.25s ease-out forwards;
}

@keyframes fl-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fl-msg.fl-msg-bot {
    align-self: flex-start;
}

.fl-msg.fl-msg-user {
    align-self: flex-end;
}

.fl-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.fl-msg-bot .fl-bubble {
    background: var(--fl-bot-msg-bg);
    color: var(--fl-text-main);
    border: 1px solid var(--fl-border);
    border-top-left-radius: 4px;
}

.fl-msg-user .fl-bubble {
    background: var(--fl-user-msg-bg);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 119, 254, 0.3);
}

.fl-msg-time {
    font-size: 10px;
    color: var(--fl-text-muted);
    margin-top: 4px;
    align-self: flex-end;
}

.fl-msg-bot .fl-msg-time {
    align-self: flex-start;
}

/* Typing Indicator */
.fl-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 18px;
    background: var(--fl-bot-msg-bg);
    border: 1px solid var(--fl-border);
    border-radius: 16px;
    border-top-left-radius: 4px;
    width: fit-content;
}

.fl-typing span {
    width: 6px;
    height: 6px;
    background: var(--fl-cyan);
    border-radius: 50%;
    animation: fl-bounce 1.4s infinite ease-in-out both;
}

.fl-typing span:nth-child(1) { animation-delay: -0.32s; }
.fl-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes fl-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Quick Action Chips */
.fl-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.fl-chip {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: var(--fl-cyan);
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fl-chip:hover {
    background: var(--fl-cyan);
    color: #0B132B;
    border-color: var(--fl-cyan);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 240, 255, 0.4);
}

/* Footer / Input Area */
.fl-footer {
    padding: 12px 16px;
    background: var(--fl-bg-header);
    border-top: 1px solid var(--fl-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.fl-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.fl-input {
    width: 100%;
    background: #1C2541;
    border: 1px solid var(--fl-border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--fl-text-main);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s ease;
}

.fl-input:focus {
    border-color: var(--fl-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.fl-input::placeholder {
    color: var(--fl-text-muted);
}

.fl-send-btn {
    background: var(--fl-gradient);
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 119, 254, 0.4);
}

.fl-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 240, 255, 0.6);
}
