/**
 * 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);
    --ssai-primary: #1c1c1e;
    --ssai-accent: #0071e3;
    
    /* Typography - Apple San Francisco Pro Display */
    --ssai-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

.ssai-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    background: var(--ssai-accent, #0071e3);
    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);
}

.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);
    background: color-mix(in srgb, var(--ssai-accent, #0071e3) 85%, #000 15%);
}

.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-chat-trigger:hover .ssai-trigger-icon {
    transform: scale(1.1);
}

.ssai-trigger-custom {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

/* ===========================
   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: var(--ssai-white);
    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-primary, #1c1c1e);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

.ssai-header-logo {
    max-width: 180px; /* Allow wider horizontal logos */
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--ssai-primary, #1c1c1e) 85%, #ffffff 15%) 0%, var(--ssai-primary, #1c1c1e) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px;
}

/* 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: auto;
    object-fit: contain;
}

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

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

.ssai-header-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
    letter-spacing: -0.4px;
    font-family: var(--ssai-font-family);
}
/* Additional specificity to prevent overrides from themes/builders */
.ssai-chat-header .ssai-header-left .ssai-header-info .ssai-header-title { display: block; }

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

.ssai-header-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.85);
    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.12);
    color: #fff;
}

.ssai-header-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

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

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

.ssai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--ssai-bg-primary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.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);
}

/* Onboarding & Quick Actions */
.ssai-onboarding {
    margin-bottom: 16px;
}

.ssai-quick-actions {
    background: var(--ssai-white);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.ssai-quick-actions-header h4 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ssai-text-primary);
}

.ssai-quick-actions-header p {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--ssai-text-secondary);
}

.ssai-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.ssai-quick-action-btn {
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(0, 0, 0, 0.015);
    border-radius: 12px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
    font-family: var(--ssai-font-family);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ssai-quick-action-btn:hover {
    transform: translateY(-1px);
    border-color: var(--ssai-accent, #0071e3);
}

.ssai-quick-action-title {
    display: block;
    font-weight: 600;
    color: var(--ssai-text-primary);
    margin-bottom: 2px;
}

.ssai-quick-action-icon {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 2px;
}

.ssai-quick-action-subtitle {
    display: block;
    font-size: 13px;
    color: var(--ssai-text-secondary);
}

.ssai-welcome-default {
    background: linear-gradient(135deg, var(--ssai-primary, #1c1c1e), color-mix(in srgb, var(--ssai-primary, #1c1c1e) 70%, #ffffff 30%));
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    text-align: center;
}

.ssai-welcome-default h4 {
    margin: 0 0 8px;
    font-size: 20px;
}

.ssai-welcome-default p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

/* 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;
}

.ssai-message.ssai-user .ssai-message-bubble {
    background: var(--ssai-gray-900);
    color: var(--ssai-white);
    border-bottom-right-radius: 4px;
}

.ssai-message.ssai-bot .ssai-message-bubble {
    background: var(--ssai-white);
    color: var(--ssai-text-primary);
    border-bottom-left-radius: 4px;
    border: 0.5px solid var(--ssai-border);
}

.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-white);
    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;
}

.ssai-general-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.ssai-general-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.04);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ssai-general-action-btn:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.ssai-general-action-icon {
    font-size: 16px;
    line-height: 1;
}

/* 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::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);
}

/* 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: 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-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 {
    background: var(--ssai-gray-800);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.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, var(--ssai-gray-900) 0%, var(--ssai-gray-800) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    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: 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-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 {
    background: var(--ssai-gray-800);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.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: var(--ssai-white);
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 0.5px solid var(--ssai-border);
    display: flex;
    gap: 4px;
    align-items: center;
}

.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: var(--ssai-white);
    border-top: 0.5px solid var(--ssai-border);
    flex-shrink: 0;
}

.ssai-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--ssai-bg-primary);
    border: 0.5px solid var(--ssai-border);
    border-radius: 20px;
    padding: 8px 8px 8px 16px;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.ssai-input-container:focus-within {
    background: var(--ssai-white);
    border-color: var(--ssai-gray-300);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.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-send-btn {
    width: 32px;
    height: 32px;
    background: var(--ssai-gray-900);
    border: none;
    border-radius: 50%;
    color: var(--ssai-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.ssai-send-btn:hover {
    background: var(--ssai-gray-800);
    transform: scale(1.05);
}

.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-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(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    z-index: 999998;
    animation: ssai-fadeIn 0.3s ease;
}

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

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

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

@media (max-width: 768px) {
    .ssai-chat-trigger {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    
    .ssai-trigger-icon {
        width: 28px;
        height: 28px;
    }
    
    .ssai-chat-widget {
        width: 100vw;
        max-width: 100vw;
        bottom: 0;
        right: 0;
        left: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .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: 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;
    }
}

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

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.ssai-quick-action-icon {
    font-size: 20px;
    line-height: 1;
}
