/* AI Legal Assistant Chatbot Styles */

.ai-chat-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-header h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.ai-chat-header .status-indicator {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.message.user-message .message-avatar {
    background: var(--primary-color);
    color: white;
}

.message.bot-message .message-avatar {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.message-content {
    max-width: 80%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
}

.message.user-message .message-content {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.message.bot-message .message-content {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    text-align: right;
}

.message.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.message.bot-message .message-time {
    color: var(--text-muted);
}

/* Follow-up Questions */
.follow-up-questions {
    margin-top: 1rem;
}

.follow-up-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Chat Input Area */
.ai-chat-input-area {
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    background: var(--bg-secondary);
}

.ai-chat-form {
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
}

.ai-chat-input-wrapper {
    flex: 1;
    position: relative;
}

.ai-chat-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.4;
}

.ai-chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.ai-chat-input::placeholder {
    color: var(--text-muted);
}

.ai-chat-send-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-chat-send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.ai-chat-send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    width: fit-content;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Quick Actions Panel */
.quick-actions-panel {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
}

.quick-actions-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-align: center;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.quick-action-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action-item:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.quick-action-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.quick-action-item:hover i {
    color: white;
}

.quick-action-item span {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    display: block;
}

.quick-action-item:hover span {
    color: white;
}

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

.ai-chat-messages::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-chat-container {
        height: 400px;
    }
    
    .ai-chat-header {
        padding: 0.8rem 1rem;
    }
    
    .ai-chat-messages {
        padding: 1rem;
    }
    
    .message-content {
        max-width: 90%;
        padding: 0.8rem;
    }
    
    .message-text {
        font-size: 0.9rem;
    }
    
    .ai-chat-input-area {
        padding: 0.8rem;
    }
    
    .ai-chat-input {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-action-item {
        padding: 0.6rem;
    }
}

/* Dark theme adjustments for AI chatbot */
#ai-assistant p,
#ai-assistant li,
#ai-assistant span,
#ai-assistant div,
#ai-assistant h5,
#ai-assistant h6 {
    color: var(--text-primary);
}

#ai-assistant .text-muted {
    color: var(--text-secondary) !important;
}

#ai-assistant strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Ensure proper contrast for all text elements in the AI assistant */
.ai-chat-container p,
.ai-chat-container li,
.ai-chat-container span,
.ai-chat-container div:not(.message-content):not(.typing-indicator),
.ai-chat-container h5,
.ai-chat-container h6 {
    color: var(--text-primary);
}

.ai-chat-container .text-muted {
    color: var(--text-secondary) !important;
}