/**
 * xeko.ai - Chat Widget Styles
 * Version: 1.0.0
 */

.xeko-ai-widget {
    position: fixed;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.xeko-ai-widget.right-top {
    top: 20px;
    right: 20px;
}

.xeko-ai-widget.right-center {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.xeko-ai-widget.right-bottom {
    bottom: 20px;
    right: 20px;
}

.xeko-ai-widget.left-top {
    top: 20px;
    left: 20px;
}

.xeko-ai-widget.left-center {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.xeko-ai-widget.left-bottom {
    bottom: 20px;
    left: 20px;
}

.xeko-ai-widget.bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.xeko-ai-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(27, 60, 83, 0.3);
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.xeko-ai-icon:hover {
    transform: scale(1.1);
}

.xeko-ai-chat {
    width: 335px;
    height: 550px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(27, 60, 83, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.xeko-ai-header {
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xeko-ai-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.xeko-ai-header-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

.xeko-ai-header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xeko-ai-header-text {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.xeko-ai-header-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.xeko-ai-header-subtitle {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.xeko-ai-header-controls {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.xeko-ai-header-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: bold;
}

.xeko-ai-header-btn:hover {
    background: rgba(255,255,255,0.25);
}

.xeko-ai-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    scroll-behavior: smooth;
}

.xeko-ai-messages::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.xeko-ai-messages::-webkit-scrollbar-track {
    background: transparent;
}

.xeko-ai-messages::-webkit-scrollbar-thumb {
    background: transparent;
}

.xeko-ai-messages::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

.xeko-ai-message {
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.xeko-ai-message.bot-message {
    background: white;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    max-width: 80%;
    margin-left: 0;
    margin-right: auto;
}

.xeko-ai-message.user-message {
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    max-width: 80%;
    margin-left: auto;
    margin-right: 0;
}

.xeko-ai-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.xeko-ai-message.user-message p {
    color: white;
}

.xeko-ai-message.bot-message p {
    color: #333;
}

.xeko-ai-typing-indicator {
    background: transparent;
    padding: 12px 16px;
    max-width: 80%;
    margin-left: 0;
    margin-right: auto;
}

.xeko-ai-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.xeko-ai-typing-dot:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.xeko-ai-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.xeko-ai-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.xeko-ai-input:focus {
    border-color: var(--primary-color, #819A91);
}

.xeko-ai-send-btn {
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    color: white;
}

.xeko-ai-send-btn:hover {
    transform: scale(1.1);
}

.xeko-ai-message.bot-message {
    font-size: 14px;
}

.xeko-ai-message.xeko-ai-formatted-message {
    background: white;
    padding: 16px;
    border-radius: 18px 18px 18px 4px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 100%;
    margin-left: 0;
    margin-right: auto;
}

.xeko-ai-message.bot-message * {
    font-size: 14px;
}

.xeko-ai-message.bot-message b {
    color: var(--primary-color, #819A91);
    font-weight: 600;
    font-size: 14px;
}

.xeko-ai-message.bot-message ul {
    margin: 8px 0;
    padding-left: 20px;
    font-size: 14px;
}

.xeko-ai-message.bot-message li {
    margin: 4px 0;
    color: #555;
    font-size: 14px;
}

.xeko-ai-message.bot-message a {
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 12px;
    background: var(--primary-color, #819A91);
    padding: 4px 10px;
    border-radius: 6px;
    color: white;
}

.xeko-ai-message.bot-message a:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.xeko-product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.xeko-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.xeko-product-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.xeko-product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

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

.xeko-product-info {
    flex: 1;
    min-width: 0;
}

.xeko-product-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.xeko-product-price {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color, #819A91);
}

.xeko-product-details {
    margin-bottom: 16px;
}

.xeko-product-description {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.xeko-product-attributes {
    font-size: 13px;
    color: #555;
}

.xeko-product-actions {
    display: flex;
    gap: 8px;
}

.xeko-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    flex: 1;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.xeko-btn-view {
    background: var(--primary-color, #819A91);
    color: white;
}

.xeko-btn-view:hover {
    background: var(--secondary-color, #A7C1A8);
    transform: translateY(-1px);
    opacity: 0.9;
}

.xeko-btn-cart {
    background: var(--secondary-color, #A7C1A8);
    color: white;
}

.xeko-btn-cart:hover {
    background: var(--primary-color, #819A91);
    transform: translateY(-1px);
    opacity: 0.9;
}

.xeko-ai-message.bot-message button {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    margin-left: 8px;
    background: var(--primary-color, #819A91) !important;
}

.xeko-ai-message.bot-message button:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    background: var(--secondary-color, #A7C1A8) !important;
}

.xeko-ai-message.bot-message p {
    font-size: 14px;
    margin: 8px 0;
}

.xeko-ai-message.bot-message img {
    max-width: 150px;
    width: 100%;
    height: 100%;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.xeko-ai-message.bot-message h1,
.xeko-ai-message.bot-message h2,
.xeko-ai-message.bot-message h3,
.xeko-ai-message.bot-message h4,
.xeko-ai-message.bot-message h5,
.xeko-ai-message.bot-message h6 {
    font-size: 14px;
    color: var(--primary-color, #819A91);
    font-weight: 600;
    margin: 8px 0;
}

.xeko-ai-message.bot-message span {
    font-size: 14px;
}

.xeko-ai-message.bot-message div {
    font-size: 14px;
    margin-bottom: 10px;
}

.xeko-ai-message.bot-message div[style*="display: flex"] {
    flex-direction: column !important;
}

.xeko-ai-message.bot-message div[style*="display:flex"] {
    flex-direction: column !important;
}

.xeko-ai-product-carousel {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 100%;
    position: relative;
}

.xeko-ai-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.xeko-ai-carousel-title {
    margin: 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.xeko-ai-carousel-nav {
    display: flex;
    gap: 4px;
}

.xeko-ai-carousel-nav-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
}

.xeko-ai-carousel-nav-btn:hover {
    background: var(--secondary-color, #A7C1A8) !important;
}

.xeko-ai-carousel-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 80px;
}

.xeko-ai-carousel-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.xeko-ai-carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xeko-ai-carousel-placeholder {
    display: none;
    width: 100%;
    height: 100%;
    background: #e0e0e0;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

.xeko-ai-carousel-details {
    flex: 1;
    min-width: 0;
}

.xeko-ai-carousel-name {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xeko-ai-carousel-price {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color, #819A91);
}

.xeko-ai-carousel-category {
    margin: 0 0 8px 0;
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xeko-ai-carousel-view-btn {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.xeko-ai-carousel-view-btn:hover {
    background: var(--secondary-color, #A7C1A8) !important;
}

.xeko-ai-carousel-buttons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.xeko-ai-carousel-add-cart-btn {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    flex: 1;
}

.xeko-ai-carousel-add-cart-btn:hover {
    background: var(--primary-color, #819A91) !important;
}

.xeko-ai-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.xeko-ai-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.xeko-ai-close-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.xeko-ai-close-modal {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 280px;
    width: 85%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin: 20px;
}

.xeko-ai-close-modal h3 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 16px;
}

.xeko-ai-close-modal p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.4;
    font-size: 14px;
}

.xeko-ai-close-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.xeko-ai-close-btn {
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
}

.xeko-ai-close-btn.no {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.xeko-ai-close-btn.yes {
    color: white;
    border: none;
}

.xeko-ai-error {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    color: #856404;
    font-size: 14px;
}

.xeko-ai-no-products {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    color: #666;
    font-size: 14px;
}

.xeko-ai-categories {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.xeko-ai-categories h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 14px;
}

.xeko-ai-categories-list {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* Single Product Display */
.xeko-ai-single-product {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.xeko-ai-single-product-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.xeko-ai-single-product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.xeko-ai-single-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xeko-ai-single-product-details {
    flex: 1;
}

.xeko-ai-single-product-name {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 15px;
    font-weight: 600;
}

.xeko-ai-single-product-price {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
}

.xeko-ai-single-product-category {
    margin: 0 0 8px 0;
    color: #666;
    font-size: 12px;
}

.xeko-ai-single-product-description {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.xeko-ai-single-product-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.xeko-ai-single-product-btn:hover {
    background: var(--secondary-color, #A7C1A8) !important;
}

/* Single Product Button Container */
.xeko-ai-single-product-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.xeko-ai-single-product-view-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    flex: 1;
}

.xeko-ai-single-product-view-btn:hover {
    background: var(--secondary-color, #A7C1A8) !important;
}

.xeko-ai-single-product-add-cart-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    flex: 1;
}

.xeko-ai-single-product-add-cart-btn:hover {
    background: var(--primary-color, #819A91) !important;
}

.xeko-ai-notification {
    background: var(--primary-color, #819A91);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin: 5px 0;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.xeko-ai-notification-success {
    background: var(--primary-color, #819A91);
}

.xeko-ai-notification-error {
    background: #e74c3c;
}

.xeko-ai-notification-loading {
    background: var(--secondary-color, #A7C1A8);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
