/* JLink FREE AI Chat Assistant Styles */
#jlink-ai-chat-free-widget {
    font-family: 'Poppins', sans-serif;
    z-index: 10000;
    position: relative;
}

/* Chat Button with Pulse Animation */
.jlink-ai-chat-free-button {
    position: fixed;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--jlink-theme-color, #4f46e5) 0%, #7c3aed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 10001;
    border: none;
    outline: none;
    animation: jlink-ai-float 3s ease-in-out infinite;
}

.jlink-ai-chat-free-button.jlink-ai-position-right {
    bottom: 30px;
    right: 30px;
}

.jlink-ai-chat-free-button.jlink-ai-position-left {
    bottom: 30px;
    left: 30px;
}

.jlink-ai-chat-free-button:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    animation: none;
}

.jlink-ai-chat-free-button i {
    color: white;
    font-size: 26px;
}

/* Pulse Animation */
.jlink-ai-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--jlink-theme-color, #4f46e5);
    animation: jlink-ai-pulse 2s infinite;
    opacity: 0.6;
}

@keyframes jlink-ai-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes jlink-ai-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    70% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Chat Container */
.jlink-ai-chat-free-container {
    position: fixed;
    width: 400px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10002;
    animation: jlink-ai-chat-slide-in 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.jlink-ai-chat-free-container.jlink-ai-position-right {
    bottom: 110px;
    right: 30px;
}

.jlink-ai-chat-free-container.jlink-ai-position-left {
    bottom: 110px;
    left: 30px;
}

@keyframes jlink-ai-chat-slide-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Header */
.jlink-ai-chat-free-header {
    background: linear-gradient(135deg, var(--jlink-theme-color, #4f46e5), #7c3aed);
    color: white;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.jlink-ai-chat-free-title {
    font-weight: 600;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.jlink-ai-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: jlink-ai-status-pulse 2s infinite;
}

@keyframes jlink-ai-status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.jlink-ai-chat-free-close {
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
}

.jlink-ai-chat-free-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Chat Messages Area */
.jlink-ai-chat-free-messages {
    flex: 1;
    padding: 22px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.jlink-ai-welcome-free-message {
    background: white;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    text-align: center;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Message Bubbles */
.jlink-ai-message-free {
    max-width: 82%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: jlink-ai-message-slide 0.3s ease-out;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@keyframes jlink-ai-message-slide {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jlink-ai-message-free-user {
    background: linear-gradient(135deg, var(--jlink-theme-color, #4f46e5), #7c3aed);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 8px;
}

.jlink-ai-message-free-ai {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    margin-right: auto;
    border-bottom-left-radius: 8px;
}

/* Typing Indicator */
.jlink-ai-typing-free-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-style: italic;
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
}

.jlink-ai-typing-free-dots {
    display: flex;
    gap: 5px;
}

.jlink-ai-typing-free-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--jlink-theme-color, #4f46e5);
    animation: jlink-ai-typing-bounce 1.4s infinite ease-in-out;
}

.jlink-ai-typing-free-dots span:nth-child(1) { animation-delay: -0.32s; }
.jlink-ai-typing-free-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes jlink-ai-typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.jlink-ai-typing-free-text {
    font-style: italic;
    color: #6b7280;
}

/* Chat Input */
.jlink-ai-chat-free-input-container {
    display: flex;
    padding: 18px;
    background: white;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
    flex-shrink: 0;
}

#jlink-ai-chat-free-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: #f9fafb;
}

#jlink-ai-chat-free-input:focus {
    border-color: var(--jlink-theme-color, #4f46e5);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#jlink-ai-chat-free-input:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

.jlink-ai-send-free-button {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--jlink-theme-color, #4f46e5), #7c3aed);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.jlink-ai-send-free-button:hover:not(:disabled) {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.jlink-ai-send-free-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Scrollbar Styling */
.jlink-ai-chat-free-messages::-webkit-scrollbar {
    width: 6px;
}

.jlink-ai-chat-free-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.jlink-ai-chat-free-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.jlink-ai-chat-free-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Error Message */
.jlink-ai-error-free {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
    text-align: center;
    font-size: 13px;
    padding: 12px 16px !important;
    border-radius: 12px !important;
}

/* Success Message */
.jlink-ai-success-free {
    background: #f0fdf4 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0 !important;
    text-align: center;
    font-size: 13px;
    padding: 12px 16px !important;
    border-radius: 12px !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .jlink-ai-chat-free-container {
        width: calc(100vw - 40px);
        height: 65vh;
        max-width: none;
        border-radius: 16px;
    }
    
    .jlink-ai-chat-free-container.jlink-ai-position-right {
        right: 20px;
        bottom: 90px;
    }
    
    .jlink-ai-chat-free-container.jlink-ai-position-left {
        left: 20px;
        bottom: 90px;
    }
    
    .jlink-ai-chat-free-button {
        width: 60px;
        height: 60px;
    }
    
    .jlink-ai-chat-free-button.jlink-ai-position-right {
        bottom: 20px;
        right: 20px;
    }
    
    .jlink-ai-chat-free-button.jlink-ai-position-left {
        bottom: 20px;
        left: 20px;
    }
    
    .jlink-ai-message-free {
        max-width: 88%;
        font-size: 13px;
    }
    
    .jlink-ai-chat-free-header {
        padding: 15px 18px;
    }
    
    .jlink-ai-chat-free-messages {
        padding: 18px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .jlink-ai-chat-free-container {
        height: 70vh;
    }
    
    .jlink-ai-chat-free-button {
        width: 55px;
        height: 55px;
    }
    
    .jlink-ai-chat-free-button i {
        font-size: 22px;
    }
}

/* Print Styles */
@media print {
    #jlink-ai-chat-free-widget {
        display: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .jlink-ai-chat-free-container {
        background: #1f2937;
    }
    
    .jlink-ai-chat-free-messages {
        background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    }
    
    .jlink-ai-welcome-free-message {
        background: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .jlink-ai-message-free-ai {
        background: #374151;
        color: #e5e7eb;
        border-color: #4b5563;
    }
    
    #jlink-ai-chat-free-input {
        background: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    #jlink-ai-chat-free-input:focus {
        background: #4b5563;
    }
}