/* Custom Professional Chat Widget - Lika Solutions */

/* Chat Widget Button (Floating) */
.lika-chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse-glow 2s infinite;
}

.lika-chat-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 217, 255, 0.7);
}

.lika-chat-button svg {
    width: 28px;
    height: 28px;
    fill: #0a0e27;
    transition: transform 0.6s ease;
}

/* Rotate icon once on hover */
.lika-chat-button:hover svg {
    animation: spin-once 0.6s ease;
}

@keyframes spin-once {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(0, 217, 255, 0.5);
    }
    50% {
        box-shadow: 0 8px 40px rgba(0, 217, 255, 0.8);
    }
}

/* Notification Badge */
.lika-chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid #0a0e27;
}

/* Message Bubble Tooltip */
.lika-chat-tooltip {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: #1a1f3a;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 15px 15px 5px 15px;
    border: 1px solid rgba(0, 217, 255, 0.4);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    max-width: 250px;
    font-size: 0.9rem;
    line-height: 1.5;
    z-index: 999;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    animation: tooltip-float 3s ease-in-out infinite, tooltip-appear 0.5s ease forwards 1s;
}

.lika-chat-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #1a1f3a;
}

.lika-chat-tooltip.hidden {
    opacity: 0 !important;
    visibility: hidden;
}

@keyframes tooltip-appear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tooltip-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.lika-chat-tooltip strong {
    color: #00d9ff;
}

/* Chat Window Container */
.lika-chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: #1a1f3a;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(0, 217, 255, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

/* Chat Header */
.lika-chat-header {
    background: linear-gradient(135deg, #151933, #1a1f3a);
    padding: 1.5rem;
    border-bottom: 2px solid rgba(0, 217, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lika-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lika-chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
}

.lika-chat-header-text h3 {
    margin: 0;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.lika-chat-header-text p {
    margin: 0;
    font-size: 0.8rem;
    color: #a0aec0;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

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

.lika-chat-close {
    background: transparent;
    border: 2px solid rgba(0, 217, 255, 0.3);
    color: #00d9ff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lika-chat-close:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: #00d9ff;
    transform: rotate(90deg);
}

/* Messages Area */
.lika-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #0a0e27;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.lika-chat-messages::-webkit-scrollbar-track {
    background: #151933;
    border-radius: 10px;
}

.lika-chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    border-radius: 10px;
}

.lika-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #00d9ff;
}

/* Welcome Message */
.lika-welcome-message {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 15px;
    padding: 1.2rem;
    color: #ffffff;
    text-align: center;
}

.lika-welcome-message h4 {
    margin: 0 0 0.5rem 0;
    color: #00d9ff;
    font-size: 1.1rem;
}

.lika-welcome-message p {
    margin: 0;
    font-size: 0.9rem;
    color: #a0aec0;
}

/* Message Bubble */
.lika-message {
    display: flex;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

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

.lika-message.bot {
    flex-direction: row;
}

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

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

.lika-message.bot .lika-message-avatar {
    background: linear-gradient(135deg, #00d9ff, #00ff88);
}

.lika-message.user .lika-message-avatar {
    background: rgba(160, 174, 192, 0.2);
    border: 2px solid rgba(160, 174, 192, 0.3);
}

.lika-message-content {
    max-width: 75%;
}

.lika-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.lika-message.bot .lika-message-bubble {
    background: #1a1f3a;
    color: #ffffff;
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 18px 18px 18px 5px;
}

.lika-message.user .lika-message-bubble {
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    color: #0a0e27;
    font-weight: 500;
    border-radius: 18px 18px 5px 18px;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

.lika-message-time {
    font-size: 0.7rem;
    color: #a0aec0;
    margin-top: 5px;
    padding: 0 5px;
}

/* Typing Indicator */
.lika-typing-indicator {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 16px;
    background: #1a1f3a;
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 18px 18px 18px 5px;
    max-width: 70px;
}

.lika-typing-dot {
    width: 8px;
    height: 8px;
    background: #00d9ff;
    border-radius: 50%;
    animation: typing-pulse 1.4s infinite ease-in-out;
}

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

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

@keyframes typing-pulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Quick Reply Buttons */
.lika-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.lika-quick-reply-btn {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: #00d9ff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lika-quick-reply-btn:hover {
    background: rgba(0, 217, 255, 0.2);
    border-color: #00d9ff;
    transform: translateY(-2px);
}

/* Input Area */
.lika-chat-input-area {
    background: #151933;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 217, 255, 0.2);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

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

.lika-chat-input {
    width: 100%;
    background: #1a1f3a;
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 25px;
    padding: 12px 20px;
    color: #ffffff;
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.lika-chat-input:focus {
    outline: none;
    border-color: #00d9ff;
    background: #1e2446;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.lika-chat-input::placeholder {
    color: #a0aec0;
}

.lika-chat-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
    flex-shrink: 0;
}

.lika-chat-send-btn:hover:not(:disabled) {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.5);
}

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

.lika-chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: #0a0e27;
}

/* Powered By Footer */
.lika-chat-footer {
    padding: 8px;
    text-align: center;
    font-size: 0.7rem;
    color: #a0aec0;
    background: #151933;
}

.lika-chat-footer a {
    color: #00d9ff;
    text-decoration: none;
}

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

    .lika-chat-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
        z-index: 1000;
    }

    /* When chat is open, move button out of view */
    .lika-chat-button.active {
        transform: scale(0);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .lika-chat-tooltip {
        max-width: 200px;
        font-size: 0.85rem;
    }

    /* Also hide tooltip when chat is active */
    .lika-chat-tooltip.hidden {
        display: none;
    }
}
