/* Jack Chatbot Styles - All classes prefixed with 'jack-' to avoid conflicts */

/* Floating Chat Icon */
.jack-chat-float-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4);
    z-index: 9999;
    transition: all 0.3s ease;
    animation: jack-float 3s ease-in-out infinite;
    border: none;
}

.jack-clear-button {
    margin-top: 0.5rem;
    background-color: #dc3545;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.jack-clear-button:hover {
    background-color: #c82333;
}

.jack-chat-float-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.6);
}

.jack-chat-float-icon i {
    color: white;
    font-size: 24px;
    animation: jack-pulse 2s infinite;
}

/* Floating Animations */
@keyframes jack-float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes jack-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Notification Badge */
.jack-chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: jack-bounce 1s infinite;
}

@keyframes jack-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Chat Modal */
.jack-chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: jack-fadeIn 0.3s ease;
}

.jack-chat-modal.jack-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.jack-chat-modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    height: 80%;
    max-height: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: jack-slideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes jack-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes jack-slideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Chat Header */
.jack-chat-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jack-chat-header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.ai-bot-image{
    width: 80px;
}

.jack-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.jack-chat-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.jack-chat-subtitle {
    opacity: 0.8;
    font-size: 12px;
}

.jack-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jack-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.jack-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Chat Footer */
.jack-chat-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    border-top: 1px solid #dee2e6;
}

/* Message Styles */
.jack-message-bubble {
    animation: jack-fadeInUp 0.3s ease-out;
    margin-bottom: 15px;
}

.jack-message-flex {
    display: flex;
    align-items: flex-start;
}

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

.jack-avatar-wrapper {
    margin-right: 12px;
    flex-shrink: 0;
}

.jack-user-message .jack-avatar-wrapper {
    margin-right: 0;
    margin-left: 12px;
    order: 2;
}

.jack-avatar-circle {
    width: 32px;
    height: 32px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.jack-user-message .jack-avatar-circle {
    background: #6c757d;
}

.jack-message-content {
    max-width: 70%;
}

.jack-user-message .jack-message-content {
    order: 1;
}

.jack-message-bubble-content {
    border-radius: 15px;
    padding: 12px 16px;
    word-wrap: break-word;
}

.jack-bot-bubble {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.jack-user-bubble {
    background: #007bff;
    color: white;
}

.jack-message-text {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
}

.jack-message-text:not(.jack-no-margin) {
    margin-bottom: 8px;
}

.jack-no-margin {
    margin-bottom: 0 !important;
}

.jack-message-time {
    color: #6c757d;
    font-size: 11px;
    margin-top: 4px;
    display: block;
}

.jack-user-message .jack-message-time {
    text-align: right;
}

/* Typing Indicator */
.jack-typing-indicator {
    animation: jack-fadeIn 0.3s ease-out;
    margin-bottom: 10px;
}

.jack-typing-flex {
    display: flex;
    align-items: center;
    color: #6c757d;
}

.jack-typing-avatar {
    margin-right: 8px;
}

.jack-typing-avatar-circle {
    width: 24px;
    height: 24px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.jack-typing-text {
    font-size: 13px;
}

.jack-typing-dots {
    margin-left: 8px;
}

.jack-typing-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #6c757d;
    margin: 0 1px;
    animation: jack-typing 1.5s infinite ease-in-out;
}

.jack-typing-dots span:nth-child(1) { animation-delay: 0s; }
.jack-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.jack-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes jack-typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

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

/* Chat Form */
.jack-chat-form {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.jack-input-wrapper {
    flex: 1;
}

.jack-message-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.jack-message-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.jack-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.jack-send-button:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.jack-send-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

/* Quick Actions */
.jack-quick-actions {
    margin-top: 10px;
}

.jack-quick-label {
    color: #6c757d;
    font-size: 12px;
}

.jack-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.jack-quick-action {
    font-size: 12px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #007bff;
    color: #007bff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.jack-quick-action:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
}

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

.jack-chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.jack-chat-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.jack-chat-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .jack-chat-modal-content {
        width: 95%;
        height: 90%;
        max-height: 90vh;
    }

    .jack-chat-float-icon {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .jack-chat-float-icon i {
        font-size: 20px;
    }

    .jack-message-content {
        max-width: 85%;
    }

    .jack-chat-body {
        padding: 15px;
    }

    .jack-chat-footer {
        padding: 12px 15px;
    }
}
