/* BMA Law AI Chatbot Widget Styles */

.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    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: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

.chatbot-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.chatbot-close-btn:hover {
    opacity: 1;
}

/* Body */
.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f7fa;
}

/* Welcome Screen */
.chatbot-welcome {
    text-align: center;
    padding: 20px;
}

.chatbot-welcome-icon {
    font-size: 60px;
    color: #667eea;
    margin-bottom: 20px;
}

.chatbot-welcome h3 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 20px;
}

.chatbot-welcome p {
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.6;
}

.chatbot-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
    font-size: 13px;
    line-height: 1.6;
    color: #856404;
}

.chatbot-consent {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.chatbot-consent label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #2c3e50;
    font-size: 14px;
}

.chatbot-consent input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.chatbot-start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.chatbot-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chatbot-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messages */
.chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

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

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

.chatbot-message-ai .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chatbot-message-user .message-avatar {
    background: #e0e0e0;
    color: #555;
}

.message-content {
    flex: 1;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    line-height: 1.6;
    color: #2c3e50;
}

.chatbot-message-user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Document Card */
.chatbot-message-document .message-content {
    padding: 0;
}

.document-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.document-card i:first-child {
    font-size: 32px;
    color: #e74c3c;
}

.document-card strong {
    display: block;
    margin-bottom: 4px;
    color: #2c3e50;
}

.document-card p {
    margin: 0;
    font-size: 12px;
    color: #7f8c8d;
}

.document-card .btn {
    margin-left: auto;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px;
}

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

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

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

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

/* Footer */
.chatbot-footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 16px;
}

.chatbot-input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.chatbot-input-container textarea {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    max-height: 100px;
    transition: border-color 0.2s;
}

.chatbot-input-container textarea:focus {
    outline: none;
    border-color: #667eea;
}

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Progress Bar */
.chatbot-progress {
    margin-top: 8px;
}

.progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.chatbot-progress small {
    color: #7f8c8d;
    font-size: 11px;
}

/* Scrollbar Styling */
.chatbot-body::-webkit-scrollbar {
    width: 6px;
}

.chatbot-body::-webkit-scrollbar-track {
    background: #f5f7fa;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.chatbot-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }

    .chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}
