/* ═══════════════════════════════════════════
   AppArtMan — Voice Assistant Styles (Right Side)
   ═══════════════════════════════════════════ */

/* ── Toggle Button (Bottom Right) ── */
#voice-assistant-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 9999;
    background: linear-gradient(135deg, #6c63ff, #f72585);
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 8px 28px rgba(108, 99, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#voice-assistant-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 14px 36px rgba(108, 99, 255, 0.6);
}

#voice-assistant-btn.listening {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 8px 28px rgba(239, 68, 68, 0.5);
    animation: va-pulse 1.5s infinite;
}

#voice-assistant-btn .pulse-dot {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: va-ping 2s infinite;
    z-index: -1;
}

/* ── AI Chat Panel (Right Side) ── */
#ai-chat-panel {
    position: fixed;
    right: 28px;
    bottom: 100px;
    width: 380px;
    max-height: 520px;
    background: rgba(12, 13, 25, 0.96);
    border: 1px solid rgba(108, 99, 255, 0.25);
    border-radius: 20px;
    z-index: 9998;
    backdrop-filter: blur(24px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(108, 99, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#ai-chat-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Panel Header */
.ai-panel-head {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(108, 99, 255, 0.06);
}

.ai-panel-head .ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6c63ff, #f72585);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.ai-panel-head .ai-info {
    flex: 1;
}

.ai-panel-head .ai-info strong {
    font-size: 0.9rem;
    color: #fff;
}

.ai-panel-head .ai-info span {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    display: block;
    margin-top: 2px;
}

.ai-panel-head .ai-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00e5a0;
    box-shadow: 0 0 8px rgba(0, 229, 160, 0.5);
    animation: statusBlink 2s infinite;
}

.ai-panel-head .ai-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.ai-panel-head .ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Messages Area */
.ai-panel-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 340px;
}

.ai-panel-msgs::-webkit-scrollbar { width: 4px; }
.ai-panel-msgs::-webkit-scrollbar-track { background: transparent; }
.ai-panel-msgs::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.3); border-radius: 4px; }

.ai-msg {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.55;
    max-width: 85%;
    animation: msgFadeIn 0.3s ease;
}

.ai-msg.bot {
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.15);
    color: rgba(255, 255, 255, 0.88);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ai-msg.user {
    background: linear-gradient(135deg, #6c63ff, #8b5cf6);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Input Bar */
.ai-panel-input {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.ai-panel-input input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.ai-panel-input input:focus {
    border-color: rgba(108, 99, 255, 0.4);
}

.ai-panel-input input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.ai-panel-input .mic-btn,
.ai-panel-input .send-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-panel-input .mic-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.ai-panel-input .mic-btn:hover {
    background: rgba(108, 99, 255, 0.15);
    color: #6c63ff;
    border-color: rgba(108, 99, 255, 0.3);
}

.ai-panel-input .mic-btn.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-color: transparent;
    animation: va-pulse 1.5s infinite;
}

.ai-panel-input .send-btn {
    background: linear-gradient(135deg, #6c63ff, #f72585);
    color: #fff;
}

.ai-panel-input .send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

/* ── Animations ── */
@keyframes va-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes va-ping {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.8); opacity: 0; }
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    #voice-assistant-btn {
        width: 44px;
        height: 44px;
        bottom: 15px;
        right: 15px;
        font-size: 1.1rem;
    }
}
@media (max-width: 480px) {
    #ai-chat-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 90px;
        max-height: 60vh;
    }
}
