/**
 * AI Product Assistant Chat Interface Styles
 */

/* Chat container */
.aipa-chat-container {
    --aipa-primary-color: #691b01;
    --aipa-text-color: #333333;
    --aipa-bg-color: #ffffff;
    --aipa-border-color: #e0e0e0;
    --aipa-hover-color: #8b2301;
    --aipa-message-bg: #f8f9fa;
    --aipa-assistant-bg: #f8f9fa;
    --aipa-shadow-color: rgba(0, 0, 0, 0.1);
    --aipa-button-text-color: #ffffff;
    --aipa-animation-speed: 0.3s;
    
    position: fixed;
    bottom: 13px;
    right: 28px;
    z-index: 99999;
    font-size: 14px;
    line-height: 1.5;
    color: var(--aipa-text-color);
}

/* Chat button */
.aipa-chat-button {
    width: 48px;
    height: 48px;
    background-color: #ffffff;
    border: 2px solid #cccccc;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--aipa-shadow-color);
    transition: all var(--aipa-animation-speed) ease;
}

.aipa-chat-button:hover {
    border-color: #083418;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--aipa-shadow-color);
}

.aipa-chat-button svg {
    width: 24px;
    height: 24px;
    color: #083418;
}

/* Chat window */
.aipa-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 80vw;
    max-width: 800px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background-color: var(--aipa-bg-color);
    border-radius: 12px;
    box-shadow: 0 5px 25px var(--aipa-shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--aipa-animation-speed) ease;
    z-index: 99998;
}

.aipa-chat-window.aipa-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Chat header */
.aipa-chat-header {
    background-color: var(--aipa-primary-color);
    color: var(--aipa-button-text-color);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aipa-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--aipa-button-text-color);
}

.aipa-chat-close {
    background: transparent;
    border: none;
    color: var(--aipa-button-text-color);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.aipa-chat-close:hover {
    opacity: 1;
}

/* Chat messages */
.aipa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.aipa-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
    margin-bottom: 5px;
    font-size: 14px;
}

.aipa-message-content {
    white-space: pre-wrap;
}

.aipa-message-content p {
    margin: 0 0 10px 0;
}

.aipa-message-content p:last-child {
    margin-bottom: 0;
}

.aipa-message-user {
    background-color: var(--aipa-primary-color);
    color: var(--aipa-button-text-color);
    align-self: flex-end;
}

.aipa-message-assistant {
    background-color: var(--aipa-assistant-bg);
    align-self: flex-start;
    border: 1px solid var(--aipa-border-color);
}

/* Quick questions */
.aipa-quick-questions {
    padding: 10px 15px;
    border-top: 1px solid var(--aipa-border-color);
    background-color: #ffffff;
}

.aipa-quick-questions h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: #666;
}

.aipa-quick-questions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.aipa-quick-question {
    background-color: #f8f9fa;
    border: 1px solid var(--aipa-border-color);
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aipa-quick-question:hover {
    background-color: var(--aipa-message-bg);
    border-color: var(--aipa-primary-color);
}

/* Chat input */
.aipa-chat-input-container {
    padding: 10px 15px;
    border-top: 1px solid var(--aipa-border-color);
    background-color: #ffffff;
    position: relative;
}

.aipa-chat-input {
    width: 100%;
    border: 1px solid var(--aipa-border-color);
    border-radius: 8px;
    padding: 10px 40px 10px 10px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
    max-height: 100px;
    min-height: 42px;
}

.aipa-chat-input:focus {
    border-color: var(--aipa-primary-color);
}

.aipa-chat-send {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #083418;
    color: var(--aipa-button-text-color);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.aipa-chat-send:hover {
    background-color: var(--aipa-hover-color);
}

/* Chat footer */
.aipa-chat-footer {
    padding: 8px 15px;
    border-top: 1px solid var(--aipa-border-color);
    background-color: #ffffff;
}

.aipa-chat-footer-text {
    margin: 0;
    font-size: 12px;
    color: #666;
    text-align: center;
}

.aipa-chat-footer a {
    color: var(--aipa-primary-color);
    text-decoration: none;
}

.aipa-chat-footer a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .aipa-chat-window {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        max-width: none;
    }
}