/* Michigan Lawyer Chatbot Styles */

.lawyer-chatbot {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.lawyer-chatbot.bottom-right {
    bottom: 20px;
    right: 20px;
}

.lawyer-chatbot.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.lawyer-chatbot.bottom-right .chatbot-window {
    right: 0;
}

.lawyer-chatbot.bottom-left .chatbot-window {
    left: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7fafc;
}

.chatbot-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 14px;
}

.bot-message .message-content {
    background: white;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-content ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.message-content a {
    color: inherit;
    text-decoration: underline;
}

.bot-message .message-content a {
    color: #667eea;
    font-weight: 500;
}

/* Typing Indicator */
.chatbot-typing {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chatbot-typing span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e0;
    margin-right: 4px;
    animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    gap: 8px;
}

#chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#chatbot-input:focus {
    border-color: #667eea;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f7fafc;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
    }
    
    .lawyer-chatbot.bottom-right .chatbot-window,
    .lawyer-chatbot.bottom-left .chatbot-window {
        right: 10px;
        left: 10px;
    }
}

/* Error Message */
.error-message .message-content {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

/* Links in bot messages - clickable phone and profile */
.bot-message .message-content a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #007bff;
    transition: all 0.2s;
}

.bot-message .message-content a:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
    background: rgba(0, 123, 255, 0.05);
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 3px;
}

/* Make firm names (links inside strong tags) more prominent */
.bot-message .message-content strong a,
.bot-message .message-content a strong {
    font-size: 1.05em;
    border-bottom: 2px solid #007bff;
}

/* Phone links - special green styling */
.bot-message .message-content a[href^="tel:"] {
    color: #28a745;
    border-bottom-color: #28a745;
}

.bot-message .message-content a[href^="tel:"]:hover {
    color: #218838;
    border-bottom-color: #218838;
    background: rgba(40, 167, 69, 0.05);
}