/* filRouge Search AI - Chat Interface Styles */

.frsai-chat-widget {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Compact state - looks like a simple search input */
.frsai-chat-widget.frsai-chat-compact {
    height: auto;
    min-height: auto;
    max-height: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.frsai-chat-widget.frsai-chat-compact .frsai-chat-input-box {
    border-top: none;
    padding: 12px 15px;
    background: transparent;
}

.frsai-chat-widget.frsai-chat-compact .frsai-chat-messages {
    display: none !important;
}

.frsai-chat-widget.frsai-chat-compact .frsai-chat-button {
    opacity: 0.8;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.frsai-chat-widget.frsai-chat-compact .frsai-chat-button:hover {
    opacity: 1;
    transform: scale(1);
}

/* Expanded state - full chat interface */
.frsai-chat-widget.frsai-chat-expanded {
    height: 600px;
    min-height: 400px;
    animation: expandChat 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

@keyframes expandChat {
    from {
        height: auto;
        min-height: auto;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    to {
        height: 600px;
        min-height: 400px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

.frsai-chat-widget.frsai-chat-expanded .frsai-chat-messages {
    display: flex !important;
    animation: fadeInMessages 0.5s ease-in 0.2s both;
}

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

.frsai-chat-widget.frsai-chat-expanded .frsai-chat-input-box {
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.frsai-chat-widget.frsai-chat-expanded .frsai-chat-button {
    opacity: 1;
    transform: scale(1);
}

.frsai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f5f5f5;
}

.frsai-message {
    display: flex;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease-in;
}

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

.frsai-message-user {
    justify-content: flex-end;
}

.frsai-message-bot {
    justify-content: flex-start;
}

.frsai-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.frsai-message-user .frsai-message-content {
    background: #0073aa;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.frsai-message-bot .frsai-message-content {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.frsai-chat-results {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.frsai-chat-result-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    transition: all 0.3s ease;
}

.frsai-chat-result-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
    transform: translateY(-2px);
}

.frsai-chat-result-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.frsai-chat-result-link:hover {
    text-decoration: none;
}

.frsai-chat-result-title {
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #0073aa;
    line-height: 1.4;
}

.frsai-chat-result-excerpt {
    font-size: 0.9em;
    line-height: 1.6;
    color: #666;
}

.frsai-chat-result-excerpt mark {
    background-color: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.frsai-chat-input-box {
    border-top: 1px solid #e0e0e0;
    padding: 15px;
    background: #fff;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.frsai-chat-compact .frsai-chat-input-box {
    border-top: none;
    padding: 15px;
    border-radius: 12px;
}

.frsai-chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.frsai-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.frsai-chat-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Compact state input styling */
.frsai-chat-compact .frsai-chat-input {
    border-radius: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.frsai-chat-compact .frsai-chat-input:focus {
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.frsai-chat-button {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.frsai-chat-button:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.frsai-chat-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.frsai-typing-indicator {
    position: absolute;
    top: -30px;
    left: 20px;
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.frsai-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.frsai-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.frsai-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Scrollbar styling */
.frsai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.frsai-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.frsai-chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.frsai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .frsai-chat-widget.frsai-chat-expanded {
        height: 500px;
        min-height: 350px;
    }
    
    .frsai-message-content {
        max-width: 85%;
    }
    
    .frsai-chat-form {
        flex-direction: row;
    }
    
    .frsai-chat-button {
        padding: 12px 20px;
    }
    
    @keyframes expandChat {
        from {
            height: auto;
            min-height: auto;
        }
        to {
            height: 500px;
            min-height: 350px;
        }
    }
}
