/**
 * SiteSage AI - Apple macOS/iOS Inspired Design
 * 
 * Subtle luxury with black, white, and gray tones
 * True Apple aesthetic with SF Pro Display feel
 */

/* ===========================
   CSS Variables - Apple Style
   =========================== */

:root {
    /* Apple Colors */
    --ssai-black: #000000;
    --ssai-gray-900: #1c1c1e;
    --ssai-gray-800: #2c2c2e;
    --ssai-gray-700: #3a3a3c;
    --ssai-gray-600: #48484a;
    --ssai-gray-500: #636366;
    --ssai-gray-400: #8e8e93;
    --ssai-gray-300: #aeaeb2;
    --ssai-gray-200: #c7c7cc;
    --ssai-gray-100: #d1d1d6;
    --ssai-gray-50: #e5e5ea;
    --ssai-white: #ffffff;

    /* Functional Colors */
    --ssai-bg-primary: #f5f5f7;
    --ssai-bg-secondary: #ffffff;
    --ssai-text-primary: #1d1d1f;
    --ssai-text-secondary: #6e6e73;
    --ssai-border: rgba(0, 0, 0, 0.1);
    --ssai-shadow: rgba(0, 0, 0, 0.08);

    /* Typography - Apple San Francisco Pro Display */
    --ssai-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Dynamic Controls */
    --ssai-launcher-bg-color: #1c1c1e;
    --ssai-header-bg-color: rgba(255, 255, 255, 0.9);
    --ssai-send-btn-color: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --ssai-send-btn-text-color: #ffffff;
    --ssai-user-bubble-color: linear-gradient(135deg, #111827 0%, #1f2937 100%);
    --ssai-user-bubble-text-color: #f9fafb;
    --ssai-bot-bubble-color: rgba(255, 255, 255, 0.95);
    --ssai-bot-bubble-text-color: var(--ssai-text-primary);
}

/* ===========================
   CSS Isolation & Reset
   =========================== */

/* Scoped reset to prevent theme styles from bleeding in */
.ssai-chat-widget,
.ssai-chat-widget *,
.ssai-chat-widget *::before,
.ssai-chat-widget *::after,
.ssai-chat-trigger,
.ssai-chat-trigger * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reset specific elements within the widget */
.ssai-chat-widget button,
.ssai-chat-widget input,
.ssai-chat-widget textarea,
.ssai-chat-widget select {
    font-family: var(--ssai-font-family);
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
    text-transform: none;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    /* Reset theme border-radius */
    background: transparent;
    /* Reset theme backgrounds */
    box-shadow: none;
    /* Reset theme shadows */
    border: none;
    /* Reset theme borders */
}

/* Ensure links don't inherit weird theme styles */
.ssai-chat-widget a {
    text-decoration: none;
    color: inherit;
    border: none;
    box-shadow: none;
}

/* Fix for potential theme icon conflicts */
.ssai-chat-widget svg,
.ssai-chat-trigger svg {
    display: block;
    vertical-align: middle;
    max-width: 100%;
    height: auto;
    fill: currentColor;
    /* Ensure fill uses our color */
}

/* Override common theme button styles that might be too aggressive */
.ssai-chat-widget .ssai-send-btn,
.ssai-chat-widget .ssai-product-btn,
.ssai-chat-widget .ssai-content-btn,
.ssai-chat-widget .ssai-cta-btn {
    line-height: normal !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

/* ===========================
   Chat Trigger Button
   =========================== */

.ssai-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    background: var(--ssai-launcher-bg-color, var(--ssai-gray-900));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999999;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    color: var(--ssai-white);
}

.ssai-chat-trigger:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.16),
        0 12px 48px rgba(0, 0, 0, 0.12);
    filter: brightness(1.05);
}

.ssai-chat-trigger:active {
    transform: translateY(0) scale(1);
}

.ssai-trigger-icon {
    width: 32px;
    height: 32px;
    color: var(--ssai-white);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-trigger-icon--image {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.ssai-chat-trigger:hover .ssai-trigger-icon {
    transform: scale(1.1);
}

/* ===========================
   Chat Widget Container
   =========================== */

.ssai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 450px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.04),
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 16px 32px rgba(0, 0, 0, 0.08);
    display: none;
    flex-direction: column;
    z-index: 999999;
    overflow: hidden;
    animation: ssai-slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-chat-widget.sitesage-active,
.ssai-chat-widget.ssai-active {
    display: flex;
}

@keyframes ssai-slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===========================
   Chat Header - Apple Style
   =========================== */

.ssai-chat-header {
    padding: 16px 20px;
    background: var(--ssai-header-bg-color, rgba(255, 255, 255, 0.9));
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ssai-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.ssai-header-logo {
    max-width: 180px;
    min-width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
}

.ssai-header-logo--fallback {
    background: linear-gradient(135deg, var(--ssai-gray-900) 0%, var(--ssai-gray-800) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

.ssai-header-logo--image {
    background: transparent;
    border: none;
    padding: 0;
    min-width: 0;
    height: 36px;
}

/* For SVG logos (default icon) */
.ssai-header-logo svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* For custom image logos (supports horizontal) */
.ssai-header-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 36px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 6px 20px rgba(15, 23, 42, 0.25));
}

/* If logo is just an img, make container adapt */
.ssai-header-logo:has(img):not(:has(svg)) {
    width: auto;
    padding: 0;
}

.ssai-header-info {
    flex: 1;
}

.ssai-header-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--ssai-text-primary);
    line-height: 1.3;
    letter-spacing: -0.4px;
    font-family: var(--ssai-font-family);
    display: none !important;
    opacity: 0.85;
}

.ssai-header-actions {
    display: flex;
    gap: 8px;
}

.ssai-header-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    color: var(--ssai-gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.ssai-header-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--ssai-gray-900);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.ssai-header-btn:active {
    background: var(--ssai-gray-100);
    transform: scale(0.95);
}

.ssai-header-btn svg {
    width: 16px;
    height: 16px;
}

/* ===========================
   Chat Body
   =========================== */

.ssai-chat-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    background: linear-gradient(180deg, #fbfbfd 0%, #f3f4f6 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.ssai-chat-body::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.08;
    pointer-events: none;
}

.ssai-chat-body>* {
    position: relative;
}

.ssai-chat-body::-webkit-scrollbar {
    width: 8px;
}

.ssai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.ssai-chat-body::-webkit-scrollbar-thumb {
    background: var(--ssai-gray-300);
    border-radius: 4px;
    border: 2px solid var(--ssai-bg-primary);
}

.ssai-chat-body::-webkit-scrollbar-thumb:hover {
    background: var(--ssai-gray-400);
}

/* Welcome Message */
.ssai-welcome-message {
    background: var(--ssai-white);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 0.5px solid var(--ssai-border);
}

.ssai-welcome-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
}

.ssai-welcome-icon svg {
    width: 100%;
    height: 100%;
}

.ssai-welcome-title {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--ssai-text-primary);
    letter-spacing: -0.4px;
    font-family: var(--ssai-font-family);
}

.ssai-welcome-text {
    margin: 0;
    font-size: 15px;
    color: var(--ssai-text-secondary);
    line-height: 1.5;
    font-family: var(--ssai-font-family);
}

/* Chat Messages */
.ssai-message {
    display: flex;
    max-width: 80%;
    animation: ssai-messageSlide 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes ssai-messageSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ssai-message.ssai-user {
    align-self: flex-end;
    margin-left: auto;
}

.ssai-message.ssai-bot {
    align-self: flex-start;
}

.ssai-message-content {
    flex: 1;
    min-width: 0;
}

.ssai-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    font-family: var(--ssai-font-family);
    text-align: left;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.ssai-message.ssai-user .ssai-message-bubble {
    background: var(--ssai-user-bubble-color, linear-gradient(135deg, #111827 0%, #1f2937 100%));
    color: var(--ssai-user-bubble-text-color, #f9fafb);
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ssai-message.ssai-bot .ssai-message-bubble {
    background: var(--ssai-bot-bubble-color, rgba(255, 255, 255, 0.95));
    color: var(--ssai-bot-bubble-text-color, var(--ssai-text-primary));
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.ssai-message-bubble a {
    color: inherit;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.ssai-message-bubble a:hover {
    opacity: 0.7;
}

.ssai-message.ssai-bot .ssai-message-bubble a {
    color: var(--ssai-gray-900);
    font-weight: 500;
}

/* Product containers within messages */
.ssai-message-bubble .ssai-product-card,
.ssai-message-bubble .ssai-products-grid {
    margin: 12px 0;
}

.ssai-message-bubble .ssai-product-card:first-child,
.ssai-message-bubble .ssai-products-grid:first-child {
    margin-top: 8px;
}

.ssai-message-bubble .ssai-product-card:last-child,
.ssai-message-bubble .ssai-products-grid:last-child {
    margin-bottom: 8px;
}

/* Remove link underline from product cards */
.ssai-message-bubble .ssai-product-list-item {
    text-decoration: none;
}

.ssai-message-bubble .ssai-product-btn {
    text-decoration: none;
}

/* Product Card Styles - Glassy Design */
.ssai-product-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: ssai-cardSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-product-card:hover {
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.12);
}

@keyframes ssai-cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Product Image Wrapper for Single Product Card */
.ssai-product-card .ssai-product-image-wrapper {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--ssai-gray-50);
    position: relative;
}

.ssai-product-card .ssai-product-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.ssai-product-card:hover .ssai-product-image-wrapper::before {
    left: 100%;
}

.ssai-product-card .ssai-product-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.ssai-product-card .ssai-product-placeholder {
    width: 100%;
    min-height: 200px;
    animation: ssai-placeholderPulse 2s ease-in-out infinite;
}

@keyframes ssai-placeholderPulse {

    0%,
    100% {
        background: var(--ssai-gray-50);
    }

    50% {
        background: var(--ssai-gray-100);
    }
}

.ssai-product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 12px;
}

.ssai-product-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--ssai-text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.4px;
    line-height: 1.3;
    font-family: var(--ssai-font-family);
}

.ssai-product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--ssai-gray-900);
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.ssai-product-regular-price {
    font-size: 15px;
    color: var(--ssai-text-secondary);
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 400;
}

.ssai-product-description {
    font-size: 14px;
    color: var(--ssai-text-secondary);
    line-height: 1.5;
    margin: 10px 0;
}

.ssai-product-meta {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.ssai-product-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.2px;
    animation: ssai-badgeFadeIn 0.5s ease-out;
}

@keyframes ssai-badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ssai-product-badge.ssai-in-stock {
    background: rgba(52, 199, 89, 0.12);
    color: #30a14e;
}

.ssai-product-badge.ssai-out-of-stock {
    background: rgba(255, 59, 48, 0.12);
    color: #d1242f;
}

.ssai-product-badge.ssai-on-sale {
    background: rgba(255, 149, 0, 0.12);
    color: #e8790e;
    animation: ssai-salePulse 2s ease-in-out infinite;
}

@keyframes ssai-salePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(255, 149, 0, 0);
    }
}

.ssai-product-badge.ssai-low-stock {
    background: rgba(255, 204, 0, 0.12);
    color: #d4a500;
    animation: ssai-lowStockPulse 1.5s ease-in-out infinite;
}

@keyframes ssai-lowStockPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.ssai-product-actions {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.ssai-product-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--ssai-gray-900);
    color: var(--ssai-white);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--ssai-font-family);
    text-decoration: none;
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
}

.ssai-product-btn,
.ssai-product-btn * {
    color: var(--ssai-white) !important;
}

.ssai-product-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ssai-product-btn:hover::before {
    width: 300px;
    height: 300px;
}

.ssai-product-btn:hover {
    background: var(--ssai-gray-800);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ssai-product-btn:active {
    transform: translateY(0) scale(0.98);
}

.ssai-out-of-stock-note {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    padding: 18px 20px;
    margin: 16px 0;
    color: var(--ssai-text-primary);
    font-size: 15px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* Content Cards - Pages, Posts, CTAs */
.ssai-content-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    color: inherit;
    display: block;
    animation: ssai-cardSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-content-card:hover {
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.12);
}

.ssai-content-card .ssai-content-image-wrapper {
    width: 100%;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--ssai-gray-50);
    position: relative;
}

.ssai-content-card .ssai-content-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.ssai-content-card:hover .ssai-content-image-wrapper::before {
    left: 100%;
}

.ssai-content-card .ssai-content-image {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    display: block;
    border: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-content-card:hover .ssai-content-image {
    transform: scale(1.05);
}

.ssai-content-card .ssai-content-placeholder {
    width: 100%;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--ssai-gray-50);
    animation: ssai-placeholderPulse 2s ease-in-out infinite;
}

.ssai-content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.ssai-content-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--ssai-text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.4px;
    line-height: 1.3;
    font-family: var(--ssai-font-family);
}

.ssai-content-description {
    font-size: 14px;
    color: var(--ssai-text-secondary);
    line-height: 1.5;
    margin: 10px 0;
}

.ssai-content-meta {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.ssai-content-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.2px;
    background: rgba(0, 122, 255, 0.12);
    color: #007aff;
    animation: ssai-badgeFadeIn 0.5s ease-out;
}

.ssai-content-actions {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ssai-content-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #ffffff;
    color: var(--ssai-text-primary);
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--ssai-font-family);
    text-decoration: none;
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.ssai-content-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ssai-content-btn:hover::before {
    width: 300px;
    height: 300px;
}

.ssai-content-btn:hover {
    border-color: rgba(15, 23, 42, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
}

.ssai-content-btn:active {
    transform: translateY(0) scale(0.98);
}

/* CTA Card Styles */
.ssai-cta-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin: 12px 0;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: ssai-cardSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-cta-card:hover {
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.12);
}

.ssai-cta-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ssai-cta-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f4f4f5 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    color: #0f172a;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-cta-card:hover .ssai-cta-icon {
    transform: scale(1.1) rotate(5deg);
}

.ssai-cta-info {
    flex: 1;
    min-width: 0;
}

.ssai-cta-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ssai-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px 0;
}

.ssai-cta-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--ssai-text-primary);
    margin: 0;
    word-break: break-word;
}

.ssai-cta-actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ssai-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: #ffffff;
    color: var(--ssai-text-primary);
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--ssai-font-family);
    text-decoration: none;
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.ssai-cta-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ssai-cta-btn:hover::before {
    width: 300px;
    height: 300px;
}

.ssai-cta-btn:hover {
    border-color: rgba(15, 23, 42, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
}

.ssai-cta-btn:active {
    transform: translateY(0) scale(0.98);
}

.ssai-cta-btn svg {
    width: 16px;
    height: 16px;
}

/* Content List (multiple pages/posts) */
.ssai-content-list-item {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 14px;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    color: inherit;
    margin: 8px 0;
    animation: ssai-listItemSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-fill-mode: both;
}

/* Staggered animation for content list items */
.ssai-content-list-item:nth-child(1) {
    animation-delay: 0.05s;
}

.ssai-content-list-item:nth-child(2) {
    animation-delay: 0.1s;
}

.ssai-content-list-item:nth-child(3) {
    animation-delay: 0.15s;
}

.ssai-content-list-item:nth-child(4) {
    animation-delay: 0.2s;
}

.ssai-content-list-item:nth-child(5) {
    animation-delay: 0.25s;
}

.ssai-content-list-item:nth-child(n+6) {
    animation-delay: 0.3s;
}

.ssai-content-list-item:hover {
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-1px) translateX(4px);
    border-color: rgba(0, 0, 0, 0.1);
}

.ssai-content-list-image {
    width: 90px;
    height: auto;
    min-height: 90px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--ssai-gray-50);
    flex-shrink: 0;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    align-self: stretch;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-content-list-item:hover .ssai-content-list-image {
    transform: scale(1.05);
}

.ssai-content-list-placeholder {
    width: 90px;
    min-height: 90px;
    border-radius: 10px;
    background: var(--ssai-gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    animation: ssai-placeholderPulse 2s ease-in-out infinite;
}

.ssai-content-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ssai-content-list-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ssai-text-primary);
    margin: 0 0 2px 0;
    letter-spacing: -0.3px;
    line-height: 1.3;
    font-family: var(--ssai-font-family);
}

.ssai-content-list-description {
    font-size: 13px;
    color: var(--ssai-text-secondary);
    line-height: 1.4;
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ssai-content-list-meta {
    display: flex;
    gap: 6px;
    margin-top: auto;
    flex-wrap: wrap;
}

/* Multiple Products Grid - Enhanced Glassy Design */
.ssai-products-grid,
.ssai-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 12px 0;
}

/* Product List (2 or more items) - Glassy Cards */
.ssai-product-list-item {
    display: flex;
    gap: 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 14px;
    box-shadow:
        0 1px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    color: inherit;
    align-items: stretch;
    /* Make image and info same height */
    animation: ssai-listItemSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-fill-mode: both;
}

/* Staggered animation for list items */
.ssai-product-list-item:nth-child(1) {
    animation-delay: 0.05s;
}

.ssai-product-list-item:nth-child(2) {
    animation-delay: 0.1s;
}

.ssai-product-list-item:nth-child(3) {
    animation-delay: 0.15s;
}

.ssai-product-list-item:nth-child(4) {
    animation-delay: 0.2s;
}

.ssai-product-list-item:nth-child(5) {
    animation-delay: 0.25s;
}

.ssai-product-list-item:nth-child(n+6) {
    animation-delay: 0.3s;
}

@keyframes ssai-listItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ssai-product-list-item:hover {
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-1px) translateX(4px);
    border-color: rgba(0, 0, 0, 0.1);
}

.ssai-product-image {
    width: 90px;
    /* Increased width for better proportion */
    height: auto;
    /* Auto height to match info */
    min-height: 90px;
    /* Minimum height */
    border-radius: 10px;
    object-fit: cover;
    background: var(--ssai-gray-50);
    flex-shrink: 0;
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    align-self: stretch;
    /* Stretch to match info height */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ssai-product-list-item:hover .ssai-product-image {
    transform: scale(1.05);
}

.ssai-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: space-between;
    /* Distribute content evenly */
}

.ssai-product-list-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ssai-text-primary);
    margin: 0 0 2px 0;
    letter-spacing: -0.3px;
    line-height: 1.3;
    font-family: var(--ssai-font-family);
}

.ssai-product-list-description {
    font-size: 13px;
    color: var(--ssai-text-secondary);
    line-height: 1.4;
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ssai-product-list-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--ssai-gray-900);
    margin: 2px 0 6px 0;
    letter-spacing: -0.4px;
}

.ssai-product-list-meta {
    display: flex;
    gap: 6px;
    margin-top: auto;
    flex-wrap: wrap;
}

/* Typing Indicator */
.ssai-typing {
    display: flex;
    max-width: 80%;
    animation: ssai-messageSlide 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    align-self: flex-start;
}

.ssai-typing-bubble {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    gap: 4px;
    align-items: center;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.ssai-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--ssai-gray-400);
    border-radius: 50%;
    animation: ssai-typingDot 1.4s ease-in-out infinite;
}

.ssai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ssai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ssai-typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ===========================
   Chat Footer
   =========================== */

.ssai-chat-footer {
    padding: 12px 16px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(15, 23, 42, 0.05);
    flex-shrink: 0;
    backdrop-filter: blur(22px);
}

.ssai-chat-widget .ssai-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: rgba(248, 249, 253, 0.95);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 8px 8px 8px 16px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.ssai-input-container:focus-within {
    background: var(--ssai-white);
    border-color: #2563eb;
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.2);
}

.ssai-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 4px 0;
    font-size: 15px;
    font-family: var(--ssai-font-family);
    resize: none;
    max-height: 120px;
    color: var(--ssai-text-primary);
    line-height: 1.4;
}

.ssai-chat-input:focus {
    outline: none;
}

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

.ssai-chat-widget .ssai-send-btn {
    width: 32px;
    height: 32px;
    background: var(--ssai-send-btn-color, linear-gradient(135deg, #2563eb 0%, #7c3aed 100%));
    border: none;
    border-radius: 50%;
    color: var(--ssai-send-btn-text-color, #ffffff);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.35);
}

.ssai-send-btn:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 16px 30px rgba(99, 102, 241, 0.45);
    filter: brightness(0.96);
}

.ssai-send-btn:active {
    transform: scale(0.95);
}

.ssai-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.ssai-send-icon {
    width: 16px;
    height: 16px;
}

.ssai-chat-widget .ssai-footer-branding {
    text-align: center;
    font-size: 11px;
    color: var(--ssai-text-secondary);
    opacity: 0.8;
}

.ssai-footer-branding a {
    color: var(--ssai-text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.ssai-footer-branding a:hover {
    opacity: 0.7;
}

/* ===========================
   Chat Overlay
   =========================== */

.ssai-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.25);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    display: none;
    z-index: 999998;
    animation: ssai-fadeIn 0.3s ease;
    touch-action: none;
}

.ssai-chat-overlay.sitesage-active,
.ssai-chat-overlay.ssai-active {
    display: block;
}

body.ssai-chat-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

body.ssai-chat-open #wpadminbar {
    position: fixed;
}

@keyframes ssai-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===========================
    Quick Actions - Modern Footer Style
    =========================== */

.ssai-chat-widget .ssai-quick-actions {
    padding: 12px 16px 8px;
    animation: ssai-fadeInUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-bottom: 0.5px solid rgba(15, 23, 42, 0.08);
    margin-bottom: 8px;
}

@keyframes ssai-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ssai-quick-actions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
}

.ssai-chat-widget .ssai-quick-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0.5px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    font-family: var(--ssai-font-family);
    font-size: 13px;
    font-weight: 500;
    color: var(--ssai-text-primary);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-width: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.ssai-quick-action:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: rgba(15, 23, 42, 0.12);
}

.ssai-quick-action:active {
    transform: translateY(0) scale(0.96);
}

.ssai-quick-action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--ssai-text-secondary);
    opacity: 0.8;
}

.ssai-quick-action-label {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    letter-spacing: -0.1px;
}

/* Accent color support */
.ssai-quick-action[style*="--ssai-quick-action-accent"] {
    border-color: var(--ssai-quick-action-accent);
    box-shadow: 0 0 0 1px var(--ssai-quick-action-accent);
}

.ssai-quick-action[style*="--ssai-quick-action-accent"]:hover {
    box-shadow: 0 0 0 2px var(--ssai-quick-action-accent);
}

/* Hidden state */
.ssai-quick-actions[data-hidden="true"] {
    display: none;
}

/* Restore button in footer - simplified */
.ssai-quick-actions-restore {
    background: none;
    border: none;
    color: var(--ssai-text-secondary);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: var(--ssai-font-family);
    margin-left: 6px;
    opacity: 0.7;
}

.ssai-quick-actions-restore:hover {
    color: var(--ssai-text-primary);
    opacity: 1;
}

/* ===========================
    Responsive Design
    =========================== */

@media (max-width: 768px) {
    .ssai-chat-trigger {
        bottom: 16px;
        right: 16px;
        width: 58px;
        height: 58px;
    }

    .ssai-trigger-icon {
        width: 28px;
        height: 28px;
    }

    .ssai-chat-widget {
        width: min(420px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
        bottom: 16px;
        right: 16px;
        left: auto;
        height: min(80vh, 560px);
        max-height: calc(100vh - 96px);
        border-radius: 24px;
    }

    .ssai-chat-header {
        padding: 12px 16px;
        padding-top: max(12px, env(safe-area-inset-top));
    }

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

    .ssai-chat-body {
        padding: 16px;
    }

    .ssai-chat-footer {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .ssai-product-card .ssai-product-image {
        max-height: 250px;
    }
}

@media (max-width: 540px) {
    .ssai-chat-widget {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
}

@media (max-width: 480px) {
    .ssai-chat-trigger {
        bottom: 16px;
        right: 16px;
    }

    .ssai-product-image {
        width: 70px;
        min-height: 70px;
    }

    .ssai-product-card .ssai-product-image {
        max-height: 200px;
    }

    .ssai-quick-actions {
        padding: 8px 12px 6px;
    }

    .ssai-quick-action {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .ssai-quick-action-icon {
        width: 14px;
        height: 14px;
        font-size: 12px;
    }
}

/* ===========================
   Smooth Rendering
   =========================== */

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Voice Input Button
   =========================== */

.ssai-chat-widget .ssai-mic-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--ssai-gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin-right: 4px;
}

.ssai-mic-btn:hover {
    background: var(--ssai-gray-100);
    color: var(--ssai-gray-900);
}

.ssai-mic-btn:active {
    transform: scale(0.95);
}

.ssai-mic-btn svg {
    width: 20px;
    height: 20px;
}

.ssai-mic-btn.ssai-listening {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    animation: ssai-pulse 1.5s infinite;
}

.ssai-mic-btn.ssai-processing {
    color: var(--ssai-send-btn-color);
    animation: ssai-spin 1s linear infinite;
}

@keyframes ssai-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes ssai-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===========================
   Voice Status Indicator
   =========================== */
.ssai-voice-status {
    font-size: 12px;
    font-weight: 500;
    color: var(--ssai-text-secondary);
    margin-right: 8px;
    display: none;
    white-space: nowrap;
    animation: ssai-fadeIn 0.3s ease;
}

.ssai-voice-status.ssai-listening {
    display: block;
    color: #ef4444;
}

.ssai-voice-status.ssai-processing {
    display: block;
    color: var(--ssai-send-btn-color);
}

/* ===========================
   TTS Speak Button
   =========================== */

.ssai-message-actions {
    margin-top: 4px;
    display: flex;
    justify-content: flex-start;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ssai-message:hover .ssai-message-actions {
    opacity: 1;
}

.ssai-speak-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--ssai-gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.ssai-speak-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--ssai-gray-600);
}

.ssai-speak-btn svg {
    width: 14px;
    height: 14px;
}

/* Loading State */
.ssai-speak-btn.ssai-loading {
    color: var(--ssai-send-btn-color);
    animation: ssai-spin 1s linear infinite;
    pointer-events: none;
}

/* Speaking State */
.ssai-speak-btn.ssai-speaking {
    color: var(--ssai-send-btn-color);
    background: rgba(37, 99, 235, 0.1);
}

/* Mobile: Always show actions */
@media (max-width: 768px) {
    .ssai-message-actions {
        opacity: 1;
    }
}

/* ===========================
   Language Selector
   =========================== */

.ssai-lang-selector-container {
    margin-right: 8px;
    position: relative;
}

.ssai-lang-selector {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid var(--ssai-border);
    border-radius: 8px;
    padding: 6px 24px 6px 8px;
    font-size: 13px;
    color: var(--ssai-text-secondary);
    cursor: pointer;
    font-family: var(--ssai-font-family);
    transition: all 0.2s ease;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.ssai-lang-selector:hover {
    border-color: var(--ssai-gray-400);
    color: var(--ssai-text-primary);
}

.ssai-lang-selector:focus {
    outline: none;
    border-color: var(--ssai-send-btn-color);
}