/* Finowings Chatbot Widget Styles */

/* Chatbot Container */
.fw-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Nunito', sans-serif;
}

/* Chat Toggle Button */
.fw-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #cf9c0a 0%, #b8890a 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(207, 156, 10, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.fw-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(207, 156, 10, 0.5);
}

.fw-chat-toggle svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    transition: all 0.3s ease;
}

.fw-chat-toggle .close-icon {
    display: none;
}

.fw-chat-toggle.active .chat-icon {
    display: none;
}

.fw-chat-toggle.active .close-icon {
    display: block;
}

/* Notification Badge */
.fw-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #dc3545;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.fw-chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.fw-chat-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.fw-chat-header {
    background: linear-gradient(135deg, #273158 0%, #1a2040 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fw-chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.fw-chat-avatar img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.fw-chat-header-info {
    flex: 1;
}

.fw-chat-header-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.fw-chat-header-status {
    color: #4ade80;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.fw-chat-header-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fw-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fw-chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.fw-chat-close svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* Chat Messages Area */
.fw-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fb;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fw-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.fw-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.fw-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* Message Bubbles */
.fw-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fw-message.bot {
    align-self: flex-start;
}

.fw-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.fw-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #273158;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fw-message-avatar img {
    width: 22px;
    height: 22px;
}

.fw-message-avatar.user-avatar {
    background: #cf9c0a;
}

.fw-message-avatar.user-avatar svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.fw-message-content {
    background: #fff;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.fw-message.bot .fw-message-content {
    border-bottom-left-radius: 4px;
}

.fw-message.user .fw-message-content {
    background: linear-gradient(135deg, #273158 0%, #1a2040 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.fw-message-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    color: #333;
}

.fw-message.user .fw-message-text {
    color: #fff;
}

.fw-message-time {
    font-size: 10px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.fw-message.user .fw-message-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Quick Replies */
.fw-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.fw-quick-reply {
    background: #f0f2f5;
    border: 1px solid #e0e3e8;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #273158;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fw-quick-reply:hover {
    background: #273158;
    color: #fff;
    border-color: #273158;
}

/* Typing Indicator */
.fw-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.fw-typing span {
    width: 8px;
    height: 8px;
    background: #273158;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.fw-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.fw-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Chat Input Area */
.fw-chat-input-area {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.fw-chat-input {
    flex: 1;
    border: 1px solid #e0e3e8;
    border-radius: 25px;
    padding: 12px 18px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.fw-chat-input:focus {
    border-color: #273158;
    box-shadow: 0 0 0 3px rgba(39, 49, 88, 0.1);
}

.fw-chat-input::placeholder {
    color: #999;
}

.fw-chat-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #cf9c0a 0%, #b8890a 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fw-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(207, 156, 10, 0.4);
}

.fw-chat-send svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    margin-left: 2px;
}

/* Welcome Message Special Styling */
.fw-welcome-message .fw-message-text {
    margin-bottom: 8px;
}

.fw-welcome-message .fw-welcome-emoji {
    font-size: 24px;
    margin-right: 8px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .fw-chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        max-height: 500px;
        right: -5px;
        bottom: 70px;
    }
    
    .fw-chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .fw-chat-toggle {
        width: 55px;
        height: 55px;
    }
}

/* Powered By Footer */
.fw-chat-footer {
    text-align: center;
    padding: 8px;
    background: #f8f9fb;
    font-size: 11px;
    color: #999;
    border-top: 1px solid #eee;
}

.fw-chat-footer a {
    color: #273158;
    text-decoration: none;
    font-weight: 600;
}

/* Message Links Styling */
.fw-message-content a {
    color: #cf9c0a;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.fw-message-content a:hover {
    color: #273158;
    text-decoration: underline;
}

.fw-message.user .fw-message-content a {
    color: #fff;
    text-decoration: underline;
}

.fw-message-content b {
    color: #273158;
    font-weight: 700;
}

.fw-message.user .fw-message-content b {
    color: #fff;
}

/* Course list styling */
.fw-message-text a {
    display: inline;
    word-break: break-word;
}

.fw-message-text br + a {
    margin-top: 2px;
}


/* Option Buttons */
.fw-chat-options {
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid #eee;
}

.fw-option-btn {
    background: #fff;
    border: 1px solid #273158;
    color: #273158;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.fw-option-btn:hover {
    background: #273158;
    color: #fff;
}

/* WhatsApp Join Community Button */
.fw-whatsapp-join-btn {
    display: inline-block !important;
    background: #25D366 !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    margin-top: 10px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.3) !important;
}

.fw-whatsapp-join-btn:hover {
    background: #20BA5A !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(37, 211, 102, 0.4) !important;
    color: #fff !important;
    text-decoration: none !important;
}