/* Sleek, Premium Floating Chatbot Widget Styling - Light Glassmorphism Theme */

/* Floating Chat Trigger Bubble */
.fo-chat-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fo-chat-trigger:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.fo-chat-trigger svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* Green Pulsing Notification Badge */
.fo-chat-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background-color: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: fo-pulse 2s infinite;
}

@keyframes fo-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Main Chat Window Card */
.fo-chat-window {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 380px;
    height: 520px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 1px 8px rgba(15, 23, 42, 0.04);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.fo-chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Chat Header */
.fo-chat-header {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(241, 245, 249, 0.9));
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.fo-chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.fo-chat-header-title {
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    color: #0f172a;
    margin: 0;
}

.fo-chat-header-status {
    font-size: 11px;
    color: #22c55e;
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.fo-chat-header-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.fo-chat-header-close {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.fo-chat-header-close:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}

.fo-chat-header-close svg {
    width: 20px;
    height: 20px;
}

/* Chat Messages Display Panel */
.fo-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    background-color: #f8fafc;
}

/* Custom Scrollbar for Chat Box */
.fo-chat-messages::-webkit-scrollbar {
    width: 5px;
}
.fo-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.fo-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.08);
    border-radius: 4px;
}
.fo-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.16);
}

/* Chat Bubbles */
.fo-chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    font-family: inherit;
    border-radius: 12px;
    word-wrap: break-word;
    animation: fo-fade-in-up 0.3s ease;
}

@keyframes fo-fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bot and Agent message styles */
.fo-chat-bubble.bot,
.fo-chat-bubble.agent {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.05);
    color: #334155;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
}

/* User message styles */
.fo-chat-bubble.user {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

/* Bot Form Integration inside Chat */
.fo-chat-form-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
    box-sizing: border-box;
    animation: fo-fade-in-up 0.3s ease;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.fo-chat-input {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #0f172a;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fo-chat-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.fo-chat-button {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s, transform 0.1s;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.fo-chat-button:hover {
    filter: brightness(1.05);
}

.fo-chat-button:active {
    transform: scale(0.98);
}

/* Typing Indicator Animation */
.fo-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.04);
    border-radius: 12px;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.fo-chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    animation: fo-typing 1.4s infinite ease-in-out;
}

.fo-chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.fo-chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fo-typing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Chat Input Footer Area */
.fo-chat-footer {
    padding: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 10px;
}

.fo-chat-message-field {
    flex: 1;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #0f172a;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 13.5px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.fo-chat-message-field:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.fo-chat-send-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, filter 0.2s;
    outline: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.fo-chat-send-icon:hover {
    transform: scale(1.06);
    filter: brightness(1.05);
}

.fo-chat-send-icon:active {
    transform: scale(0.96);
}

.fo-chat-send-icon svg {
    width: 18px;
    height: 18px;
    transform: translateX(1px);
}

/* System Notifications */
.fo-chat-system-msg {
    text-align: center;
    font-size: 11px;
    color: #64748b;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.03);
    border-radius: 20px;
    width: fit-content;
    margin: 4px auto;
    font-weight: 500;
}

/* Responsive UI adjustments */
@media (max-width: 480px) {
    .fo-chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    
    .fo-chat-trigger {
        bottom: 20px;
        right: 20px;
    }
}

/* Premium Button Hover & Highlight Enhancements */
button, a.inline-flex, .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
button:hover, a.inline-flex:hover {
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35) !important;
}

/* Secondary/Card style button highlights - switch background to blue gradient */
button.bg-card:hover, a.bg-card:hover,
button.border-border:hover, a.border-border:hover,
button.border-input:hover, a.border-input:hover,
button.bg-secondary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: white !important;
    border-color: transparent !important;
}

/* General button highlight fallback for non-border buttons */
.rounded-lg.border:hover {
    border-color: rgba(37, 99, 235, 0.4) !important;
}
