/* Tacto FX Premium Glassmorphic Chatbot CSS */

/* Floating Button styling */
.tacto-chatbot-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 45% 30%, #eb5d22 0%, #a83109 60%, #420800 100%);
    box-shadow: 0 10px 28px rgba(66, 8, 0, 0.55), 
                inset 0 2px 6px rgba(255, 255, 255, 0.35),
                inset 0 -2px 6px rgba(0, 0, 0, 0.6);
    border: 1.5px solid rgba(255, 93, 34, 0.65);
    z-index: 9999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    animation: chatbot-pulse 2s infinite;
}

.tacto-chatbot-btn:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 12px 32px rgba(235, 93, 34, 0.65);
    border-color: rgba(255, 255, 255, 0.8);
}

.tacto-chatbot-btn:active {
    transform: scale(0.95);
}

.tacto-chatbot-btn svg, .tacto-chatbot-btn img {
    width: 56px;
    height: 56px;
    transition: transform 0.3s ease;
}

.tacto-chatbot-btn:hover svg, .tacto-chatbot-btn:hover img {
    transform: scale(1.05);
}

/* Pulse Ring Animation */
@keyframes chatbot-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 106, 0, 0.7), 0 10px 25px rgba(255, 106, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 106, 0, 0), 0 10px 25px rgba(255, 106, 0, 0.4);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 106, 0, 0), 0 10px 25px rgba(255, 106, 0, 0.4);
    }
}

/* Badge Indicator */
.tacto-chatbot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ff3333;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #050505;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    animation: badge-bounce 1s infinite alternate;
}

@keyframes badge-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

/* Floating Tooltip */
.tacto-chatbot-tooltip {
    position: fixed;
    bottom: 35px;
    right: 95px;
    background: rgba(15, 15, 15, 0.9);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 106, 0, 0.3);
    z-index: 9998;
    backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease;
    white-space: nowrap;
}

.tacto-chatbot-tooltip.show {
    opacity: 1;
    transform: translateX(0);
}

/* Chatbot Main Window */
.tacto-chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    height: 580px;
    max-height: calc(100vh - 130px);
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 
                0 0 40px rgba(255, 106, 0, 0.1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.85) translateY(40px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.45s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tacto-chatbot-window.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header styling */
.tacto-chatbot-header {
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.12) 0%, rgba(255, 60, 0, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tacto-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tacto-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6a00 0%, #ff3c00 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(255, 106, 0, 0.3);
}

.tacto-chatbot-avatar svg, .tacto-chatbot-avatar img {
    width: 22px;
    height: 38px;
    object-fit: contain;
}

.tacto-avatar-status {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #00e676;
    border: 2px solid #0a0a0a;
    box-shadow: 0 0 8px #00e676;
    animation: status-pulse 1.8s infinite;
}

@keyframes status-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(0, 230, 118, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.tacto-chatbot-header-text h5 {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    letter-spacing: 0.3px;
}

.tacto-chatbot-header-text span {
    color: #b0b0b0;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tacto-chatbot-close {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.tacto-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tacto-chatbot-close svg {
    width: 20px;
    height: 20px;
    fill: #a0a0a0;
    transition: fill 0.2s;
}

.tacto-chatbot-close:hover svg {
    fill: #ffffff;
}

/* Chat Messages Area */
.tacto-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

/* Scrollbar customization */
.tacto-chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.tacto-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.tacto-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.tacto-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 106, 0, 0.4);
}

/* Message Bubble layouts */
.tacto-message {
    max-width: 82%;
    display: flex;
    flex-direction: column;
    animation: message-appear 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tacto-message.msg-bot {
    align-self: flex-start;
}

.tacto-message.msg-user {
    align-self: flex-end;
}

.tacto-message-bubble {
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.45;
    font-family: 'Inter', sans-serif;
}

.msg-bot .tacto-message-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    border-radius: 18px 18px 18px 2px;
}

.msg-user .tacto-message-bubble {
    background: linear-gradient(135deg, #ff6a00 0%, #ff3c00 100%);
    color: #ffffff;
    border-radius: 18px 18px 2px 18px;
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.2);
}

.tacto-message-time {
    font-size: 10px;
    color: #707070;
    margin-top: 4px;
    align-self: flex-end;
    padding: 0 4px;
}

.msg-bot .tacto-message-time {
    align-self: flex-start;
}

/* Link in chatbot styling */
.tacto-message-bubble a {
    color: #ff8533;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.tacto-message-bubble a:hover {
    color: #ffb380;
}

/* Quick reply chips styling */
.tacto-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    animation: message-appear 0.4s ease forwards;
}

.tacto-chip {
    background: rgba(255, 106, 0, 0.08);
    border: 1px solid rgba(255, 106, 0, 0.25);
    color: #ff8033;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
}

.tacto-chip:hover {
    background: linear-gradient(135deg, #ff6a00 0%, #ff3c00 100%);
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 106, 0, 0.25);
}

.tacto-chip:active {
    transform: translateY(0);
}

/* Typing Indicator styling */
.tacto-typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 18px 18px 18px 2px;
    width: 65px;
    align-self: flex-start;
}

.tacto-typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: #a0a0a0;
    border-radius: 50%;
    display: inline-block;
    animation: typing-dot 1.4s infinite ease-in-out both;
}

.tacto-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.tacto-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-dot {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Internal lead capture form */
.tacto-chat-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    width: 100%;
}

.tacto-chat-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tacto-chat-input-group label {
    font-size: 11px;
    color: #a0a0a0;
    font-weight: 500;
}

.tacto-chat-form input,
.tacto-chat-form textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 12.5px;
    outline: none;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    width: 100%;
}

.tacto-chat-form input:focus,
.tacto-chat-form textarea:focus {
    border-color: #ff6a00;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 8px rgba(255, 106, 0, 0.2);
}

.tacto-chat-form button {
    background: linear-gradient(135deg, #ff6a00 0%, #ff3c00 100%);
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.tacto-chat-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 106, 0, 0.3);
}

/* Chat Input Footer Area */
.tacto-chatbot-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(8, 8, 8, 0.5);
}

.tacto-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.tacto-input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 10px 18px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.tacto-input-wrapper input:focus {
    border-color: rgba(255, 106, 0, 0.6);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(255, 106, 0, 0.15);
}

.tacto-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6a00 0%, #ff3c00 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 3px 8px rgba(255, 106, 0, 0.2);
}

.tacto-send-btn:hover {
    transform: scale(1.08) rotate(-15deg);
    box-shadow: 0 5px 12px rgba(255, 106, 0, 0.4);
}

.tacto-send-btn:active {
    transform: scale(0.95);
}

.tacto-send-btn svg {
    width: 16px;
    height: 16px;
    fill: #ffffff;
}

/* Responsiveness for Mobile Devices */
@media (max-width: 500px) {
    .tacto-chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 85px;
        right: 15px;
        border-radius: 20px;
    }
    
    .tacto-chatbot-btn {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
    
    .tacto-chatbot-tooltip {
        bottom: 23px;
        right: 80px;
    }
}

/* Hide legacy template help button to prevent duplicate floating icons */
.help {
    display: none !important;
}
