/* Chat Widget - RA Info Solution */

.chat-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    font-family: var(--font-sans);
}
/* 
.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
} */

.chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(79, 70, 229, 0.5);
}

.chat-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

.chat-window {
    position: absolute;
    bottom: calc(56px + 1rem);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 3rem);
    height: 480px;
    max-height: calc(100vh - 10rem);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.25s ease;
}

.chat-widget.open .chat-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-header {
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    border-radius: 1rem 1rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar svg {
    width: 22px;
    height: 22px;
    color: white;
}

.chat-header-text h3 {
    font-size: 1rem;
    font-weight: 600;
}

.chat-header-text span {
    font-size: 0.8rem;
    color: var(--accent);
}

.chat-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.chat-close:hover {
    color: var(--text-primary);
    background: var(--accent-muted);
}

.chat-close svg {
    width: 20px;
    height: 20px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-message.bot {
    align-self: flex-start;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-bottom-left-radius: 0.25rem;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: #0a0f14;
    border-bottom-right-radius: 0.25rem;
}

.chat-message .chat-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.35rem;
}

.chat-message.bot .chat-time {
    color: var(--text-muted);
}

.chat-message.user .chat-time {
    color: rgba(10, 15, 20, 0.7);
}

.chat-typing {
    align-self: flex-start;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
}

.chat-typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    margin: 0 2px;
    animation: chat-bounce 1.4s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border);
    border-radius: 0 0 1rem 1rem;
}

.chat-input-wrap {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send {
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.chat-send:hover {
    transform: scale(1.05);
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

.chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.chat-quick-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: var(--accent-muted);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: var(--accent);
    border-radius: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.chat-quick-btn:hover {
    background: rgba(20, 184, 166, 0.25);
}

.chat-whatsapp-btn {
    background: rgba(37, 211, 102, 0.15) !important;
    border-color: rgba(37, 211, 102, 0.4) !important;
    color: #25d366 !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.chat-whatsapp-btn:hover {
    background: rgba(37, 211, 102, 0.25) !important;
}

.chat-message .chat-whatsapp-link {
    color: #25d366;
    font-weight: 500;
}

.chat-message .chat-whatsapp-link:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .chat-widget {
        bottom: 1rem;
        right: 1rem;
    }

    .chat-window {
        width: calc(100vw - 2rem);
        height: 70vh;
    }
}

.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: grab;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    z-index: 9999;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.2s;
}

.chat-toggle:active {
    cursor: grabbing;
}

.chat-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Floating animation */
@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}