/**
 * OriNexon AI Assistant — Chat Widget Styles
 *
 * Premium glassmorphism chat interface with dark/light theming,
 * smooth animations, and fully responsive design.
 *
 * All selectors use the .orinexon-* prefix to prevent theme conflicts.
 *
 * @package OriNexonAI
 * @since   1.0.0
 */

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES — THEME TOKENS
   ========================================================================== */

.orinexon-chat-wrapper[data-theme="dark"],
.orinexon-chat-wrapper[data-theme="auto"],
.orinexon-chat-wrapper:not([data-theme="light"]):not([data-theme="dark"]) {
    --orinexon-bg-primary: #0F0F1A;
    --orinexon-bg-secondary: #1A1A2E;
    --orinexon-bg-tertiary: #16213E;
    --orinexon-bg-glass: rgba(26, 26, 46, 0.85);
    --orinexon-bg-glass-header: rgba(15, 15, 26, 0.92);
    --orinexon-text-primary: #E8E8F0;
    --orinexon-text-secondary: #A0A0B8;
    --orinexon-text-muted: #6B6B85;
    --orinexon-border: rgba(255, 255, 255, 0.08);
    --orinexon-border-hover: rgba(255, 255, 255, 0.14);
    --orinexon-accent: #6C3CE1;
    --orinexon-accent-light: #8B5CF6;
    --orinexon-accent-dark: #5B2EC4;
    --orinexon-accent-gradient: linear-gradient(135deg, #6C3CE1, #8B5CF6, #A78BFA);
    --orinexon-accent-gradient-hover: linear-gradient(135deg, #7C4DFF, #9D6FFF, #B794F6);
    --orinexon-user-msg-bg: linear-gradient(135deg, #6C3CE1, #7C4DFF);
    --orinexon-ai-msg-bg: rgba(255, 255, 255, 0.05);
    --orinexon-ai-msg-border: rgba(255, 255, 255, 0.06);
    --orinexon-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --orinexon-shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
    --orinexon-glow: 0 0 40px rgba(108, 60, 225, 0.3);
    --orinexon-glow-strong: 0 0 60px rgba(108, 60, 225, 0.45);
    --orinexon-input-bg: rgba(22, 33, 62, 0.6);
    --orinexon-scrollbar-track: transparent;
    --orinexon-scrollbar-thumb: rgba(108, 60, 225, 0.4);
    --orinexon-scrollbar-thumb-hover: rgba(108, 60, 225, 0.7);
    --orinexon-success: #34D399;
    --orinexon-error: #F87171;
    --orinexon-sale-bg: #EF4444;
    --orinexon-star-filled: #FBBF24;
    --orinexon-star-empty: rgba(255, 255, 255, 0.15);
}

.orinexon-chat-wrapper[data-theme="light"] {
    --orinexon-bg-primary: #FFFFFF;
    --orinexon-bg-secondary: #F8F7FF;
    --orinexon-bg-tertiary: #F0EEFF;
    --orinexon-bg-glass: rgba(255, 255, 255, 0.92);
    --orinexon-bg-glass-header: rgba(248, 247, 255, 0.95);
    --orinexon-text-primary: #1A1A2E;
    --orinexon-text-secondary: #6B7280;
    --orinexon-text-muted: #9CA3AF;
    --orinexon-border: rgba(0, 0, 0, 0.08);
    --orinexon-border-hover: rgba(0, 0, 0, 0.14);
    --orinexon-accent: #6C3CE1;
    --orinexon-accent-light: #8B5CF6;
    --orinexon-accent-dark: #5B2EC4;
    --orinexon-accent-gradient: linear-gradient(135deg, #6C3CE1, #8B5CF6, #A78BFA);
    --orinexon-accent-gradient-hover: linear-gradient(135deg, #7C4DFF, #9D6FFF, #B794F6);
    --orinexon-user-msg-bg: linear-gradient(135deg, #6C3CE1, #7C4DFF);
    --orinexon-ai-msg-bg: #F3F0FF;
    --orinexon-ai-msg-border: rgba(108, 60, 225, 0.08);
    --orinexon-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --orinexon-shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.2);
    --orinexon-glow: 0 0 40px rgba(108, 60, 225, 0.15);
    --orinexon-glow-strong: 0 0 60px rgba(108, 60, 225, 0.25);
    --orinexon-input-bg: rgba(240, 238, 255, 0.8);
    --orinexon-scrollbar-track: transparent;
    --orinexon-scrollbar-thumb: rgba(108, 60, 225, 0.3);
    --orinexon-scrollbar-thumb-hover: rgba(108, 60, 225, 0.6);
    --orinexon-success: #059669;
    --orinexon-error: #DC2626;
    --orinexon-sale-bg: #EF4444;
    --orinexon-star-filled: #F59E0B;
    --orinexon-star-empty: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: light) {
    .orinexon-chat-wrapper[data-theme="auto"] {
        --orinexon-bg-primary: #FFFFFF;
        --orinexon-bg-secondary: #F8F7FF;
        --orinexon-bg-tertiary: #F0EEFF;
        --orinexon-bg-glass: rgba(255, 255, 255, 0.92);
        --orinexon-bg-glass-header: rgba(248, 247, 255, 0.95);
        --orinexon-text-primary: #1A1A2E;
        --orinexon-text-secondary: #6B7280;
        --orinexon-text-muted: #9CA3AF;
        --orinexon-border: rgba(0, 0, 0, 0.08);
        --orinexon-border-hover: rgba(0, 0, 0, 0.14);
        --orinexon-accent: #6C3CE1;
        --orinexon-accent-light: #8B5CF6;
        --orinexon-accent-dark: #5B2EC4;
        --orinexon-accent-gradient: linear-gradient(135deg, #6C3CE1, #8B5CF6, #A78BFA);
        --orinexon-accent-gradient-hover: linear-gradient(135deg, #7C4DFF, #9D6FFF, #B794F6);
        --orinexon-user-msg-bg: linear-gradient(135deg, #6C3CE1, #7C4DFF);
        --orinexon-ai-msg-bg: #F3F0FF;
        --orinexon-ai-msg-border: rgba(108, 60, 225, 0.08);
        --orinexon-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
        --orinexon-shadow-lg: 0 30px 60px -15px rgba(0, 0, 0, 0.2);
        --orinexon-glow: 0 0 40px rgba(108, 60, 225, 0.15);
        --orinexon-glow-strong: 0 0 60px rgba(108, 60, 225, 0.25);
        --orinexon-input-bg: rgba(240, 238, 255, 0.8);
        --orinexon-scrollbar-track: transparent;
        --orinexon-scrollbar-thumb: rgba(108, 60, 225, 0.3);
        --orinexon-scrollbar-thumb-hover: rgba(108, 60, 225, 0.6);
        --orinexon-success: #059669;
        --orinexon-error: #DC2626;
        --orinexon-sale-bg: #EF4444;
        --orinexon-star-filled: #F59E0B;
        --orinexon-star-empty: rgba(0, 0, 0, 0.1);
    }
}

/* ==========================================================================
   2. BASE / RESET — SCOPED
   ========================================================================== */

.orinexon-chat-wrapper,
.orinexon-chat-wrapper *,
.orinexon-chat-wrapper *::before,
.orinexon-chat-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.orinexon-chat-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--orinexon-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   3. CHAT TOGGLE BUTTON
   ========================================================================== */

.orinexon-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--orinexon-accent-gradient);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        var(--orinexon-glow),
        0 8px 24px rgba(108, 60, 225, 0.35);
    transition:
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
    outline: none;
    overflow: hidden;
    animation: orinexonPulse 2s ease-in-out 3;
}

/* Position variants */
.orinexon-chat-wrapper[data-position="bottom-left"] .orinexon-chat-toggle {
    right: auto;
    left: 24px;
}

.orinexon-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow:
        var(--orinexon-glow-strong),
        0 12px 32px rgba(108, 60, 225, 0.45);
}

.orinexon-chat-toggle:active {
    transform: scale(0.95);
}

.orinexon-chat-toggle:focus-visible {
    outline: 2px solid var(--orinexon-accent-light);
    outline-offset: 3px;
}

/* Icon states */
.orinexon-chat-toggle-icon,
.orinexon-chat-toggle-close {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease;
}

.orinexon-chat-toggle-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.orinexon-chat-toggle-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Open state — swap icons */
.orinexon-chat-wrapper.orinexon-open .orinexon-chat-toggle-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.orinexon-chat-wrapper.orinexon-open .orinexon-chat-toggle-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Notification badge */
.orinexon-chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--orinexon-bg-primary);
    animation: orinexonBadgeBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1;
}

/* ==========================================================================
   4. CHAT WINDOW
   ========================================================================== */

.orinexon-chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 999999;
    width: 420px;
    height: 620px;
    max-height: calc(100vh - 130px);
    border-radius: 20px;
    background: var(--orinexon-bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--orinexon-shadow);
    border: 1px solid var(--orinexon-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}

/* Position variants */
.orinexon-chat-wrapper[data-position="bottom-left"] .orinexon-chat-window {
    right: auto;
    left: 24px;
    transform-origin: bottom left;
}

/* Open / Close animations */
.orinexon-chat-window.orinexon-window-enter {
    animation: orinexonSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.orinexon-chat-window.orinexon-window-exit {
    animation: orinexonSlideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ==========================================================================
   5. CHAT HEADER
   ========================================================================== */

.orinexon-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--orinexon-bg-glass-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--orinexon-border);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Subtle gradient shine on header */
.orinexon-chat-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--orinexon-accent-light), transparent);
    opacity: 0.4;
}

.orinexon-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* AI Avatar */
.orinexon-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--orinexon-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(108, 60, 225, 0.3);
}

.orinexon-chat-header-text {
    min-width: 0;
}

.orinexon-chat-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--orinexon-text-primary);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orinexon-chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--orinexon-text-secondary);
    margin-top: 2px;
}

.orinexon-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orinexon-success);
    display: inline-block;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
    animation: orinexonStatusPulse 2s ease-in-out infinite;
}

/* Action buttons */
.orinexon-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.orinexon-action-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent !important;
    color: var(--orinexon-text-secondary) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.orinexon-action-btn:hover {
    background: var(--orinexon-ai-msg-bg) !important;
    color: var(--orinexon-text-primary) !important;
}

.orinexon-action-btn:focus-visible {
    outline: 2px solid var(--orinexon-accent) !important;
    outline-offset: 1px !important;
}

.orinexon-action-btn svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    color: inherit !important;
    stroke: currentColor !important;
    fill: none !important;
}

.orinexon-action-btn svg path,
.orinexon-action-btn svg circle {
    stroke: currentColor !important;
}

/* Theme toggle icon visibility */
.orinexon-chat-wrapper[data-theme="dark"] .orinexon-icon-sun {
    display: flex !important;
}
.orinexon-chat-wrapper[data-theme="dark"] .orinexon-icon-moon {
    display: none !important;
}
.orinexon-chat-wrapper[data-theme="light"] .orinexon-icon-sun {
    display: none !important;
}
.orinexon-chat-wrapper[data-theme="light"] .orinexon-icon-moon {
    display: flex !important;
}

/* ==========================================================================
   6. MESSAGES AREA
   ========================================================================== */

.orinexon-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.orinexon-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.orinexon-chat-messages::-webkit-scrollbar-track {
    background: var(--orinexon-scrollbar-track);
}

.orinexon-chat-messages::-webkit-scrollbar-thumb {
    background: var(--orinexon-scrollbar-thumb);
    border-radius: 10px;
}

.orinexon-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--orinexon-scrollbar-thumb-hover);
}

/* Firefox scrollbar */
.orinexon-chat-messages {
    scrollbar-width: thin;
    scrollbar-color: var(--orinexon-scrollbar-thumb) var(--orinexon-scrollbar-track);
}

/* ==========================================================================
   7. MESSAGE BUBBLES
   ========================================================================== */

/* Shared message wrapper */
.orinexon-message {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    max-width: 85%;
}

/* User messages — right-aligned */
.orinexon-message-user {
    align-self: flex-end;
    align-items: flex-end;
}

/* AI messages — left-aligned */
.orinexon-message-assistant {
    align-self: flex-start;
    align-items: flex-start;
}

/* AI avatar beside message */
.orinexon-message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--orinexon-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.orinexon-message-avatar svg {
    width: 14px;
    height: 14px;
}

/* Message bubble — user */
.orinexon-message-user .orinexon-message-bubble {
    background: var(--orinexon-user-msg-bg);
    color: #FFFFFF;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.55;
    box-shadow: 0 2px 8px rgba(108, 60, 225, 0.3);
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: orinexonSlideInRight 0.3s ease;
}

/* Message bubble — AI */
.orinexon-message-assistant .orinexon-message-bubble {
    background: var(--orinexon-ai-msg-bg);
    border: 1px solid var(--orinexon-ai-msg-border);
    color: var(--orinexon-text-primary);
    border-radius: 18px 18px 18px 4px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
    animation: orinexonSlideInLeft 0.3s ease;
}

/* Message content */
.orinexon-message-content {
    word-break: break-word;
}

.orinexon-message-content p {
    margin: 0 0 8px 0;
}

.orinexon-message-content p:last-child {
    margin-bottom: 0;
}

.orinexon-message-content a {
    color: var(--orinexon-accent-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.orinexon-message-user .orinexon-message-content a {
    color: #FFFFFF;
    text-decoration: underline;
    opacity: 0.9;
}

.orinexon-message-content strong {
    font-weight: 600;
}

.orinexon-message-content ul,
.orinexon-message-content ol {
    margin: 6px 0;
    padding-left: 20px;
}

.orinexon-message-content li {
    margin-bottom: 4px;
}

/* Timestamp */
.orinexon-message-time {
    font-size: 10px;
    color: var(--orinexon-text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.orinexon-message-user .orinexon-message-time {
    color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   8. WELCOME MESSAGE
   ========================================================================== */

.orinexon-welcome-message {
    text-align: center;
    padding: 20px 16px;
    animation: orinexonFadeIn 0.5s ease;
}

.orinexon-welcome-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--orinexon-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(108, 60, 225, 0.3);
}

.orinexon-welcome-avatar svg {
    width: 28px;
    height: 28px;
}

.orinexon-welcome-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--orinexon-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.orinexon-welcome-text {
    font-size: 14px;
    color: var(--orinexon-text-secondary);
    line-height: 1.6;
    max-width: 320px;
    margin: 0 auto;
}

/* ==========================================================================
   9. TYPING INDICATOR
   ========================================================================== */

.orinexon-typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    flex-shrink: 0;
}

.orinexon-typing-avatar {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--orinexon-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    flex-shrink: 0;
}

.orinexon-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--orinexon-ai-msg-bg);
    border: 1px solid var(--orinexon-ai-msg-border);
    border-radius: 18px;
    padding: 12px 20px;
}

.orinexon-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orinexon-accent);
    opacity: 0.6;
    display: inline-block;
}

.orinexon-typing-dots span:nth-child(1) {
    animation: orinexonBounce 1.4s ease-in-out infinite;
    animation-delay: 0s;
}

.orinexon-typing-dots span:nth-child(2) {
    animation: orinexonBounce 1.4s ease-in-out infinite;
    animation-delay: 0.2s;
}

.orinexon-typing-dots span:nth-child(3) {
    animation: orinexonBounce 1.4s ease-in-out infinite;
    animation-delay: 0.4s;
}

/* ==========================================================================
   10. INPUT AREA
   ========================================================================== */

.orinexon-chat-input-area {
    background: var(--orinexon-bg-secondary);
    border-top: 1px solid var(--orinexon-border);
    padding: 16px 20px 12px;
    flex-shrink: 0;
}

.orinexon-input-wrapper {
    display: flex !important;
    align-items: flex-end !important;
    gap: 8px !important;
    background: var(--orinexon-input-bg) !important;
    border-radius: 24px !important;
    border: 1px solid var(--orinexon-border) !important;
    padding: 6px 6px 6px 16px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.orinexon-input-wrapper:focus-within {
    border-color: var(--orinexon-accent) !important;
    box-shadow: 0 0 0 3px rgba(108, 60, 225, 0.12) !important;
}

.orinexon-chat-input {
    flex: 1 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--orinexon-text-primary) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    resize: none !important;
    min-height: 24px !important;
    max-height: 120px !important;
    padding: 6px 0 !important;
    margin: 0 !important;
    overflow-y: auto !important;
}

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

.orinexon-chat-input::-webkit-scrollbar {
    width: 3px !important;
}

.orinexon-chat-input::-webkit-scrollbar-thumb {
    background: var(--orinexon-scrollbar-thumb) !important;
    border-radius: 10px !important;
}

/* Send button */
.orinexon-chat-send {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    border: none !important;
    background: var(--orinexon-accent-gradient) !important;
    color: #FFFFFF !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, box-shadow 0.2s ease !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.orinexon-chat-send:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    transform: none !important;
    background: rgba(108, 60, 225, 0.2) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.orinexon-chat-send svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    color: inherit !important;
    stroke: currentColor !important;
    fill: none !important;
}

.orinexon-chat-send svg path {
    stroke: currentColor !important;
}

.orinexon-chat-send:not(:disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(108, 60, 225, 0.4);
}

.orinexon-chat-send:not(:disabled):active {
    transform: scale(0.95);
}

.orinexon-chat-send:focus-visible {
    outline: 2px solid var(--orinexon-accent-light);
    outline-offset: 2px;
}

/* Footer branding */
.orinexon-chat-footer {
    text-align: center;
    padding-top: 10px;
    font-size: 10px;
    color: var(--orinexon-text-muted);
}

.orinexon-chat-footer strong {
    color: var(--orinexon-accent-light);
    font-weight: 600;
}

/* ==========================================================================
   11. PRODUCT CARDS
   ========================================================================== */

.orinexon-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.orinexon-product-card {
    background: var(--orinexon-bg-secondary);
    border: 1px solid var(--orinexon-border);
    border-radius: 12px;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
    animation: orinexonFadeIn 0.4s ease both;
}

.orinexon-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-color: var(--orinexon-border-hover);
}

/* Product image */
.orinexon-product-image {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: var(--orinexon-bg-tertiary);
}

.orinexon-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.orinexon-product-card:hover .orinexon-product-image img {
    transform: scale(1.05);
}

/* Sale badge */
.orinexon-sale-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--orinexon-sale-bg);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Product info */
.orinexon-product-info {
    padding: 12px;
}

.orinexon-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--orinexon-text-primary);
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Price */
.orinexon-product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--orinexon-accent);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.orinexon-price-original {
    font-size: 13px;
    font-weight: 400;
    color: var(--orinexon-text-muted);
    text-decoration: line-through;
}

.orinexon-price-sale {
    color: var(--orinexon-sale-bg);
}

/* Rating */
.orinexon-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--orinexon-text-secondary);
}

.orinexon-product-rating svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.orinexon-rating-count {
    margin-left: 4px;
    font-size: 11px;
    color: var(--orinexon-text-muted);
}

/* Product action buttons */
.orinexon-product-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.orinexon-add-to-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--orinexon-accent-gradient);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    white-space: nowrap;
}

.orinexon-add-to-cart:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(108, 60, 225, 0.35);
}

.orinexon-add-to-cart:active {
    transform: scale(0.97);
}

.orinexon-add-to-cart:focus-visible {
    outline: 2px solid var(--orinexon-accent-light);
    outline-offset: 2px;
}

.orinexon-add-to-cart.orinexon-btn-loading {
    pointer-events: none;
    opacity: 0.75;
}

.orinexon-add-to-cart.orinexon-btn-success {
    background: var(--orinexon-success);
    animation: orinexonCartBounce 0.5s ease;
}

.orinexon-add-to-cart.orinexon-btn-error {
    background: var(--orinexon-error);
}

.orinexon-add-to-cart svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.orinexon-view-product {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    color: var(--orinexon-text-secondary);
    border: 1px solid var(--orinexon-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    outline: none;
    white-space: nowrap;
}

.orinexon-view-product:hover {
    background: var(--orinexon-ai-msg-bg);
    color: var(--orinexon-text-primary);
    border-color: var(--orinexon-border-hover);
}

.orinexon-view-product:focus-visible {
    outline: 2px solid var(--orinexon-accent);
    outline-offset: 2px;
}

.orinexon-view-product svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Order Now button — premium green gradient CTA */
.orinexon-order-now {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    white-space: nowrap;
}

.orinexon-order-now:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.orinexon-order-now:active {
    transform: scale(0.97);
}

.orinexon-order-now:focus-visible {
    outline: 2px solid #34D399;
    outline-offset: 2px;
}

.orinexon-order-now.orinexon-btn-loading {
    pointer-events: none;
    opacity: 0.75;
}

.orinexon-order-now.orinexon-btn-success {
    background: linear-gradient(135deg, #059669, #047857);
    animation: orinexonCartBounce 0.5s ease;
}

.orinexon-order-now.orinexon-btn-error {
    background: var(--orinexon-error);
}

/* ==========================================================================
   12. SPINNER
   ========================================================================== */

.orinexon-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: orinexonSpin 0.6s linear infinite;
}

/* ==========================================================================
   13. ERROR MESSAGE
   ========================================================================== */

.orinexon-error-bubble {
    background: rgba(248, 113, 113, 0.1) !important;
    border: 1px solid rgba(248, 113, 113, 0.2) !important;
}

.orinexon-error-text {
    color: var(--orinexon-error);
    font-size: 13px;
}

/* ==========================================================================
   14. SHIMMER / LOADING PLACEHOLDER
   ========================================================================== */

.orinexon-shimmer {
    background: linear-gradient(
        90deg,
        var(--orinexon-ai-msg-bg) 25%,
        var(--orinexon-border) 50%,
        var(--orinexon-ai-msg-bg) 75%
    );
    background-size: 200% 100%;
    animation: orinexonShimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* ==========================================================================
   15. KEYFRAME ANIMATIONS
   ========================================================================== */

@keyframes orinexonSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes orinexonSlideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

@keyframes orinexonSlideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes orinexonSlideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes orinexonFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes orinexonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            var(--orinexon-glow),
            0 8px 24px rgba(108, 60, 225, 0.35);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            var(--orinexon-glow-strong),
            0 12px 32px rgba(108, 60, 225, 0.45);
    }
}

@keyframes orinexonBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

@keyframes orinexonBadgeBounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes orinexonStatusPulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
    }
    50% {
        opacity: 0.6;
        box-shadow: 0 0 2px rgba(52, 211, 153, 0.2);
    }
}

@keyframes orinexonShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes orinexonCartBounce {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(0.95);
    }
    70% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes orinexonSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes orinexonTypewriterCursor {
    0%, 100% {
        border-right-color: var(--orinexon-accent);
    }
    50% {
        border-right-color: transparent;
    }
}

/* ==========================================================================
   16. STAGGERED PRODUCT CARD ANIMATION
   ========================================================================== */

.orinexon-product-card:nth-child(1) { animation-delay: 0s; }
.orinexon-product-card:nth-child(2) { animation-delay: 0.1s; }
.orinexon-product-card:nth-child(3) { animation-delay: 0.2s; }
.orinexon-product-card:nth-child(4) { animation-delay: 0.3s; }
.orinexon-product-card:nth-child(5) { animation-delay: 0.4s; }

/* ==========================================================================
   17. REDUCED MOTION SUPPORT
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .orinexon-chat-wrapper,
    .orinexon-chat-wrapper * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   18. MOBILE RESPONSIVE — FULL SCREEN ON SMALL DEVICES
   ========================================================================== */

@media screen and (max-width: 480px) {
    .orinexon-chat-toggle {
        bottom: 10px !important;
        right: 10px !important;
        width: 140px !important;
        height: 52px !important;
        border-radius: 26px !important;
    }

    .orinexon-chat-wrapper.orinexon-open .orinexon-chat-toggle {
        display: none !important;
    }

    .orinexon-chat-wrapper[data-position="bottom-left"] .orinexon-chat-toggle {
        left: 10px !important;
        right: auto !important;
    }

    .orinexon-chat-window {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        width: calc(100% - 20px) !important;
        height: calc(100% - 20px) !important;
        max-height: calc(100vh - 20px) !important;
        border-radius: 16px !important;
        transform-origin: bottom center !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    }

    .orinexon-chat-wrapper[data-position="bottom-left"] .orinexon-chat-window {
        left: 10px !important;
        right: 10px !important;
    }

    .orinexon-chat-header {
        padding: 14px 16px;
        /* Safe area for notched phones */
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .orinexon-chat-avatar {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .orinexon-chat-title {
        font-size: 15px;
    }

    .orinexon-chat-messages {
        padding: 16px;
    }

    .orinexon-message {
        max-width: 90%;
    }

    .orinexon-chat-input-area {
        padding: 12px 16px 10px;
        /* Safe area for iPhones with home bar */
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .orinexon-product-card {
        max-width: 100%;
    }

    .orinexon-products-grid {
        grid-template-columns: 1fr;
    }

    .orinexon-product-image {
        height: 140px;
    }

    .orinexon-welcome-avatar {
        width: 48px;
        height: 48px;
    }

    .orinexon-welcome-title {
        font-size: 16px;
    }

    .orinexon-welcome-text {
        font-size: 13px;
    }
}

/* Slightly larger phones / small tablets */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .orinexon-chat-window {
        width: 380px;
        height: 560px;
    }
}

/* ==========================================================================
   19. PRINT STYLES — HIDE WIDGET
   ========================================================================== */

@media print {
    .orinexon-chat-wrapper {
        display: none !important;
    }
}

/* ==========================================================================
   20. ELEMENTOR COMPATIBILITY
   ========================================================================== */

/* Ensure widget renders above Elementor overlays and modals */
.orinexon-chat-wrapper {
    position: relative;
    z-index: 999997;
}

/* Prevent Elementor global styles from leaking into our widget */
.orinexon-chat-wrapper button {
    letter-spacing: normal;
    text-transform: none;
}

.orinexon-chat-wrapper h3 {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

.orinexon-chat-wrapper a {
    text-decoration: none;
}

.orinexon-chat-wrapper img {
    max-width: 100%;
    height: auto;
}

/* Prevent Elementor popups from being hidden behind our widget */
body.elementor-popup-modal-open .orinexon-chat-wrapper {
    z-index: auto;
}
