/**
 * AI Chat-SJPRO Frontend Styles
 */

/* Main Chatbot Container */
#ai-chat-sjpro-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Chatbot Icon */
#ai-chat-sjpro-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--aichatbot-primary-color, #0073aa);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: ai-chat-sjpro-pulse 2s infinite;
    pointer-events: auto;
    z-index: 999999;
    touch-action: none;
}

#ai-chat-sjpro-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
}

#ai-chat-sjpro-container > * {
    pointer-events: auto;
}

#ai-chat-sjpro-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#ai-chat-sjpro-icon img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

@keyframes ai-chat-sjpro-pulse {
    0% { box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4); }
    50% { box-shadow: 0 4px 12px rgba(0, 115, 170, 0.6); }
    100% { box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4); }
}

/* Chat Window — use visibility/opacity so CSS transitions work properly */
#ai-chat-sjpro-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: scale(0.9) translateY(15px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
}

#ai-chat-sjpro-chat-window.show {
    visibility: visible;
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Resize handle */
.ai-chat-sjpro-resize-handle {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    z-index: 20;
    pointer-events: auto;
    opacity: 0.55;
    transition: opacity 0.2s;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M10 10 L16 16 M6 12 L16 16 M12 6 L16 16' stroke='rgba(0,0,0,0.5)' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat center;
    filter: drop-shadow(0 0 1px rgba(255,255,255,0.9));
}

.ai-chat-sjpro-resize-handle:hover {
    opacity: 1;
}

#ai-chat-sjpro-chat-window.aicpro-resizing {
    transition: none !important;
}

/* Header */
.ai-chat-sjpro-header {
    background: var(--aichatbot-primary-color, #0073aa);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Header avatar */
.ai-chat-sjpro-header-avatar {
    position: relative;
    flex-shrink: 0;
}

.ai-chat-sjpro-header-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    display: block;
    object-fit: cover;
}

.ai-chat-sjpro-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: #4ade80;
    border-radius: 50%;
    border: 2px solid white;
    animation: ai-chat-sjpro-blink 2.5s infinite;
}

@keyframes ai-chat-sjpro-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.ai-chat-sjpro-header-info {
    flex: 1;
    min-width: 0;
}

.ai-chat-sjpro-header-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-chat-sjpro-header-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chat-sjpro-online-label {
    font-weight: 600;
    color: #a7f3d0;
}

.ai-chat-sjpro-header-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ai-chat-sjpro-btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.ai-chat-sjpro-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Container */
#ai-chat-sjpro-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.ai-chat-sjpro-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ai-chat-sjpro-message.user {
    flex-direction: row-reverse;
}

.ai-chat-sjpro-message-content {
    max-width: 70%;
}

.ai-chat-sjpro-message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 5px;
    word-wrap: break-word;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-chat-sjpro-message.user .ai-chat-sjpro-message-text {
    background: var(--aichatbot-primary-color, #0073aa);
    color: white;
}

.ai-chat-sjpro-message-time {
    font-size: 11px;
    color: #999;
    text-align: right;
}

.ai-chat-sjpro-message.user .ai-chat-sjpro-message-time {
    text-align: left;
}

/* Summary line inside bot messages */
.ai-chat-sjpro-summary {
    display: none;
}

/* Typing Indicator */
.ai-chat-sjpro-typing-message .ai-chat-sjpro-message-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-sjpro-typing-text {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.ai-chat-sjpro-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-chat-sjpro-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: ai-chat-sjpro-typing 1.4s infinite ease-in-out;
}

.ai-chat-sjpro-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-sjpro-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-chat-sjpro-typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input Area */
.ai-chat-sjpro-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.ai-chat-sjpro-input-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 8px;
    border: 1px solid #e9ecef;
}

#ai-chat-sjpro-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    padding: 8px 12px;
    max-height: 100px;
    min-height: 20px;
    font-family: inherit;
}

#ai-chat-sjpro-input:focus {
    outline: none;
}

.ai-chat-sjpro-send-btn {
    background: var(--aichatbot-primary-color, #0073aa);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-chat-sjpro-send-btn:hover {
    background: var(--aichatbot-secondary-color, #005a87);
    transform: scale(1.05);
}

.ai-chat-sjpro-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-chat-sjpro-icon-send::before {
    content: "➤";
    font-size: 16px;
}

/* Quick Actions */
.ai-chat-sjpro-quick-actions {
    padding: 8px 12px 10px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ai-chat-sjpro-quick-btn {
    flex: 1;
    min-width: 60px;
    padding: 7px 6px;
    background: #f0f4ff;
    border: 1px solid #dce3f5;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #4a5568;
    text-decoration: none;
    line-height: 1.2;
    text-align: center;
}

.ai-chat-sjpro-quick-btn:hover {
    background: var(--aichatbot-primary-color, #0073aa);
    color: white;
    border-color: var(--aichatbot-primary-color, #0073aa);
    transform: translateY(-1px);
}

.ai-chat-sjpro-quick-btn:active {
    transform: translateY(0);
}

.ai-chat-sjpro-icon-products::before { content: "🛍️"; font-size: 16px; }
.ai-chat-sjpro-icon-track::before    { content: "📦"; font-size: 16px; }
.ai-chat-sjpro-icon-orders::before   { content: "🧾"; font-size: 16px; }
.ai-chat-sjpro-icon-forms::before    { content: "📝"; font-size: 16px; }
.ai-chat-sjpro-icon-help::before     { content: "❓"; font-size: 16px; }
.ai-chat-sjpro-icon-custom           { font-size: 16px; display: inline-block; }

/* Theme Variations */

/* Dark Theme */
.ai-chat-sjpro-theme-dark #ai-chat-sjpro-chat-window {
    background: #2d3748;
    color: white;
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-header {
    background: #1a202c;
}

.ai-chat-sjpro-theme-dark #ai-chat-sjpro-messages {
    background: #1a202c;
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-message-text {
    background: #2d3748;
    color: white;
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-message.user .ai-chat-sjpro-message-text {
    background: var(--aichatbot-primary-color, #0073aa);
    color: white;
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-input-area,
.ai-chat-sjpro-theme-dark .ai-chat-sjpro-quick-actions {
    background: #2d3748;
    border-color: #4a5568;
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-input-container {
    background: #4a5568;
    border-color: #718096;
}

.ai-chat-sjpro-theme-dark #ai-chat-sjpro-input {
    color: white;
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-quick-btn {
    background: #4a5568;
    border-color: #718096;
    color: white;
}

/* Light Theme */
.ai-chat-sjpro-theme-light #ai-chat-sjpro-chat-window {
    background: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.ai-chat-sjpro-theme-light .ai-chat-sjpro-header {
    background: #f8f9fa;
    color: #333;
}

.ai-chat-sjpro-theme-light .ai-chat-sjpro-message-text {
    background: #ffffff;
    border: 1px solid #e9ecef;
}

.ai-chat-sjpro-theme-light .ai-chat-sjpro-message.user .ai-chat-sjpro-message-text {
    background: var(--aichatbot-primary-color, #0073aa);
    color: white;
    border: none;
}

/* Modern Theme */
.ai-chat-sjpro-theme-modern #ai-chat-sjpro-chat-window {
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ai-chat-sjpro-theme-modern .ai-chat-sjpro-header {
    border-radius: 20px 20px 0 0;
    background: linear-gradient(135deg, var(--aichatbot-primary-color, #0073aa), var(--aichatbot-secondary-color, #005a87));
}

.ai-chat-sjpro-theme-modern .ai-chat-sjpro-message-text {
    border-radius: 20px;
}

.ai-chat-sjpro-theme-modern .ai-chat-sjpro-input-container {
    border-radius: 25px;
}

/* Minimal Theme */
.ai-chat-sjpro-theme-minimal #ai-chat-sjpro-chat-window {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ai-chat-sjpro-theme-minimal .ai-chat-sjpro-header {
    background: white;
    color: #333;
    border-bottom: 1px solid #e9ecef;
}

.ai-chat-sjpro-theme-minimal .ai-chat-sjpro-message-text {
    background: #f8f9fa;
    border: none;
    box-shadow: none;
}

.ai-chat-sjpro-theme-minimal .ai-chat-sjpro-message.user .ai-chat-sjpro-message-text {
    background: #333;
    color: white;
}

.ai-chat-sjpro-theme-minimal .ai-chat-sjpro-input-area,
.ai-chat-sjpro-theme-minimal .ai-chat-sjpro-quick-actions {
    border-top: 1px solid #e9ecef;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #ai-chat-sjpro-container {
        right: 20px !important;
        bottom: 20px !important;
        left: auto !important;
        top: auto !important;
    }

    #ai-chat-sjpro-chat-window {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        margin: 0 !important;
        transform: none !important;
        border-radius: 0;
    }

    #ai-chat-sjpro-chat-window.show {
        transform: none !important;
    }

    #ai-chat-sjpro-messages {
        padding-bottom: 10px;
    }

    .ai-chat-sjpro-message-content {
        max-width: 80%;
    }

    .ai-chat-sjpro-quick-actions {
        flex-wrap: wrap;
    }

    .ai-chat-sjpro-quick-btn {
        min-width: calc(33.333% - 6px);
    }

    .ai-chat-sjpro-resize-handle {
        display: none;
    }
}

/* Animation Classes */
.ai-chat-sjpro-fade-in {
    animation: ai-chat-sjpro-fadeIn 0.3s ease;
}

.ai-chat-sjpro-slide-up {
    animation: ai-chat-sjpro-slideUp 0.3s ease;
}

@keyframes ai-chat-sjpro-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ai-chat-sjpro-slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
#ai-chat-sjpro-messages::-webkit-scrollbar {
    width: 6px;
}

#ai-chat-sjpro-messages::-webkit-scrollbar-track {
    background: transparent;
}

#ai-chat-sjpro-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#ai-chat-sjpro-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Accessibility */
.ai-chat-sjpro-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
#ai-chat-sjpro-icon:focus,
.ai-chat-sjpro-btn-icon:focus,
.ai-chat-sjpro-send-btn:focus,
.ai-chat-sjpro-quick-btn:focus {
    outline: 2px solid var(--aichatbot-primary-color, #0073aa);
    outline-offset: 2px;
}

#ai-chat-sjpro-input:focus {
    outline: none;
}

/* Draggable chat window */
.ai-chat-sjpro-header {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.ai-chat-sjpro-header .ai-chat-sjpro-header-actions {
    cursor: default;
}

/* Applied to body during drag — blocks text selection everywhere */
body.aicpro-dragging,
body.aicpro-dragging * {
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

body.aicpro-dragging #ai-chat-sjpro-icon {
    transform: none !important;
    animation-play-state: paused;
}

/* Applied to the chat window itself while dragging */
#ai-chat-sjpro-chat-window.aicpro-dragging {
    transition: none !important;
    opacity: 0.96;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
    will-change: left, top;
}

/* Print Styles */
@media print {
    #ai-chat-sjpro-container {
        display: none !important;
    }
}

/* ============================================================
   Glass / Ocean Theme  —  Glassmorphism + Deep-Ocean gradients
   ============================================================ */

/* CSS custom props scoped to this theme */
.ai-chat-sjpro-theme-glass {
    --glass-primary:   #00AEEF;
    --glass-primary2:  #297BFF;
    --glass-bg-start:  #0B2340;
    --glass-bg-end:    #04131F;
    --glass-surface:   rgba(255, 255, 255, 0.07);
    --glass-surface2:  rgba(255, 255, 255, 0.03);
    --glass-border:    rgba(255, 255, 255, 0.12);
    --glass-shadow:    0 24px 64px rgba(0, 0, 0, 0.55);
    --glass-radius:    26px;
    --glass-glow:      0 0 32px rgba(0, 174, 239, 0.45);
}

/* Launcher icon */
.ai-chat-sjpro-theme-glass #ai-chat-sjpro-icon {
    background: linear-gradient(135deg, var(--glass-primary), var(--glass-primary2));
    box-shadow: var(--glass-glow), 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
}

@keyframes aicpro-glass-pulse {
    0%, 100% { box-shadow: var(--glass-glow), 0 4px 16px rgba(0,0,0,.4); }
    50%       { box-shadow: 0 0 48px rgba(0,174,239,.7), 0 4px 16px rgba(0,0,0,.4); }
}

.ai-chat-sjpro-theme-glass #ai-chat-sjpro-icon {
    animation: aicpro-glass-pulse 2.8s ease-in-out infinite;
}

.ai-chat-sjpro-theme-glass #ai-chat-sjpro-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 0 56px rgba(0, 174, 239, 0.8), 0 6px 24px rgba(0,0,0,.5);
}

/* Chat window */
.ai-chat-sjpro-theme-glass #ai-chat-sjpro-chat-window {
    background: linear-gradient(180deg, var(--glass-bg-start) 0%, var(--glass-bg-end) 100%);
    border-radius: var(--glass-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    color: #fff;
    overflow: hidden;
}

/* Header */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-header {
    position: relative;
    background: linear-gradient(135deg,
        rgba(0,174,239,0.35) 0%,
        rgba(11,35,64,0.85)  100%);
    border-radius: var(--glass-radius) var(--glass-radius) 0 0;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 18px;
    overflow: hidden;
}

/* Animated ocean shimmer behind header */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 120% 80% at 30% 60%,
        rgba(0,174,239,0.18) 0%,
        transparent 70%);
    animation: aicpro-glass-float 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aicpro-glass-float {
    0%, 100% { transform: translateY(0)   scale(1); }
    50%       { transform: translateY(-6px) scale(1.04); }
}

/* Header avatar ring */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-header-avatar img {
    border: 2px solid rgba(0, 174, 239, 0.6);
    box-shadow: 0 0 12px rgba(0,174,239,0.4);
}

/* Status dot — neon green */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-status-dot {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74,222,128,0.7);
}

/* Header text */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-header-title {
    color: #fff;
    text-shadow: 0 0 10px rgba(0,174,239,0.5);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-online-label {
    color: #7dffd1;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-header-subtitle {
    color: rgba(255,255,255,0.75);
}

/* Header icon buttons */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-btn-icon {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s, box-shadow 0.2s;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-btn-icon:hover {
    background: rgba(0,174,239,0.25);
    box-shadow: 0 0 12px rgba(0,174,239,0.4);
}

/* Messages area */
.ai-chat-sjpro-theme-glass #ai-chat-sjpro-messages {
    background: linear-gradient(180deg,
        rgba(7,27,46,0.92) 0%,
        rgba(4,19,31,0.96) 100%);
    scrollbar-color: rgba(0,174,239,0.3) transparent;
}

.ai-chat-sjpro-theme-glass #ai-chat-sjpro-messages::-webkit-scrollbar-thumb {
    background: rgba(0,174,239,0.3);
    border-radius: 3px;
}

/* Bot message bubble — glass */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-message-text {
    background: var(--glass-surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: rgba(255,255,255,0.92);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: aicpro-glass-appear 0.35s ease both;
}

@keyframes aicpro-glass-appear {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* User message bubble — neon gradient */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-message.user .ai-chat-sjpro-message-text {
    background: linear-gradient(135deg, #00AEEF 0%, #297BFF 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(0,174,239,0.35), 0 0 0 1px rgba(255,255,255,0.08);
    color: #fff;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-message-time {
    color: rgba(255,255,255,0.38);
}

/* Typing indicator dots */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-typing-indicator {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-typing-indicator span {
    background: rgba(0,174,239,0.7);
}

/* Summary line */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-summary {
    color: rgba(255,255,255,0.5);
    border-top-color: rgba(255,255,255,0.1);
}

/* Quick action buttons */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-quick-actions {
    background: rgba(4,19,31,0.85);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-quick-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    color: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.22s, background 0.22s, box-shadow 0.22s;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-quick-btn:hover {
    transform: translateY(-3px);
    background: rgba(0,174,239,0.22);
    border-color: rgba(0,174,239,0.45);
    color: #fff;
    box-shadow: 0 0 24px rgba(0,174,239,0.35);
}

/* Input area */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-input-area {
    background: rgba(4,19,31,0.9);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-input-container {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 28px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-input-container:focus-within {
    border-color: rgba(0,174,239,0.5);
    box-shadow: 0 0 20px rgba(0,174,239,0.2);
}

.ai-chat-sjpro-theme-glass #ai-chat-sjpro-input {
    color: rgba(255,255,255,0.9);
}

.ai-chat-sjpro-theme-glass #ai-chat-sjpro-input::placeholder {
    color: rgba(255,255,255,0.35);
}

/* Send button */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-send-btn {
    background: linear-gradient(135deg, #00AEEF 0%, #4F8EFF 100%);
    box-shadow: 0 0 18px rgba(0,174,239,0.4);
    border: none;
    transition: transform 0.25s, box-shadow 0.25s;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 36px rgba(0,174,239,0.7);
}

/* Quick-reply chips */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-chip {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(0,174,239,0.4);
    color: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-chip:hover {
    background: rgba(0,174,239,0.25);
    color: #fff;
    box-shadow: 0 0 16px rgba(0,174,239,0.35);
}

/* Product cards inside glass theme */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-product-card {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-product-name { color: rgba(255,255,255,0.9); }
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-product-price { color: var(--glass-primary); }
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-product-desc  { color: rgba(255,255,255,0.55); }

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-product-actions {
    border-top: 1px solid rgba(255,255,255,0.08);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-atc-btn {
    background: linear-gradient(135deg, #00AEEF, #297BFF);
    border-radius: 8px;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-view-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.8);
}

/* Order card inside glass theme */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-header {
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-id    { color: rgba(255,255,255,0.9); }
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-msg   { color: rgba(255,255,255,0.75); }
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-meta  { color: rgba(255,255,255,0.5); }
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-link  { color: var(--glass-primary); }

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-tracking {
    background: rgba(0,174,239,0.1);
    border-color: rgba(0,174,239,0.3);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-tracking-label  { color: var(--glass-primary); }
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-order-tracking-number { color: #fff; }

/* ============================================================
   Product Cards
   ============================================================ */
.ai-chat-sjpro-product-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding: 4px 0;
}

.ai-chat-sjpro-product-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    transition: box-shadow 0.2s;
}

.ai-chat-sjpro-product-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.12);
}

.ai-chat-sjpro-product-img-link {
    display: block;
    background: #f8f9fa;
    text-align: center;
    overflow: hidden;
    max-height: 120px;
}

.ai-chat-sjpro-product-img-link img {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    display: block;
}

.ai-chat-sjpro-product-no-img {
    font-size: 40px;
    padding: 20px;
    color: #ccc;
}

.ai-chat-sjpro-product-info {
    padding: 10px 12px 6px;
    flex: 1;
}

.ai-chat-sjpro-product-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #222;
    text-decoration: none;
    margin-bottom: 4px;
    line-height: 1.3;
}

.ai-chat-sjpro-product-name:hover {
    color: var(--aichatbot-primary-color, #0073aa);
}

.ai-chat-sjpro-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--aichatbot-primary-color, #0073aa);
    margin-bottom: 4px;
}

.ai-chat-sjpro-product-desc {
    font-size: 11px;
    color: #777;
    line-height: 1.4;
    margin-top: 4px;
}

.ai-chat-sjpro-product-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px 10px;
    border-top: 1px solid #f0f0f0;
}

.ai-chat-sjpro-atc-btn {
    flex: 1;
    background: var(--aichatbot-primary-color, #0073aa);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-chat-sjpro-atc-btn:hover {
    background: var(--aichatbot-secondary-color, #005a87);
}

.ai-chat-sjpro-atc-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.ai-chat-sjpro-view-btn {
    background: #f8f9fa;
    color: #555;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
}

/* Hidden product cards (shown after "Show more" click) */
.aicpro-card-hidden {
    display: none !important;
}

/* "Show more results" button */
.aicpro-show-more-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 9px 14px;
    background: transparent;
    border: 1.5px solid var(--aichatbot-primary-color, #0073aa);
    border-radius: 8px;
    color: var(--aichatbot-primary-color, #0073aa);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.aicpro-show-more-btn:hover {
    background: var(--aichatbot-primary-color, #0073aa);
    color: #fff;
}

.ai-chat-sjpro-view-btn:hover {
    background: #e9ecef;
    color: #333;
}

/* Stock badges */
.ai-chat-sjpro-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    margin-top: 3px;
}

.ai-chat-sjpro-badge.in-stock {
    background: #d4edda;
    color: #155724;
}

.ai-chat-sjpro-badge.out-stock {
    background: #f8d7da;
    color: #721c24;
}

/* ============================================================
   Order Card
   ============================================================ */
.ai-chat-sjpro-order-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.ai-chat-sjpro-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.ai-chat-sjpro-order-id {
    font-weight: 700;
    font-size: 13px;
    color: #333;
}

.ai-chat-sjpro-order-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: #e9ecef;
    color: #555;
}

.ai-chat-sjpro-order-status.status-processing { background: #fff3cd; color: #856404; }
.ai-chat-sjpro-order-status.status-completed  { background: #d4edda; color: #155724; }
.ai-chat-sjpro-order-status.status-cancelled  { background: #f8d7da; color: #721c24; }
.ai-chat-sjpro-order-status.status-on-hold    { background: #d1ecf1; color: #0c5460; }
.ai-chat-sjpro-order-status.status-pending    { background: #e2e3e5; color: #383d41; }
.ai-chat-sjpro-order-status.status-refunded   { background: #fce8e8; color: #843434; }

.ai-chat-sjpro-order-body {
    padding: 10px 14px 12px;
}

.ai-chat-sjpro-order-msg {
    font-size: 13px;
    color: #444;
    margin: 0 0 8px;
}

.ai-chat-sjpro-order-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.ai-chat-sjpro-order-link {
    display: inline-block;
    font-size: 12px;
    color: var(--aichatbot-primary-color, #0073aa);
    text-decoration: none;
    font-weight: 600;
}

.ai-chat-sjpro-order-link:hover { text-decoration: underline; }

/* Customer greeting inside order card */
.ai-chat-sjpro-order-greeting {
    padding: 8px 14px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #3c4858;
    border-bottom: 1px solid #f0f0f0;
}

/* Items ordered list inside order card */
.ai-chat-sjpro-order-items {
    margin: 8px 0 6px;
}

.ai-chat-sjpro-order-items-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 4px;
}

.ai-chat-sjpro-order-items-list {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc;
}

.ai-chat-sjpro-order-items-list li {
    font-size: 12px;
    color: #444;
    margin-bottom: 2px;
}

.ai-chat-sjpro-order-item-qty {
    font-size: 11px;
    color: #888;
    font-weight: 600;
}

/* Tracking number row */
.ai-chat-sjpro-order-tracking {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0f7ff;
    border: 1px solid #c8e0f7;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 8px 0 6px;
    font-size: 12px;
}

.ai-chat-sjpro-order-tracking-label {
    font-weight: 600;
    color: #2271b1;
    white-space: nowrap;
}

.ai-chat-sjpro-order-tracking-number {
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0.5px;
    word-break: break-all;
}

/* 17TRACK enriched shipment block */
.ai-chat-sjpro-tracking-17 {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0 6px;
    font-size: 13px;
}

.ai-chat-sjpro-tracking-17-header {
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.ai-chat-sjpro-tracking-17-event {
    color: #4b5563;
    margin-bottom: 4px;
}

.ai-chat-sjpro-tracking-17-time {
    color: #9ca3af;
    font-size: 11px;
}

.ai-chat-sjpro-tracking-17-route {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 6px;
}

.ai-chat-sjpro-tracking-17-link {
    display: inline-block;
    color: #6366f1;
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
}

.ai-chat-sjpro-tracking-17-link:hover {
    text-decoration: underline;
}

/* Order list (my orders) */
.ai-chat-sjpro-order-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-chat-sjpro-order-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    flex-wrap: wrap;
}

.ai-chat-sjpro-order-row-id { font-weight: 700; color: #333; min-width: 55px; }
.ai-chat-sjpro-order-row-date { color: #666; flex: 1; }
.ai-chat-sjpro-order-row-status { font-weight: 600; color: #555; }
.ai-chat-sjpro-order-row-total { font-weight: 700; color: var(--aichatbot-primary-color, #0073aa); }

.ai-chat-sjpro-order-row a {
    color: var(--aichatbot-primary-color, #0073aa);
    text-decoration: none;
    font-size: 11px;
}

/* ============================================================
   Quick-reply Chips
   ============================================================ */
.ai-chat-sjpro-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 20px 10px;
}

.ai-chat-sjpro-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    background: #fff;
    border: 1px solid var(--aichatbot-primary-color, #0073aa);
    border-radius: 20px;
    color: var(--aichatbot-primary-color, #0073aa);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.ai-chat-sjpro-chip:hover {
    background: var(--aichatbot-primary-color, #0073aa);
    color: #fff;
}

/* Upload buttons for file-type form fields */
.ai-chat-sjpro-upload-wrap {
    padding: 6px 20px 10px;
}
.ai-chat-sjpro-upload-btn {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: 16px;
    border: 1px solid rgba(0,174,239,0.4);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.ai-chat-sjpro-upload-btn:hover {
    background: var(--aichatbot-primary-color, #0073aa);
    color: #fff;
}

/* Ensure bot messages containing product grids / order cards stretch full width */
.ai-chat-sjpro-message.bot .ai-chat-sjpro-product-grid,
.ai-chat-sjpro-message.bot .ai-chat-sjpro-order-card,
.ai-chat-sjpro-message.bot .ai-chat-sjpro-order-list {
    max-width: 100%;
    width: 100%;
}

.ai-chat-sjpro-message.bot:has(.ai-chat-sjpro-product-grid),
.ai-chat-sjpro-message.bot:has(.ai-chat-sjpro-order-card),
.ai-chat-sjpro-message.bot:has(.ai-chat-sjpro-order-list) {
    max-width: 95%;
}

/* ==================== Social Links Bar ==================== */
.ai-chat-sjpro-social-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.ai-chat-sjpro-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #6b7280;
    background: transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.ai-chat-sjpro-social-link:hover {
    transform: translateY(-2px);
    color: var(--aichatbot-primary-color, #0073aa);
    background: rgba(0, 0, 0, 0.04);
}

.ai-chat-sjpro-social-link svg {
    display: block;
    pointer-events: none;
}

/* Dark theme */
.ai-chat-sjpro-theme-dark .ai-chat-sjpro-social-bar {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-social-link {
    color: #cbd5e0;
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-social-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Glass theme */
.ai-chat-sjpro-theme-glass .ai-chat-sjpro-social-bar {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-social-link {
    color: rgba(255, 255, 255, 0.8);
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-social-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Minimal theme */
.ai-chat-sjpro-theme-minimal .ai-chat-sjpro-social-bar {
    border-top-color: rgba(0, 0, 0, 0.05);
}

/* Responsive: smaller icons on narrow screens */
@media (max-width: 480px) {
    .ai-chat-sjpro-social-bar {
        gap: 4px;
        padding: 4px 8px;
    }
    .ai-chat-sjpro-social-link {
        width: 26px;
        height: 26px;
    }
    .ai-chat-sjpro-social-link svg {
        width: 15px;
        height: 15px;
    }
}

/* AI Disclaimer */
.ai-chat-sjpro-disclaimer {
    padding: 6px 16px 8px;
    font-size: 10px;
    line-height: 1.4;
    color: #999;
    opacity: 0.6;
    text-align: center;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.ai-chat-sjpro-theme-dark .ai-chat-sjpro-disclaimer {
    background: #2d3748;
    color: rgba(255, 255, 255, 0.5);
    border-top-color: #4a5568;
}

.ai-chat-sjpro-theme-glass .ai-chat-sjpro-disclaimer {
    background: rgba(4, 19, 31, 0.85);
    color: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
