/* Valen AI Chat - ValenPVT */
.valen-ai-wrap {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    background: radial-gradient(circle at 30% 20%, #0d0720 0%, #020104 100%);
    border: 1px solid rgba(155, 81, 224, 0.35);
    box-shadow: 0 20px 80px rgba(0,0,0,0.7), 0 0 40px rgba(155,81,224,0.1);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', 'Hind Siliguri', sans-serif;
    position: relative;
}

/* Particle overlay */
.valen-ai-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0,242,254,0.07) 1px, transparent 1px),
        radial-gradient(circle at 75% 60%, rgba(155,81,224,0.09) 2px, transparent 2px),
        radial-gradient(circle at 50% 80%, rgba(255,0,127,0.06) 1.5px, transparent 1.5px);
    background-size: 350px 350px;
    animation: valenParticles 35s linear infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes valenParticles {
    0%   { background-position: 0 0; }
    100% { background-position: 350px -350px; }
}

/* Header */
.valen-chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    background: rgba(10,5,25,0.9);
    border-bottom: 1px solid rgba(155,81,224,0.25);
    position: relative;
    z-index: 2;
}
.valen-header-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #120c2c;
    border: 1.5px solid rgba(155,81,224,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 16px rgba(155,81,224,0.35);
    animation: valenAvatarPulse 3s infinite ease-in-out;
}
@keyframes valenAvatarPulse {
    0%,100% { box-shadow: 0 0 10px rgba(155,81,224,0.3); }
    50%      { box-shadow: 0 0 22px rgba(0,242,254,0.55); border-color: #00f2fe; }
}
.valen-header-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.valen-bot-name {
    font-size: 17px;
    font-weight: 700;
    color: #e5deff;
    letter-spacing: 0.3px;
}
.valen-status {
    font-size: 12px;
    color: #7ecfff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.valen-dot-live {
    width: 7px;
    height: 7px;
    background: #00f2a0;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #00f2a0;
    animation: valenBlink 2s infinite;
}
@keyframes valenBlink {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* Chat messages area */
.valen-chat-container {
    height: 420px;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
}
.valen-chat-container::-webkit-scrollbar { width: 4px; }
.valen-chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #9b51e0, #00f2fe);
    border-radius: 10px;
}

/* Message rows */
.valen-message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 82%;
    animation: valenFadeIn 0.4s cubic-bezier(0.175,0.885,0.32,1.1) both;
}
@keyframes valenFadeIn {
    0%   { opacity: 0; transform: translateY(18px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.valen-user-row {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.valen-ai-row {
    align-self: flex-start;
}

/* Avatars */
.valen-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.valen-ai-avatar {
    background: #120c2c;
    border: 1px solid rgba(155,81,224,0.55);
    box-shadow: 0 0 10px rgba(155,81,224,0.25);
}
.valen-user-avatar {
    background: linear-gradient(135deg, #00f2fe, #0052d4);
    border: 1px solid rgba(0,242,254,0.5);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

/* Bubbles */
.valen-bubble {
    padding: 13px 18px;
    font-size: 15px;
    line-height: 1.65;
    border-radius: 20px;
    word-break: break-word;
    box-shadow: 0 6px 28px rgba(0,0,0,0.3);
    backdrop-filter: blur(12px);
}
.valen-ai-bubble {
    background: rgba(15,10,32,0.8);
    color: #e5deff;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(155,81,224,0.28);
}
.valen-user-bubble {
    background: linear-gradient(135deg, #004ebd 0%, #032b5c 60%, #018b93 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(0,242,254,0.3);
}

/* Loading dots */
.valen-loading-dots {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    height: 20px;
}
.valen-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    animation: valenPulse 1.4s infinite ease-in-out both;
}
.valen-dot:nth-child(1) { background: #00f2fe; animation-delay: 0s; }
.valen-dot:nth-child(2) { background: #9b51e0; animation-delay: 0.2s; }
.valen-dot:nth-child(3) { background: #ff007f; animation-delay: 0.4s; }
@keyframes valenPulse {
    0%,80%,100% { transform: scale(0.65); opacity: 0.35; }
    40%          { transform: scale(1.2); opacity: 1; }
}

/* Input area */
.valen-input-wrapper {
    padding: 14px 18px 18px;
    background: rgba(8,5,18,0.95);
    border-top: 1px solid rgba(155,81,224,0.2);
    position: relative;
    z-index: 2;
}
.valen-input-dock {
    display: flex;
    align-items: center;
    background: rgba(15,10,32,0.9);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    border: 1px solid rgba(155,81,224,0.4);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.valen-input-dock:focus-within {
    border-color: #00f2fe;
    box-shadow: 0 0 24px rgba(0,242,254,0.3);
}
#valenUserInput {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-size: 15px;
    outline: none;
    font-family: inherit;
}
#valenUserInput::placeholder { color: #4a4070; }

#valenSendBtn {
    background: linear-gradient(45deg, #9b51e0, #ff007f);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 14px rgba(255,0,127,0.4);
    transition: all 0.25s ease;
    flex-shrink: 0;
}
#valenSendBtn:hover {
    transform: scale(1.08) rotate(-15deg);
    box-shadow: 0 0 24px rgba(255,0,127,0.6);
}
#valenSendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.valen-powered {
    text-align: center;
    font-size: 11px;
    color: #3d3560;
    margin-top: 10px;
}
.valen-powered b { color: #6b4fa0; }

/* Mobile responsive */
@media (max-width: 600px) {
    .valen-chat-container { height: 360px; padding: 16px 14px; }
    .valen-bubble { font-size: 14px; padding: 11px 15px; }
    .valen-message-row { max-width: 90%; }
    .valen-chat-header { padding: 14px 16px; }
    .valen-bot-name { font-size: 15px; }
}
