.ai-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.ai-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.ai-chat-button i {
    transition: transform 0.3s ease;
}

.ai-chat-button.active i {
    transform: rotate(180deg);
}

.ai-chat-popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-popup.active {
    display: flex;
}

.ai-chat-header {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h6 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ai-chat-close:hover {
    opacity: 1;
}

.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeInUp 0.3s ease-out;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.ai-message.user .ai-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    background: white;
    border: 1px solid #e2e8f0;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

/* Markdown Styling */
.ai-message-bubble ul, 
.ai-message-bubble ol {
    padding-left: 20px;
    margin: 8px 0;
}

.ai-message-bubble li {
    margin: 4px 0;
}

.ai-message-bubble p {
    margin: 8px 0;
}

.ai-message-bubble strong,
.ai-message-bubble b {
    font-weight: 600;
}

.ai-message-bubble em,
.ai-message-bubble i {
    font-style: italic;
}

.ai-message-bubble h1,
.ai-message-bubble h2,
.ai-message-bubble h3,
.ai-message-bubble h4,
.ai-message-bubble h5,
.ai-message-bubble h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.ai-message-bubble code {
    background: #f7fafc;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 90%;
    color: #2d3748;
}

.ai-message-bubble pre {
    background: #f7fafc;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.ai-message-bubble pre code {
    background: none;
    padding: 0;
}

.ai-message-bubble blockquote {
    border-left: 4px solid #e2e8f0;
    margin: 8px 0;
    padding: 8px 16px;
    color: #4a5568;
    background: #f7fafc;
}

.ai-message-bubble a {
    color: #3182ce;
    text-decoration: none;
}

.ai-message-bubble a:hover {
    text-decoration: underline;
}

.ai-message.user .ai-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.ai-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
    align-items: center;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00c6ff;
    animation: typing 1s infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.ai-chat-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.ai-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-input-box {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #f8f9fa;
    font-size: 14px;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    transition: all 0.2s;
}

.ai-input-box:focus {
    outline: none;
    border-color: #0072ff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0,114,255,0.1);
}

.ai-send-button {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,114,255,0.3);
}

.ai-send-button:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .ai-chat-popup {
        width: calc(100% - 40px);
        height: calc(100% - 120px);
        bottom: 80px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-chat-clear {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.ai-chat-clear:hover {
    opacity: 1;
} 