/* ==========================================================================
   LITA AI CHATBOT WIDGET - YAMAHA LAUTAN TEDUH LAMPUNG
   ========================================================================== */

:root {
    --lita-primary: #1a3673;
    --lita-primary-dark: #0f2452;
    --lita-accent: #007bff;
    --lita-wa: #25d366;
    --lita-wa-hover: #1ebe5d;
    --lita-bg: #f8fafc;
    --lita-user-msg: #1a3673;
    --lita-bot-msg: #ffffff;
    --lita-text-dark: #1e293b;
    --lita-text-muted: #64748b;
    --lita-radius: 20px;
}

/* Floating Trigger Button */
.lita-floating-btn-wrap {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.lita-tooltip-bubble {
    background: #ffffff;
    color: #1a3673;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: litaBounce 2.5s infinite;
    border: 1px solid #e2e8f0;
}

.lita-tooltip-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

@keyframes litaBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-7px); }
    60% { transform: translateY(-4px); }
}

.lita-floating-btn {
    width: 155px;
    height: 155px;
    border-radius: 0;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    position: relative;
    box-shadow: none !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lita-floating-btn:hover {
    transform: scale(1.06);
}

.lita-floating-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0 !important;
    box-shadow: none !important;
    filter: none !important;
}

.lita-badge-online {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 16px;
    height: 16px;
    background-color: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: none !important;
}

/* Chat Container */
.lita-chat-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 385px;
    max-width: calc(100vw - 30px);
    height: 560px;
    max-height: calc(100vh - 50px);
    background: #ffffff;
    border-radius: var(--lita-radius);
    box-shadow: 0 15px 45px rgba(15, 36, 82, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

.lita-chat-widget.active {
    display: flex;
    animation: litaWidgetPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes litaWidgetPop {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header */
.lita-chat-header {
    background: linear-gradient(135deg, var(--lita-primary) 0%, var(--lita-primary-dark) 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lita-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lita-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    padding: 2px;
    position: relative;
    flex-shrink: 0;
}

.lita-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.lita-header-avatar .dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.lita-header-text h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.lita-header-text p {
    margin: 2px 0 0;
    font-size: 11.5px;
    opacity: 0.85;
}

.lita-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lita-btn-icon {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.lita-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.lita-btn-wa-header {
    background: var(--lita-wa);
    color: #ffffff;
}

.lita-btn-wa-header:hover {
    background: var(--lita-wa-hover);
    color: #ffffff;
}

/* WhatsApp Banner Inside Chat */
.lita-wa-banner {
    background: #ecfdf5;
    border-bottom: 1px solid #d1fae5;
    padding: 9px 16px;
    font-size: 12px;
    color: #065f46;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lita-wa-banner a {
    color: #047857;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #d1fae5;
    padding: 3px 8px;
    border-radius: 12px;
    transition: background 0.2s;
}

.lita-wa-banner a:hover {
    background: #a7f3d0;
}

/* Body & Messages */
.lita-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--lita-bg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.lita-chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Chat Bubbles */
.lita-message {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: litaFadeIn 0.25s ease-out;
}

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

.lita-message.bot {
    align-self: flex-start;
}

.lita-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.lita-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}

.lita-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lita-bubble {
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.5;
    border-radius: 16px;
    word-wrap: break-word;
}

.lita-message.bot .lita-bubble {
    background: var(--lita-bot-msg);
    color: var(--lita-text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.lita-message.user .lita-bubble {
    background: var(--lita-user-msg);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(26, 54, 115, 0.25);
}

.lita-bubble p {
    margin: 0 0 6px;
}

.lita-bubble p:last-child {
    margin-bottom: 0;
}

.lita-bubble ul, .lita-bubble ol {
    margin: 4px 0 6px 18px;
    padding: 0;
}

.lita-bubble li {
    margin-bottom: 3px;
}

.lita-bubble a {
    color: #0284c7;
    font-weight: 600;
    text-decoration: underline;
}

.lita-bubble strong {
    color: #0f172a;
}

.lita-message.user .lita-bubble strong {
    color: #ffffff;
}

/* Quick Suggestion Pills */
.lita-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.lita-quick-pill {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--lita-primary);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.lita-quick-pill:hover {
    background: var(--lita-primary);
    color: #ffffff;
    border-color: var(--lita-primary);
    transform: translateY(-1px);
}

.lita-quick-pill.wa-pill {
    color: #047857;
    border-color: #86efac;
    background: #f0fdf4;
}

.lita-quick-pill.wa-pill:hover {
    background: var(--lita-wa);
    color: #ffffff;
    border-color: var(--lita-wa);
}

/* Typing Indicator */
.lita-typing-indicator {
    display: none;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    padding: 8px 14px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.lita-typing-indicator span {
    font-size: 12px;
    color: var(--lita-text-muted);
    font-weight: 500;
    margin-right: 4px;
}

.lita-dot-pulse {
    display: inline-flex;
    gap: 3px;
}

.lita-dot-pulse div {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: litaDotPulse 1.4s infinite ease-in-out both;
}

.lita-dot-pulse div:nth-child(1) { animation-delay: -0.32s; }
.lita-dot-pulse div:nth-child(2) { animation-delay: -0.16s; }

@keyframes litaDotPulse {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Footer & Input */
.lita-chat-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 14px 10px;
}

.lita-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lita-chat-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc;
}

.lita-chat-input:focus {
    border-color: var(--lita-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 54, 115, 0.1);
}

.lita-btn-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--lita-primary);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lita-btn-send:hover {
    background: var(--lita-accent);
    transform: scale(1.05);
}

.lita-btn-send:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.lita-footer-caption {
    font-size: 10.5px;
    color: #94a3b8;
    text-align: center;
    margin: 6px 0 0;
}

.lita-footer-caption a {
    color: #047857;
    font-weight: 700;
    text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .lita-floating-btn-wrap {
        bottom: 15px;
        right: 15px;
    }
    .lita-floating-btn {
        width: 115px;
        height: 115px;
    }
    .lita-chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        height: calc(100vh - 20px);
        max-height: none;
    }
}
