/* assets/css/ai_widget.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Teamtechsoul Theme Colors */
    --ai-primary: #1E60FF; /* Vibrant Blue from the site button */
    --ai-secondary: #0A3CBA; /* Darker Blue */
    --ai-accent: #FF4A3B; /* Accent Red/Orange */
    --ai-gradient: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-secondary) 100%);
    
    /* Dark Theme Colors */
    --ai-bg: #1e293b; /* Dark Slate background */
    --ai-bg-alt: #0f172a; /* Darker Slate for messages container */
    --ai-text: #f8fafc; /* White text */
    --ai-text-light: #94a3b8; /* Slate 400 */
    --ai-border: #334155; /* Slate 700 */
    
    --ai-shadow: 0 10px 40px -10px rgba(0,0,0,0.6);
    --ai-shadow-hover: 0 20px 40px -10px rgba(30, 96, 255, 0.4);
}

#ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

#ai-chat-bubble {
    width: 64px;
    height: 64px;
    background: var(--ai-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--ai-shadow);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: white;
    font-size: 28px;
    position: relative;
    z-index: 2;
}

#ai-chat-bubble::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--ai-gradient);
    opacity: 0.4;
    z-index: -1;
    filter: blur(8px);
    transition: opacity 0.3s ease;
}

#ai-chat-bubble:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: var(--ai-shadow-hover);
}

#ai-chat-bubble:hover::before {
    opacity: 0.7;
}

#ai-chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 600px;
    background: var(--ai-bg);
    border-radius: 24px;
    display: none;
    flex-direction: column;
    box-shadow: var(--ai-shadow);
    overflow: hidden;
    transform-origin: bottom right;
    animation: scaleUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    border: 1px solid var(--ai-border);
}

@keyframes scaleUp {
    0% { transform: scale(0.8) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

#ai-chat-header {
    background: var(--ai-gradient);
    padding: 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    border-bottom: 1px solid rgba(0,0,0,0.2);
}

.ai-header-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.ai-header-info {
    flex: 1;
}

#ai-chat-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: #ffffff;
    line-height: 1.2;
}

.ai-header-status {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-weight: 400;
}

.ai-header-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #4ade80;
}

#ai-chat-header .header-actions {
    display: flex;
    gap: 15px;
    font-size: 20px;
}

#ai-chat-close {
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

#ai-chat-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

#ai-chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--ai-bg-alt);
    scroll-behavior: smooth;
}

/* Custom Scrollbar for messages */
#ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}
#ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}
#ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

.ai-message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 85%;
    animation: messageSlide 0.3s ease-out forwards;
}

@keyframes messageSlide {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.ai-message-wrapper.bot {
    align-self: flex-start;
}

.ai-message-wrapper.user {
    align-self: flex-end;
    align-items: flex-end;
}

.ai-message-content {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.bot .ai-message-content {
    flex-direction: row;
}

.user .ai-message-content {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ai-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(30, 96, 255, 0.2);
}

.user .ai-message-avatar {
    background: var(--ai-border);
    color: var(--ai-text-light);
    box-shadow: none;
}

.ai-message {
    padding: 14px 18px;
    font-size: 14.5px;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.user .ai-message {
    background: var(--ai-gradient);
    color: white;
    border-radius: 20px 20px 4px 20px;
}

.bot .ai-message {
    background: var(--ai-bg);
    color: var(--ai-text);
    border-radius: 20px 20px 20px 4px;
    border: 1px solid var(--ai-border);
}

#ai-chat-input-container {
    padding: 20px;
    background: var(--ai-bg);
    border-top: 1px solid var(--ai-border);
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

#ai-chat-input {
    flex: 1;
    border: 1px solid var(--ai-border);
    background: var(--ai-bg-alt);
    border-radius: 24px;
    padding: 14px 20px;
    padding-right: 50px;
    outline: none;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
    color: var(--ai-text);
}

#ai-chat-input::placeholder {
    color: var(--ai-text-light);
}

#ai-chat-input:focus {
    border-color: var(--ai-primary);
    background: var(--ai-bg);
    box-shadow: 0 0 0 4px rgba(30, 96, 255, 0.15);
}

#ai-chat-send {
    position: absolute;
    right: 28px;
    background: var(--ai-gradient);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(30, 96, 255, 0.3);
}

#ai-chat-send:hover {
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 6px 14px rgba(30, 96, 255, 0.4);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    align-items: center;
    height: 24px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--ai-primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    opacity: 0.8;
}

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

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

/* Responsive */
@media (max-width: 480px) {
    #ai-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: -16px;
    }
}
