/* Axle Chat Widget Styles */

:root {
    --axle-primary: #d4a853;
    --axle-bg-dark: #0a0a0a;
    --axle-bg-panel: #111111;
    --axle-bg-message: #1a1a1a;
    --axle-bg-user: rgba(34, 197, 94, 0.15);
    --axle-text: #fafafa;
    --axle-text-secondary: #a1a1aa;
    --axle-border: rgba(255, 255, 255, 0.1);
    --axle-green: #22c55e;
}

/* Widget Container */
.axle-chat-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.axle-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.axle-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toggle Button */
.axle-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--axle-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.axle-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.axle-chat-toggle svg {
    width: 28px;
    height: 28px;
    color: #000;
}

.axle-chat-toggle .axle-icon-close {
    display: none;
}

.axle-chat-widget.axle-open .axle-chat-toggle .axle-icon-chat {
    display: none;
}

.axle-chat-widget.axle-open .axle-chat-toggle .axle-icon-close {
    display: block;
}

/* Chat Panel */
.axle-chat-panel {
    position: absolute;
    bottom: 80px;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: var(--axle-bg-panel);
    border-radius: 16px;
    border: 1px solid var(--axle-border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.axle-position-bottom-right .axle-chat-panel {
    right: 0;
}

.axle-position-bottom-left .axle-chat-panel {
    left: 0;
}

.axle-chat-widget.axle-open .axle-chat-panel {
    display: flex;
    animation: axle-slide-up 0.3s ease;
}

@keyframes axle-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.axle-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--axle-bg-dark);
    border-bottom: 1px solid var(--axle-border);
}

.axle-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.axle-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--axle-primary), #a07830);
    display: flex;
    align-items: center;
    justify-content: center;
}

.axle-avatar svg {
    width: 20px;
    height: 20px;
    color: #000;
}

.axle-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--axle-text);
}

.axle-header-text span {
    font-size: 12px;
    color: var(--axle-text-secondary);
}

.axle-chat-minimize {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--axle-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.axle-chat-minimize:hover {
    background: rgba(255, 255, 255, 0.1);
}

.axle-chat-minimize svg {
    width: 16px;
    height: 16px;
    color: var(--axle-text-secondary);
}

/* Messages */
.axle-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.axle-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.axle-message-assistant {
    align-self: flex-start;
    background: var(--axle-bg-message);
    border: 1px solid var(--axle-border);
    color: var(--axle-text);
    border-bottom-left-radius: 4px;
}

.axle-message-user {
    align-self: flex-end;
    background: var(--axle-bg-user);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--axle-text);
    border-bottom-right-radius: 4px;
}

.axle-typing {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.axle-typing span {
    width: 8px;
    height: 8px;
    background: var(--axle-primary);
    border-radius: 50%;
    animation: axle-bounce 1.4s infinite ease-in-out both;
}

.axle-typing span:nth-child(1) { animation-delay: -0.32s; }
.axle-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes axle-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Products */
.axle-chat-products {
    padding: 12px;
    border-top: 1px solid var(--axle-border);
    background: var(--axle-bg-dark);
}

.axle-products-title {
    font-size: 12px;
    color: var(--axle-text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.axle-products-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.axle-product-card {
    flex: 0 0 140px;
    background: var(--axle-bg-message);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--axle-border);
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
}

.axle-product-card:hover {
    border-color: var(--axle-primary);
    transform: translateY(-2px);
}

.axle-product-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background: #000;
}

.axle-product-info {
    padding: 10px;
}

.axle-product-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--axle-text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.axle-product-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--axle-green);
}

/* Input */
.axle-chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--axle-border);
    background: var(--axle-bg-dark);
}

.axle-chat-input {
    flex: 1;
    background: var(--axle-bg-message);
    border: 1px solid var(--axle-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--axle-text);
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: inherit;
}

.axle-chat-input:focus {
    outline: none;
    border-color: var(--axle-primary);
}

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

.axle-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--axle-green);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.axle-chat-send:hover {
    background: #1ea84e;
}

.axle-chat-send:active {
    transform: scale(0.95);
}

.axle-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.axle-chat-send svg {
    width: 20px;
    height: 20px;
    color: #000;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .axle-chat-panel {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        max-height: none;
    }

    .axle-chat-toggle {
        width: 56px;
        height: 56px;
    }
}

/* Scrollbar */
.axle-chat-messages::-webkit-scrollbar,
.axle-products-grid::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.axle-chat-messages::-webkit-scrollbar-track,
.axle-products-grid::-webkit-scrollbar-track {
    background: transparent;
}

.axle-chat-messages::-webkit-scrollbar-thumb,
.axle-products-grid::-webkit-scrollbar-thumb {
    background: var(--axle-border);
    border-radius: 3px;
}
