/* Raja Jewellers Luxury AI Assistant Widget Styles - Signature Purple Edition */
:root {
    /* Signature Raja Jewellers Royal Purple Palette */
    --rj-purple-primary: #561F7A;
    --rj-purple-hover: #6d279c;
    --rj-purple-dark: #3a1353;
    --rj-purple-deeper: #240b35;
    --rj-purple-light: #7D38A8;
    --rj-purple-tint: #f5ebfa;
    --rj-purple-glow: rgba(86, 31, 122, 0.45);
    --rj-purple-subtle: rgba(86, 31, 122, 0.12);

    /* Royal Gold Accents */
    --rj-gold: #C5A059;
    --rj-gold-light: #e8d3a7;
    --rj-gold-glow: rgba(197, 160, 89, 0.4);

    /* Backgrounds & Text */
    --rj-bg-dark: #121017;
    --rj-bg-card: #1c1824;
    --rj-bg-bubble: #252030;
    --rj-bg-user: linear-gradient(135deg, #561F7A 0%, #762da6 100%);
    --rj-text-light: #f8fafc;
    --rj-text-muted: #a39cb3;
    --rj-border: rgba(86, 31, 122, 0.3);
    --rj-border-gold: rgba(197, 160, 89, 0.4);
    --rj-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --rj-font-luxury: 'Cinzel', serif, Georgia;
}

.rj-chat-wrapper {
    position: fixed;
    z-index: 999999;
    bottom: 24px;
    font-family: var(--rj-font-sans);
    display: block !important;
}

.rj-chat-wrapper.rj-pos-right {
    right: 24px;
}

.rj-chat-wrapper.rj-pos-left {
    left: 24px;
}

/* ==========================================================================
   Shortcode Trigger Buttons (.rj-shortcode-btn)
   ========================================================================== */
.rj-shortcode-wrapper {
    display: inline-block;
}

.rj-shortcode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--rj-font-sans);
    font-size: 14.5px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    line-height: 1.4;
    outline: none;
    box-sizing: border-box;
}

.rj-shortcode-btn .rj-btn-icon {
    font-size: 18px;
    line-height: 1;
}

/* Purple Luxury Button (Default) */
.rj-btn-purple-luxury {
    background: linear-gradient(135deg, var(--rj-purple-primary) 0%, var(--rj-purple-light) 100%);
    color: #ffffff !important;
    border: 1px solid var(--rj-gold-light);
    box-shadow: 0 4px 18px var(--rj-purple-glow), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.rj-btn-purple-luxury:hover {
    background: linear-gradient(135deg, var(--rj-purple-hover) 0%, var(--rj-purple-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--rj-purple-glow), 0 4px 10px rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
}

/* Gold Outline Button */
.rj-btn-gold-outline {
    background: transparent;
    color: var(--rj-purple-primary) !important;
    border: 2px solid var(--rj-purple-primary);
    box-shadow: 0 2px 10px rgba(86, 31, 122, 0.1);
}

.rj-btn-gold-outline:hover {
    background: var(--rj-purple-primary);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--rj-purple-glow);
}

/* Pill Style */
.rj-btn-pill {
    background: var(--rj-purple-subtle);
    color: var(--rj-purple-primary) !important;
    border: 1.5px solid var(--rj-purple-primary);
    padding: 10px 20px;
    border-radius: 50px;
}

.rj-btn-pill:hover {
    background: var(--rj-purple-primary);
    color: #ffffff !important;
    transform: scale(1.03);
}

/* Dark Royal Style */
.rj-btn-dark {
    background: var(--rj-bg-card);
    color: #ffffff !important;
    border: 1px solid var(--rj-purple-primary);
}

.rj-btn-dark:hover {
    background: var(--rj-purple-primary);
    border-color: var(--rj-gold);
    transform: translateY(-2px);
}

/* ==========================================================================
   Floating Launcher Button
   ========================================================================== */
.rj-launcher-button {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid var(--rj-gold);
    background: linear-gradient(135deg, var(--rj-purple-primary) 0%, var(--rj-purple-dark) 100%);
    cursor: pointer;
    position: relative;
    padding: 0;
    outline: none;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5), 0 0 20px var(--rj-purple-glow);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rj-launcher-button:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 28px var(--rj-purple-glow);
    border-color: #ffffff;
}

.rj-launcher-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.rj-launcher-icon {
    font-size: 28px;
    line-height: 1;
    transition: transform 0.3s ease, opacity 0.3s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.rj-launcher-close {
    display: none;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.rj-chat-wrapper.rj-is-open .rj-launcher-icon {
    display: none;
}

.rj-chat-wrapper.rj-is-open .rj-launcher-close {
    display: block;
}

.rj-launcher-glow {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--rj-purple-glow) 10%, transparent 70%);
    animation: rjPurplePulse 3s infinite;
    z-index: -1;
}

@keyframes rjPurplePulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.25); opacity: 0.15; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.rj-launcher-tooltip {
    position: absolute;
    bottom: 12px;
    right: 74px;
    background: var(--rj-purple-deeper);
    color: #ffffff;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--rj-gold);
    pointer-events: none;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.rj-pos-left .rj-launcher-tooltip {
    right: auto;
    left: 74px;
    transform: translateX(-10px);
}

.rj-launcher-button:hover .rj-launcher-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   Chat Window (Popup Modal)
   ========================================================================== */
.rj-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 390px;
    height: 600px;
    max-height: calc(100vh - 110px);
    background: var(--rj-bg-dark);
    border: 1.5px solid var(--rj-border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(86, 31, 122, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(14px);
}

.rj-pos-left .rj-chat-window {
    right: auto;
    left: 0;
}

.rj-chat-wrapper.rj-is-open .rj-chat-window {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Header - Raja Jewellers Royal Purple Gradient */
.rj-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #3d1457 0%, var(--rj-purple-primary) 50%, #260938 100%);
    border-bottom: 1px solid rgba(197, 160, 89, 0.3);
}

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

.rj-avatar-ring {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #2b113d;
    border: 1.5px solid var(--rj-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rj-avatar-icon {
    font-size: 20px;
}

.rj-online-status {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid var(--rj-bg-dark);
    border-radius: 50%;
}

.rj-concierge-title {
    margin: 0;
    font-family: var(--rj-font-luxury);
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.6px;
}

.rj-concierge-badge {
    display: block;
    font-size: 11px;
    color: var(--rj-gold-light);
    margin-top: 2px;
    font-weight: 500;
}

.rj-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rj-icon-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rj-icon-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
}

/* Messages Area */
.rj-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(86, 31, 122, 0.4) transparent;
}

.rj-messages-area::-webkit-scrollbar {
    width: 5px;
}

.rj-messages-area::-webkit-scrollbar-thumb {
    background: rgba(86, 31, 122, 0.4);
    border-radius: 4px;
}

/* Message Bubbles */
.rj-msg {
    display: flex;
    gap: 10px;
    max-width: 90%;
    animation: rjFadeIn 0.3s ease;
}

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

.rj-msg-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.rj-msg-bot {
    align-self: flex-start;
}

.rj-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}

.rj-msg-user .rj-msg-bubble {
    background: var(--rj-bg-user);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 14px var(--rj-purple-glow);
}

.rj-msg-bot .rj-msg-bubble {
    background: var(--rj-bg-card);
    color: var(--rj-text-light);
    border: 1px solid rgba(86, 31, 122, 0.3);
    border-bottom-left-radius: 4px;
}

.rj-msg-bot .rj-msg-bubble strong {
    color: var(--rj-gold-light);
}

.rj-msg-bot .rj-msg-bubble a {
    color: var(--rj-gold-light);
    text-decoration: underline;
}

.rj-msg-bot-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--rj-purple-dark);
    border: 1px solid var(--rj-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Product Cards */
.rj-products-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.rj-product-card {
    background: #191421;
    border: 1px solid rgba(86, 31, 122, 0.4);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.rj-product-card:hover {
    border-color: var(--rj-gold);
    background: #231c2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.rj-product-thumb {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
    background: #2d243a;
    flex-shrink: 0;
    border: 1px solid rgba(197, 160, 89, 0.3);
}

.rj-product-details {
    flex: 1;
    min-width: 0;
}

.rj-product-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--rj-text-light);
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rj-product-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--rj-gold-light);
    margin: 0 0 6px 0;
}

.rj-product-btn {
    display: inline-block;
    padding: 3px 10px;
    background: var(--rj-purple-primary);
    color: #ffffff;
    border: 1px solid var(--rj-gold);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.rj-product-card:hover .rj-product-btn {
    background: var(--rj-purple-hover);
    border-color: #ffffff;
}

/* Quick Suggestions */
.rj-suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px 16px;
}

.rj-suggestion-chip {
    background: rgba(86, 31, 122, 0.18);
    border: 1px solid rgba(86, 31, 122, 0.45);
    color: #e2d2ed;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.rj-suggestion-chip:hover {
    background: var(--rj-purple-primary);
    border-color: var(--rj-gold);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--rj-purple-glow);
}

/* Typing Indicator */
.rj-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
}

.rj-dot {
    width: 6px;
    height: 6px;
    background: var(--rj-purple-light);
    border-radius: 50%;
    animation: rjDotPulse 1.4s infinite ease-in-out both;
}

.rj-dot:nth-child(1) { animation-delay: -0.32s; }
.rj-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes rjDotPulse {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Form Footer */
.rj-chat-input-wrapper {
    padding: 12px 16px;
    border-top: 1px solid var(--rj-border);
    background: #17131e;
}

.rj-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #241e2e;
    border: 1px solid rgba(86, 31, 122, 0.35);
    border-radius: 22px;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.rj-chat-form:focus-within {
    border-color: var(--rj-purple-light);
    box-shadow: 0 0 0 2px var(--rj-purple-glow);
}

#rj-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13.5px;
    resize: none;
    max-height: 80px;
    font-family: inherit;
    padding: 4px 0;
    line-height: 1.4;
}

#rj-chat-input::placeholder {
    color: var(--rj-text-muted);
    font-size: 13px;
}

.rj-btn-send {
    background: linear-gradient(135deg, var(--rj-purple-primary) 0%, var(--rj-purple-light) 100%);
    border: 1px solid var(--rj-gold);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.rj-btn-send:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--rj-purple-hover) 0%, var(--rj-purple-primary) 100%);
    transform: scale(1.05);
}

.rj-btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rj-branding-footer {
    text-align: center;
    margin-top: 6px;
}

.rj-branding-footer span {
    font-size: 10px;
    color: var(--rj-text-muted);
    letter-spacing: 0.3px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .rj-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        right: 0 !important;
        left: 0 !important;
        margin: 0 auto;
        bottom: 76px;
    }
}
