/* AIConverse Chatbot Styles */
.aiconverse-chat-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #00000000;
    border: 4px solid #0000001f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9999;
}

.aiconverse-chat-trigger:hover {
    background: #0a84ff;
    transform: scale(1.1);
}

.aiconverse-chat-trigger svg {
    width: 24px;
    height: 24px;
}

.aiconverse-chat-trigger img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.aiconverse-chat-trigger span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 24px;
}

.aiconverse-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
}

.aiconverse-chat-window.active {
    display: flex;
}

.aiconverse-chat-header {
    background: linear-gradient(90deg,rgba(0, 136, 255, 1) 0%, rgba(0, 111, 255, 1) 50%, rgba(90, 39, 230, 1) 100%);
    color: #ffffff;
    border-bottom: 1px solid #ebebeb;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aiconverse-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.aiconverse-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aiconverse-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.aiconverse-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: rgb(249 250 251);
    scroll-behavior: smooth;
}

.aiconverse-message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.aiconverse-message.user {
    justify-content: flex-end;
}

.aiconverse-message.ai {
    justify-content: flex-start;
}

.aiconverse-message-content {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-line;
    word-wrap: break-word;
    transition: all 0.2s ease;
}

.aiconverse-message.user .aiconverse-message-content {
    background: linear-gradient(90deg, rgb(40 116 255) 0%, rgb(0 100 255) 18%, rgb(65 27 255) 100%);
    color: white;
    animation: slideInRight 0.4s ease-out;
}

.aiconverse-message.ai .aiconverse-message-content {
    background: white;
    color: #333;
    animation: slideInLeft 0.4s ease-out;
}

.aiconverse-message-content:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aiconverse-chat-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.aiconverse-chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}

.aiconverse-chat-input:focus {
    border-color: #6f6e6e;
    border: 2px solid #0324ff36;
}

.aiconverse-send-btn {
    background: linear-gradient(90deg, rgb(51 123 255) 0%, rgb(0 112 255) 18%, rgb(65 27 255) 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.aiconverse-send-btn:hover {
    background: linear-gradient(90deg, rgb(75 180 204) 0%, rgb(31 195 106) 25%, rgb(12 169  0) 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.aiconverse-send-btn:active {
    transform: scale(0.95);
}

.aiconverse-send-btn svg {
    width: 18px;
    height: 18px;
}

.aiconverse-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 15px;
    animation: fadeIn 0.3s ease-out;
}

.aiconverse-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999999;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.aiconverse-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.aiconverse-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .aiconverse-chat-trigger {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    .aiconverse-chat-window {
        bottom: 75px;
        right: 15px;
        width: calc(100vw - 30px);
        height: 60vh;
        max-height: 500px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aiconverse-chat-window {
        background: #1a1a1a;
    }
    
    .aiconverse-chat-messages {
        background: rgb(249 250 251);
    }
    
    .aiconverse-message.ai .aiconverse-message-content {
        background: rgb(243 244 246);
        color: #000000;
    }
    
    .aiconverse-chat-input {
        background: #ffffff;
        color: #1c1c1c;
        border-color: #dddddd;
    }
    
    .aiconverse-chat-input-container {
        background: #ffffff;
        border-top-color: #ebebeb;
    }
}

/* Animation for chat window */
.aiconverse-chat-window {
    transition: all 0.3s ease;
    transform: scale(0.8);
    opacity: 0;
    transform-origin: bottom right;
}

.aiconverse-chat-window.active {
    transform: scale(1);
    opacity: 1;
}

/* Accessibility - reduced motion */
@media (prefers-reduced-motion: reduce) {
    .aiconverse-message,
    .aiconverse-message.user .aiconverse-message-content,
    .aiconverse-message.ai .aiconverse-message-content,
    .aiconverse-typing-indicator {
        animation: none;
    }
    
    .aiconverse-chat-messages {
        scroll-behavior: auto;
    }
}

/* Ensure elements are visible */
.aiconverse-chat-trigger,
.aiconverse-chat-window {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force display for testing */
.aiconverse-chat-trigger {
    display: flex !important;
}

.aiconverse-chat-window {
    display: none !important;
}

.aiconverse-chat-window.active {
    display: flex !important;
}