/* ISA Chat Widget CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

#isa-chat-widget-container {
    font-family: 'Inter', sans-serif;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
}

/* Bubble Button */
#isa-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6, #60a5fa);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    border: none;
    outline: none;
}

#isa-chat-bubble:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.6);
}

#isa-chat-bubble svg {
    width: 30px;
    height: 30px;
    fill: white;
    transition: transform 0.3s ease;
}

#isa-chat-bubble.isa-open svg {
    transform: rotate(90deg) scale(0);
}

/* Close Icon (hidden by default) */
#isa-chat-bubble .isa-close-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    fill: white;
    transform: rotate(-90deg) scale(0);
    transition: transform 0.3s ease;
}

#isa-chat-bubble.isa-open .isa-close-icon {
    transform: rotate(0) scale(1);
}

/* Chat Window */
#isa-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#isa-chat-window.isa-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
#isa-chat-header {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.isa-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2563eb;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.isa-header-text {
    display: flex;
    flex-direction: column;
}

.isa-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.isa-subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
    margin: 0;
}

/* Messages Area */
#isa-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

/* Scrollbar */
#isa-chat-messages::-webkit-scrollbar {
    width: 6px;
}
#isa-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#isa-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Message Bubbles */
.isa-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    text-align: left !important;
    animation: isa-fade-in-up 0.3s ease forwards;
}

@keyframes isa-fade-in-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.isa-msg-bot {
    background: white;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.isa-msg-user {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.isa-msg-bot a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.isa-msg-bot a:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.isa-typing {
    display: flex;
    gap: 4px;
    padding: 14px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    align-items: center;
}

.isa-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: isa-bounce 1.4s infinite ease-in-out both;
}

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

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

/* Input Area */
#isa-chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    align-items: center;
}

#isa-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 24px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
}

#isa-chat-input:focus {
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#isa-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

#isa-chat-send:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

#isa-chat-send:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}

#isa-chat-send svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    margin-left: 2px;
}

/* Responsive for Mobile */
@media (max-width: 480px) {
    #isa-chat-window {
        width: calc(100vw - 40px);
        height: 600px;
        bottom: 80px;
        right: -4px;
    }
}
