/* AI Chatbot Widget */
:root {
    --fx-primary-color: #00DB42;
    --fx-secondary-color: #00B935;
    --fx-accent-color: #00FF47;
    --fx-dark-bg: #1a1a1a;
    --fx-light-bg: #f8f9fa;
    --fx-text-dark: #333333;
    --fx-text-light: #ffffff;
    --fx-border-color: #e9ecef;
    --fx-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.fx-chatbot {
    position: fixed;
    bottom: 110px;
    right: 2.4rem;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

    .fx-chatbot.dragging {
        user-select: none;
    }

.fx-chatbot-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    color: var(--fx-text-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

    .fx-chatbot-trigger:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    }

    .fx-chatbot-trigger.active {
        transform: rotate(45deg);
        background: #ff6b6b;
    }

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 10px rgba(102, 126, 234, 0.1);
    }

    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

.fx-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

    .fx-chatbot-window.active {
        display: flex;
    }

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fx-chatbot-header {
    background: linear-gradient(135deg, #0f9c2a, var(--fx-secondary-color));
    color: var(--fx-text-light);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
}

    .fx-chatbot-header:active {
        cursor: grabbing;
    }

.fx-chatbot-window.dragging .fx-chatbot-header {
    cursor: grabbing;
}

.fx-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fx-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

    .fx-chatbot-avatar img {
        width: 50px;
        object-fit: cover;
    }

.fx-chatbot-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.fx-chatbot-status {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

.fx-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

    .fx-chatbot-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }

.fx-chatbot-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

    .fx-chatbot-messages::-webkit-scrollbar {
        width: 6px;
    }

    .fx-chatbot-messages::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .fx-chatbot-messages::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 10px;
    }

        .fx-chatbot-messages::-webkit-scrollbar-thumb:hover {
            background: #bbb;
        }

.fx-message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fx-message.user {
    background: linear-gradient(135deg, #1b833a, var(--fx-secondary-color));
    color: var(--fx-text-light);
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 2px 10px rgba(0, 219, 66, 0.3);
}

.fx-message.bot {
    background: var(--fx-text-light);
    color: var(--fx-text-dark);
    align-self: flex-start;
    border: 1px solid var(--fx-border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

    .fx-message.bot::before {
        content: '';
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid white;
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
    }

.fx-typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 18px;
    align-self: flex-start;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fx-typing-dots {
    display: flex;
    gap: 0.25rem;
}

.fx-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typing 1.4s infinite;
}

    .fx-typing-dot:nth-child(2) {
        animation-delay: 0.2s;
    }

    .fx-typing-dot:nth-child(3) {
        animation-delay: 0.4s;
    }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.fx-suggested-questions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.fx-suggested-question {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: #144c25;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

    .fx-suggested-question:hover {
        background: rgba(102, 126, 234, 0.2);
        transform: translateY(-2px);
    }

/* Improved suggested questions */
.fx-suggested-question {
    background: rgba(0, 219, 66, 0.1);
    border: 1px solid rgba(0, 219, 66, 0.2);
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

    .fx-suggested-question:hover {
        background: rgba(0, 219, 66, 0.2);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 219, 66, 0.2);
    }


.fx-chatbot-input-area {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background: white;
}

.fx-chatbot-input-wrapper {
    position: relative;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.fx-chatbot-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
    max-height: 100px;
    min-height: 44px;
}

    .fx-chatbot-input:focus {
        border-color: var(--fx-primary-color);
        box-shadow: 0 0 0 3px rgba(0, 219, 66, 0.1);
    }

.fx-chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #219544;
    color: var(--fx-text-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 219, 66, 0.3);
}

    .fx-chatbot-send:hover {
        background: var(--fx-secondary-color);
        transform: scale(1.1);
        box-shadow: 0 4px 15px rgba(0, 219, 66, 0.4);
    }

    .fx-chatbot-send:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }

.fx-chatbot-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fx-chatbot-action {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    display: flex;
}

    .fx-chatbot-action:hover {
        background: #f8f9fa;
        border-color: var(--primary-color);
    }

    .fx-chatbot-action i {
        margin-right: 0.25rem;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .fx-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(70vh - 120px);
        bottom: 90px;
        right: 20px;
        left: 20px;
    }

    .fx-chatbot-trigger {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Connection Status */
.fx-connection-status {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #28a745;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

    .fx-connection-status.disconnected {
        background: #dc3545;
        animation: blink 1s infinite;
    }

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }

    51%, 100% {
        opacity: 0.3;
    }
}

/* Message Timestamps */
.fx-message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 0.25rem;
}

/* Quick Actions */
.fx-quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.fx-quick-action {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .fx-quick-action:hover {
        background: rgba(102, 126, 234, 0.2);
        transform: translateY(-1px);
    }

/* Callback Form */
.fx-callback-form {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid #e9ecef;
}

    .fx-callback-form h4 {
        margin: 0 0 0.75rem 0;
        color: var(--primary-color);
        font-size: 1rem;
    }

    .fx-callback-form input,
    .fx-callback-form textarea {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        font-family: inherit;
    }

    .fx-callback-form button {
        width: 100%;
        padding: 0.5rem;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.8rem;
        transition: background-color 0.3s ease;
    }

        .fx-callback-form button:hover {
            background: var(--fx-secondary-color);
        }

/* Disclaimer */
.fx-disclaimer {
    padding: 0.75rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.fx-disclaimer-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #856404;
}

    .fx-disclaimer-content i {
        color: #ffc107;
        font-size: 1rem;
        flex-shrink: 0;
    }

/* Drag States */
.fx-chatbot-window.dragging {
    transition: none !important;
    z-index: 10001;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
}

    .fx-chatbot-window.dragging .fx-chatbot-messages {
        pointer-events: none;
    }

    .fx-chatbot-window.dragging .fx-chatbot-input-area {
        pointer-events: none;
    }

/* Enhanced animations */
.fx-chatbot-window {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fx-chatbot-trigger {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Message counter indicator */
.fx-message-counter {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    animation: counterPulse 2s infinite;
}

@keyframes counterPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Rate limit warning */
.fx-rate-limit-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #721c24;
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .fx-rate-limit-warning i {
        color: #dc3545;
        font-size: 1.1rem;
    }

/* Enhanced typing indicator */
.fx-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fx-primary-color);
    animation: typing 1.4s infinite;
}

/* Enhanced quick actions */
.fx-quick-action {
    background: rgba(0, 219, 66, 0.1);
    border: 1px solid rgba(0, 219, 66, 0.2);
    color: var(--fx-primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .fx-quick-action:hover {
        background: rgba(0, 219, 66, 0.2);
        transform: translateY(-1px);
    }

/* Custom Alert System */
.fx-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .fx-alert-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.fx-alert-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fx-alert-overlay.active .fx-alert-container {
    transform: scale(1) translateY(0);
}

.fx-alert-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    text-align: center;
    position: relative;
}

.fx-alert-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    font-size: 1.8rem;
    color: white;
}

    .fx-alert-icon.success {
        background: linear-gradient(135deg, #28a745, #20c997);
    }

    .fx-alert-icon.error {
        background: linear-gradient(135deg, #dc3545, #e74c3c);
    }

    .fx-alert-icon.warning {
        background: linear-gradient(135deg, #ffc107, #f39c12);
    }

    .fx-alert-icon.info {
        background: linear-gradient(135deg, var(--fx-primary-color), var(--fx-secondary-color));
    }

.fx-alert-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fx-text-dark);
    margin: 0 0 0.5rem 0;
}

.fx-alert-message {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

.fx-alert-body {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.fx-alert-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.fx-alert-button {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

    .fx-alert-button.primary {
        background: var(--fx-primary-color);
        color: white;
    }

        .fx-alert-button.primary:hover {
            background: var(--fx-secondary-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0, 219, 66, 0.3);
        }

    .fx-alert-button.secondary {
        background: #f8f9fa;
        color: var(--fx-text-dark);
        border: 1px solid #e9ecef;
    }

        .fx-alert-button.secondary:hover {
            background: #e9ecef;
            transform: translateY(-2px);
        }

.fx-alert-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #adb5bd;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    .fx-alert-close:hover {
        background: #f8f9fa;
        color: var(--fx-text-dark);
    }

.fx-alert-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
}

    .fx-alert-input:focus {
        outline: none;
        border-color: var(--fx-primary-color);
        box-shadow: 0 0 0 3px rgba(0, 219, 66, 0.1);
    }

/* Responsive */
@media (max-width: 480px) {
    .fx-alert-container {
        max-width: 95%;
        margin: 1rem;
    }

    .fx-alert-actions {
        flex-direction: column;
    }

    .fx-alert-button {
        width: 100%;
    }
}

/* Animation keyframes */
@keyframes fxAlertSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fxAlertSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
}

/* Sample Questions Title */
.fx-sample-questions-title {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Contact Button */
.fx-contact-button-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

.fx-contact-button {
    background: linear-gradient(135deg, var(--fx-primary-color), var(--fx-secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 219, 66, 0.3);
}

    .fx-contact-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 219, 66, 0.4);
    }

    .fx-contact-button i {
        font-size: 1.1rem;
    }

/* Copy Button */
.fx-message.bot {
    position: relative;
}

.fx-copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e9ecef;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    color: #666;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.fx-message.bot:hover .fx-copy-button {
    opacity: 1;
    visibility: visible;
}

.fx-copy-button:hover {
    background: #f8f9fa;
    color: var(--fx-primary-color);
    transform: scale(1.1);
}

/* Message content wrapper */
.fx-message-content {
    position: relative;
    padding-right: 20px;
}

@media (max-width: 768px) {
    .fx-chatbot {
        bottom: 110px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}
