/* ========================================
   UKF SERVICES - CHATBOT INTERFACE
   Production-Grade B2B Chat System
   ======================================== */

/* Chat Bubble Button */
.chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
    z-index: 998;
    transition: all 0.3s ease;
    border: 3px solid var(--primary);
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 35px rgba(212, 175, 55, 0.6);
}

.chat-bubble i {
    font-size: 1.8rem;
    color: var(--primary);
}

.chat-bubble.active {
    opacity: 0;
    pointer-events: none;
}

/* Notification Badge */
.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse-badge 2s infinite;
}

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

/* Chat Window Container */
.chat-window {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 380px;
    height: 500px;
    max-height: 70vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    border: 2px solid var(--accent);
}

.chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary) 0%, #0d1520 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--accent);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
    border: 2px solid var(--accent);
}

.chat-header-text h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
}

.chat-status {
    font-size: 0.8rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

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

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Chat Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.4s ease;
}

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

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

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

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

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

.message-bubble {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 15px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.chat-message.bot .message-bubble {
    background: white;
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, #0d1520 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 0.3rem;
    display: block;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.typing-indicator .message-avatar {
    width: 35px;
    height: 35px;
}

.typing-dots {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 15px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 0.4rem;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* Chat Input Area */
.chat-input-area {
    padding: 1.25rem;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 0.9rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

.chat-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.chat-input::placeholder {
    color: #999;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border: none;
    border-radius: 50%;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-send-btn i {
    font-size: 1.2rem;
}

/* Powered By Footer */
.chat-footer {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.chat-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Quick Actions (Optional) */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.5rem 0;
}

.quick-action-btn {
    background: white;
    border: 2px solid var(--accent);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
    }

    .chat-bubble {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .message-bubble {
        max-width: 85%;
    }
}

/* Accessibility */
.chat-window:focus-within {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .chat-bubble,
    .chat-window {
        display: none !important;
    }
}