/* Aroma Expert Widget */

:root {
    --aroma-teal: #2eb0a4;
    --aroma-teal-dark: #249089;
    --aroma-teal-light: #e8f7f5;
    --aroma-wood: #8B6914;
    --aroma-cream: #faf9f6;
    --aroma-text: #2d2d2d;
    --aroma-text-light: #6b6b6b;
    --aroma-border: #e5e5e5;
    --aroma-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    --aroma-radius: 16px;
    --aroma-widget-width: 380px;
    --aroma-widget-height: 560px;
}

/* Chat Bubble (FAB) */
.aroma-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--aroma-teal);
    border: none;
    cursor: pointer;
    box-shadow: var(--aroma-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    transition: transform 0.2s ease, background 0.2s ease;
}

.aroma-chat-bubble:hover {
    transform: scale(1.08);
    background: var(--aroma-teal-dark);
}

.aroma-chat-bubble:focus-visible {
    outline: 3px solid var(--aroma-teal);
    outline-offset: 3px;
}

.aroma-chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.aroma-chat-bubble .aroma-close-icon {
    display: none;
}

.aroma-chat-bubble.open .aroma-chat-icon {
    display: none;
}

.aroma-chat-bubble.open .aroma-close-icon {
    display: block;
}

/* Notification dot */
.aroma-chat-bubble::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e74c3c;
    border: 2px solid white;
    display: none;
}

.aroma-chat-bubble.has-notification::after {
    display: block;
}

/* Chat Window */
.aroma-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: var(--aroma-widget-width);
    height: var(--aroma-widget-height);
    max-height: calc(100vh - 120px);
    border-radius: var(--aroma-radius);
    background: white;
    box-shadow: var(--aroma-shadow);
    display: none;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--aroma-text);
}

.aroma-chat-window.open {
    display: flex;
    animation: aromaSlideUp 0.25s ease-out;
}

@keyframes aromaSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.aroma-chat-header {
    background: var(--aroma-teal);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.aroma-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.aroma-chat-header-text {
    flex: 1;
}

.aroma-chat-header-title {
    font-weight: 600;
    font-size: 15px;
}

.aroma-chat-header-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 1px;
}

/* Messages Area */
.aroma-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--aroma-cream);
    scroll-behavior: smooth;
}

.aroma-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.aroma-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

/* Message Bubbles */
.aroma-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.aroma-message-user {
    align-self: flex-end;
    background: var(--aroma-teal);
    color: white;
    border-bottom-right-radius: 4px;
}

.aroma-message-bot {
    align-self: flex-start;
    background: white;
    border: 1px solid var(--aroma-border);
    border-bottom-left-radius: 4px;
}

.aroma-message-bot p {
    margin: 0 0 8px 0;
}

.aroma-message-bot p:last-child {
    margin-bottom: 0;
}

.aroma-message-bot strong {
    font-weight: 600;
}

.aroma-message-bot ul,
.aroma-message-bot ol {
    margin: 4px 0 8px 0;
    padding-left: 20px;
}

.aroma-message-bot li {
    margin-bottom: 4px;
}

.aroma-message-bot a {
    color: var(--aroma-teal);
    text-decoration: underline;
}

/* Typing indicator */
.aroma-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--aroma-border);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.aroma-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--aroma-text-light);
    animation: aromaBounce 1.4s infinite;
}

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

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

@keyframes aromaBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Feedback buttons */
.aroma-feedback {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.aroma-feedback button {
    background: none;
    border: 1px solid var(--aroma-border);
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--aroma-text-light);
    transition: all 0.15s ease;
}

.aroma-feedback button:hover {
    border-color: var(--aroma-teal);
    color: var(--aroma-teal);
}

.aroma-feedback button.selected {
    background: var(--aroma-teal-light);
    border-color: var(--aroma-teal);
    color: var(--aroma-teal);
}

/* Suggestion Chips */
.aroma-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
    background: var(--aroma-cream);
}

.aroma-suggestion-chip {
    background: white;
    border: 1px solid var(--aroma-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--aroma-teal);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.aroma-suggestion-chip:hover {
    background: var(--aroma-teal-light);
    border-color: var(--aroma-teal);
}

/* Input Area */
.aroma-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--aroma-border);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: white;
    flex-shrink: 0;
}

.aroma-chat-input {
    flex: 1;
    border: 1px solid var(--aroma-border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.15s ease;
}

.aroma-chat-input:focus {
    border-color: var(--aroma-teal);
}

.aroma-chat-input::placeholder {
    color: var(--aroma-text-light);
}

.aroma-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--aroma-teal);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.aroma-chat-send:hover {
    background: var(--aroma-teal-dark);
}

.aroma-chat-send:disabled {
    background: var(--aroma-border);
    cursor: not-allowed;
}

.aroma-chat-send svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Powered by footer */
.aroma-chat-footer {
    text-align: center;
    padding: 6px;
    font-size: 11px;
    color: var(--aroma-text-light);
    background: white;
    border-top: 1px solid var(--aroma-border);
}

/* Mobile fullscreen */
@media (max-width: 480px) {
    .aroma-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .aroma-chat-window.open {
        animation: aromaFadeIn 0.2s ease-out;
    }

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

    .aroma-chat-bubble {
        bottom: 16px;
        right: 16px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .aroma-chat-window.open {
        animation: none;
    }

    .aroma-typing-dot {
        animation: none;
    }

    .aroma-chat-bubble {
        transition: none;
    }
}

/* Product card */
.aroma-product-card {
    background: white;
    border: 1px solid var(--aroma-border);
    border-radius: 10px;
    padding: 12px;
    margin-top: 8px;
}

.aroma-product-card-name {
    font-weight: 600;
    color: var(--aroma-text);
    margin-bottom: 4px;
}

.aroma-product-card-price {
    color: var(--aroma-teal);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.aroma-product-card-rating {
    font-size: 12px;
    color: var(--aroma-text-light);
    margin-bottom: 8px;
}

.aroma-product-card-cta {
    display: inline-block;
    background: var(--aroma-teal);
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.aroma-product-card-cta:hover {
    background: var(--aroma-teal-dark);
    color: white;
}
