/* ==========================================================================
   KAYA FITNESS HUB - AI GYM ASSISTANT CHATBOT & VOICE CSS
   ========================================================================== */

/* Floating Launcher Button */
.chatbot-launcher {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #FF6B00 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 10px 25px rgba(255, 59, 0, 0.5);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chatbot-launcher:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(255, 59, 0, 0.7);
}

.chatbot-launcher .notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #00E676;
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 3px 6px;
    border-radius: 10px;
    border: 2px solid #000;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Chatbot Main Container */
.chatbot-container {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 380px;
    max-width: calc(100vw - 30px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: rgba(18, 20, 29, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 59, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chatbot-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, rgba(30, 33, 44, 0.9) 0%, rgba(18, 20, 29, 0.9) 100%);
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header .bot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-header .bot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 0 15px rgba(255, 59, 0, 0.4);
}

.chatbot-header .bot-title {
    font-weight: 800;
    font-size: 0.98rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-header .bot-subtitle {
    font-size: 0.75rem;
    color: #00E676;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatbot-header .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-header .icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.chatbot-header .icon-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.chatbot-header .icon-btn.active {
    color: var(--primary);
}

/* Language Bar */
.chatbot-lang-bar {
    background: rgba(10, 12, 18, 0.6);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
}

.chatbot-lang-bar span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}

.lang-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-chip:hover {
    border-color: var(--primary);
    color: #fff;
}

.lang-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chat-bubble {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
    animation: fadeInMsg 0.25s ease forwards;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.bot {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary) 0%, #FF5500 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(255, 59, 0, 0.3);
}

/* Quick Suggestion Chips */
.chatbot-chips {
    padding: 8px 14px 12px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(10, 12, 18, 0.4);
    border-top: 1px solid var(--border-color);
}

.chip-btn {
    white-space: normal;
    text-align: center;
    justify-content: center;
    background: rgba(255, 107, 0, 0.12);
    border: 1px solid rgba(255, 107, 0, 0.35);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
}

.chip-btn:hover {
    background: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 107, 0, 0.4);
}

/* Input Area */
.chatbot-input-area {
    padding: 12px 14px;
    background: rgba(10, 12, 18, 0.9);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-input-area input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s ease;
}

.chatbot-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(255, 59, 0, 0.3);
}

.chatbot-input-area .mic-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-input-area .mic-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.chatbot-input-area .mic-btn.listening {
    background: #ff4d4d;
    color: #ffffff;
    border-color: #ff4d4d;
    animation: micPulse 1.2s infinite;
}

@keyframes micPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 77, 77, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

.chatbot-input-area .send-btn {
    background: var(--primary);
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 59, 0, 0.4);
}

.chatbot-input-area .send-btn:hover {
    transform: scale(1.08);
    background: var(--primary-hover);
}

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

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

.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); }
}
