/* ============================================================
   🩸 RAKTHA — AI VOICE ASSISTANT STYLES
   ============================================================ */

/* ---------- FLOATING 3D AVATAR ---------- */
.raktha-avatar {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.raktha-avatar:hover { transform: scale(1.08); }

.raktha-orb {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ff6b6b, #e8454a 40%, #8b0000);
    box-shadow:
        0 0 30px rgba(232, 69, 74, 0.6),
        0 0 60px rgba(232, 69, 74, 0.3),
        inset -8px -8px 20px rgba(0, 0, 0, 0.4),
        inset 8px 8px 20px rgba(255, 255, 255, 0.15);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rakthaFloat 4s ease-in-out infinite;
}
@keyframes rakthaFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.raktha-inner {
    color: #fff;
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    z-index: 2;
}

.raktha-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.raktha-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff6b6b;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    opacity: 0;
}
.raktha-particles span:nth-child(1) { --x: 40px; --y: -20px; animation: particle 3s infinite 0s; }
.raktha-particles span:nth-child(2) { --x: -30px; --y: -40px; animation: particle 3s infinite 0.5s; }
.raktha-particles span:nth-child(3) { --x: 20px; --y: 40px; animation: particle 3s infinite 1s; }
.raktha-particles span:nth-child(4) { --x: -40px; --y: 20px; animation: particle 3s infinite 1.5s; }
.raktha-particles span:nth-child(5) { --x: 35px; --y: 35px; animation: particle 3s infinite 2s; }
.raktha-particles span:nth-child(6) { --x: -25px; --y: -35px; animation: particle 3s infinite 2.5s; }

@keyframes particle {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.5); opacity: 0; }
}

/* Listening state */
.raktha-avatar.listening .raktha-orb {
    background: radial-gradient(circle at 35% 35%, #ff8888, #ff0000 40%, #8b0000);
    animation: rakthaListen 1s infinite;
}
@keyframes rakthaListen {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.6), 0 0 60px rgba(255, 0, 0, 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 60px rgba(255, 0, 0, 0.9), 0 0 120px rgba(255, 0, 0, 0.5); transform: scale(1.1); }
}

/* Thinking state */
.raktha-avatar.thinking .raktha-orb {
    background: radial-gradient(circle at 35% 35%, #ffe066, #f5a623 40%, #8b6914);
    animation: rakthaSpin 2s linear infinite;
}
@keyframes rakthaSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Speaking state */
.raktha-avatar.speaking .raktha-orb {
    background: radial-gradient(circle at 35% 35%, #6bff6b, #4caf50 40%, #1b5e20);
    animation: rakthaSpeak 0.6s infinite;
}
@keyframes rakthaSpeak {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Tooltip */
.raktha-tooltip {
    position: absolute;
    bottom: 90px;
    right: 0;
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(232, 69, 74, 0.3);
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    transform: translateY(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.raktha-avatar:hover .raktha-tooltip {
    opacity: 1;
    transform: translateY(0);
}
.raktha-tooltip strong { display: block; color: #e8454a; font-size: 0.95rem; }
.raktha-tooltip span { display: block; color: #8a8696; font-size: 0.75rem; }


/* ---------- CHAT PANEL ---------- */
.raktha-chat {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    background: linear-gradient(145deg, #1a1a2e, #12121e);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(232, 69, 74, 0.15);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.raktha-chat.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.raktha-chat-header {
    padding: 1rem 1.5rem;
    background: rgba(232, 69, 74, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.raktha-chat-title {
    display: flex; align-items: center; gap: 0.6rem;
    color: #f0ece6; font-size: 1rem;
}
.raktha-status-dot {
    width: 10px; height: 10px;
    background: #4caf50; border-radius: 50%;
    box-shadow: 0 0 10px #4caf50;
    animation: statusPulse 2s infinite;
}
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.raktha-lang-btn,
.raktha-close-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a09cae;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: 0.4rem;
    transition: all 0.2s;
}
.raktha-lang-btn:hover,
.raktha-close-btn:hover {
    background: rgba(232, 69, 74, 0.15);
    color: #e8454a;
    border-color: rgba(232, 69, 74, 0.3);
}

.raktha-chat-messages {
    flex: 1; overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex; flex-direction: column; gap: 0.8rem;
}
.raktha-chat-messages::-webkit-scrollbar { width: 4px; }
.raktha-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(232, 69, 74, 0.3);
    border-radius: 4px;
}

.raktha-msg {
    display: flex; flex-direction: column;
    max-width: 85%;
    animation: msgIn 0.3s ease;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.raktha-msg.user { align-self: flex-end; align-items: flex-end; }
.raktha-msg.raktha { align-self: flex-start; align-items: flex-start; }
.raktha-msg-bubble {
    padding: 0.7rem 1.1rem;
    border-radius: 20px;
    font-size: 0.88rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.raktha-msg.raktha .raktha-msg-bubble {
    background: rgba(232, 69, 74, 0.1);
    border: 1px solid rgba(232, 69, 74, 0.2);
    color: #e8e6e3;
    border-bottom-left-radius: 6px;
}
.raktha-msg.user .raktha-msg-bubble {
    background: linear-gradient(135deg, #e8454a, #c0392b);
    color: #fff;
    border-bottom-right-radius: 6px;
}
.raktha-msg-time {
    font-size: 0.65rem;
    color: #5a5668;
    margin-top: 4px;
    padding: 0 0.5rem;
}
.raktha-chat-transcript {
    margin: 0 1.5rem 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(232, 69, 74, 0.1);
    border-radius: 14px;
    border: 1px dashed rgba(232, 69, 74, 0.3);
    color: #f0ece6;
    font-size: 0.85rem;
    font-style: italic;
}
.raktha-chat-input {
    display: flex; gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}
.raktha-chat-input input {
    flex: 1;
    padding: 0.7rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #e8e6e3;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}
.raktha-chat-input input:focus {
    border-color: #e8454a;
    background: rgba(232, 69, 74, 0.05);
}
.raktha-chat-input button {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #e8454a, #c0392b);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(232, 69, 74, 0.3);
}
.raktha-chat-input button:hover { transform: scale(1.08); }

.raktha-quick-actions {
    display: flex; gap: 0.4rem;
    padding: 0.5rem 1.5rem 1rem;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
}
.raktha-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #8a8696;
    padding: 0.3rem 0.9rem;
    border-radius: 30px;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}
.raktha-chip:hover {
    background: rgba(232, 69, 74, 0.1);
    color: #e8454a;
    border-color: rgba(232, 69, 74, 0.3);
    transform: translateY(-1px);
}

@media (max-width: 500px) {
    .raktha-avatar { bottom: 20px; right: 20px; }
    .raktha-orb { width: 60px; height: 60px; }
    .raktha-chat {
        right: 10px; left: 10px;
        bottom: 100px;
        width: auto;
        height: 70vh;
    }
}