/* ==========================================================================
   LIAHONA PAINTING - AI CHATBOT CONCIERGE STYLESHEET
   ========================================================================== */

/* --- Chatbot Floating Trigger Button --- */
.liahona-chat-widget {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99990;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Trigger Button Container */
.chat-trigger-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #181b20 0%, #0c0d0f 100%);
    border: 2px solid rgba(216, 175, 117, 0.45);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(216, 175, 117, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    padding: 0;
    color: #fae4c3;
}

.chat-trigger-btn:hover {
    transform: scale(1.08) translateY(-3px);
    border-color: #d8af75;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.6), 0 0 35px rgba(216, 175, 117, 0.55);
}

.chat-trigger-btn:active {
    transform: scale(0.96);
}

/* Pulse Aura Ring around button */
.chat-trigger-btn::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 1.5px solid rgba(216, 175, 117, 0.6);
    animation: chatPulseRing 2.4s cubic-bezier(0.25, 0.8, 0.25, 1) infinite;
    pointer-events: none;
}

@keyframes chatPulseRing {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.18);
        opacity: 0;
    }
    100% {
        transform: scale(0.95);
        opacity: 0;
    }
}

/* Trigger Icons */
.trigger-icon-chat,
.trigger-icon-close {
    position: absolute;
    width: 28px;
    height: 28px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.trigger-icon-chat {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.trigger-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.chat-widget-open .trigger-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.chat-widget-open .trigger-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Online Status Green Ping */
.chat-status-ping {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2.5px solid #0c0d0f;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.chat-status-ping::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #10b981;
    animation: pingDot 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pingDot {
    75%, 100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

/* Teaser Speech Bubble */
.chat-teaser-bubble {
    position: absolute;
    bottom: 12px;
    right: 76px;
    background: rgba(18, 20, 24, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(216, 175, 117, 0.35);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(216, 175, 117, 0.2);
    border-radius: 14px;
    padding: 10px 16px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: teaserFloat 3s ease-in-out infinite;
    pointer-events: auto;
}

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

.chat-teaser-bubble:hover {
    border-color: #d8af75;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), 0 0 25px rgba(216, 175, 117, 0.35);
}

.teaser-text {
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
}

.teaser-text strong {
    color: #d8af75;
}

.teaser-close {
    background: none;
    border: none;
    color: #a5b5c1;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s;
}

.teaser-close:hover {
    color: #ffffff;
}

.chat-teaser-bubble.hidden {
    opacity: 0;
    transform: scale(0.9) translateX(10px);
    pointer-events: none;
}

/* --- Main Chat Window --- */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 395px;
    height: 610px;
    max-height: calc(100vh - 120px);
    background: rgba(12, 13, 15, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(216, 175, 117, 0.25);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 40px rgba(216, 175, 117, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0.75) translateY(30px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 99995;
}

.chat-widget-open .chat-window {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Top Subtle Gold Gradient Bar */
.chat-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #b88849, #fae4c3, #d8af75, #b88849);
    background-size: 200% auto;
    animation: goldShimmer 4s linear infinite;
    z-index: 10;
}

@keyframes goldShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Chat Header */
.chat-header {
    background: rgba(18, 20, 24, 0.85);
    border-bottom: 1px solid rgba(216, 175, 117, 0.18);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 5;
}

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

.chat-avatar-wrapper {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(216, 175, 117, 0.25), rgba(24, 26, 30, 0.8));
    border: 1px solid rgba(216, 175, 117, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(216, 175, 117, 0.2);
}

.chat-avatar-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.avatar-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid #0c0d0f;
    border-radius: 50%;
}

.header-info {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sparkle-icon {
    width: 14px;
    height: 14px;
    color: #d8af75;
}

.chat-subtitle {
    font-size: 11px;
    color: #10b981;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-subtitle span {
    color: #a5b5c1;
}

/* Header Controls */
.chat-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a5b5c1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.header-btn:hover {
    background: rgba(216, 175, 117, 0.15);
    border-color: rgba(216, 175, 117, 0.35);
    color: #fae4c3;
}

/* Chat Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(216, 175, 117, 0.25);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(216, 175, 117, 0.45);
}

/* Message Wrapper */
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 86%;
    animation: msgFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.chat-msg.bot {
    align-self: flex-start;
}

.chat-msg.user {
    align-self: flex-end;
}

/* Message Bubble */
.msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
    position: relative;
}

.chat-msg.bot .msg-bubble {
    background: rgba(24, 26, 30, 0.85);
    border: 1px solid rgba(216, 175, 117, 0.16);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.chat-msg.user .msg-bubble {
    background: linear-gradient(135deg, #fae4c3 0%, #d8af75 50%, #b88849 100%);
    color: #0c0d0f;
    font-weight: 500;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px rgba(216, 175, 117, 0.35);
}

.msg-time {
    font-size: 10px;
    color: #718096;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-msg.user .msg-time {
    text-align: right;
}

/* Bot Rich Content Elements */
.msg-bubble strong {
    color: #fae4c3;
    font-weight: 600;
}

.chat-msg.user .msg-bubble strong {
    color: #0c0d0f;
}

.msg-bubble a {
    color: #d8af75;
    text-decoration: underline;
    font-weight: 600;
}

.msg-bubble a:hover {
    color: #fae4c3;
}

/* Action Cards inside messages */
.chat-action-card {
    margin-top: 10px;
    background: rgba(12, 13, 15, 0.6);
    border: 1px solid rgba(216, 175, 117, 0.25);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-card-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #fae4c3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-card-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.action-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 11.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.action-card-btn.primary {
    background: linear-gradient(135deg, #fae4c3 0%, #d8af75 100%);
    color: #0c0d0f;
    box-shadow: 0 2px 10px rgba(216, 175, 117, 0.25);
}

.action-card-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(216, 175, 117, 0.45);
    color: #000000;
    text-decoration: none;
}

.action-card-btn.outline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(216, 175, 117, 0.3);
    color: #fae4c3;
}

.action-card-btn.outline:hover {
    background: rgba(216, 175, 117, 0.15);
    border-color: #d8af75;
    text-decoration: none;
}

/* Quick Suggestion Chips Container */
.chat-quick-suggestions {
    padding: 8px 16px 4px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
    background: transparent;
}

.suggestion-chip {
    background: rgba(24, 26, 30, 0.7);
    border: 1px solid rgba(216, 175, 117, 0.25);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    outline: none;
}

.suggestion-chip:hover {
    background: rgba(216, 175, 117, 0.15);
    border-color: #d8af75;
    color: #fae4c3;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(216, 175, 117, 0.2);
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: rgba(24, 26, 30, 0.85);
    border: 1px solid rgba(216, 175, 117, 0.16);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #d8af75;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

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

/* Chat Input Bar */
.chat-footer {
    padding: 12px 16px;
    background: rgba(18, 20, 24, 0.95);
    border-top: 1px solid rgba(216, 175, 117, 0.18);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(12, 13, 15, 0.85);
    border: 1px solid rgba(216, 175, 117, 0.25);
    border-radius: 14px;
    padding: 4px 6px 4px 14px;
    transition: all 0.25s ease;
}

.chat-input-form:focus-within {
    border-color: #d8af75;
    box-shadow: 0 0 16px rgba(216, 175, 117, 0.25);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13.5px;
    padding: 8px 0;
    font-family: inherit;
}

.chat-input::placeholder {
    color: #718096;
    font-size: 12.5px;
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fae4c3 0%, #d8af75 100%);
    border: none;
    color: #0c0d0f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(216, 175, 117, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-footnote {
    font-size: 10.5px;
    color: #718096;
    text-align: center;
    letter-spacing: 0.3px;
}

.chat-footnote strong {
    color: #d8af75;
}

/* Mobile Pull Down Handle (hidden on desktop) */
.mobile-pull-handle {
    display: none;
    width: 38px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 8px auto 2px auto;
}

/* --- Responsive Adjustments --- */
@media (max-width: 480px) {
    .liahona-chat-widget {
        bottom: 18px;
        right: 18px;
    }

    .chat-trigger-btn {
        width: 56px;
        height: 56px;
    }

    .chat-teaser-bubble {
        right: 68px;
        max-width: 220px;
        white-space: normal;
        padding: 8px 12px;
        font-size: 12px;
    }

    .chat-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 88vh;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
        border-bottom: none;
        transform: translateY(100%);
    }

    .chat-widget-open .chat-window {
        transform: translateY(0);
    }

    .mobile-pull-handle {
        display: block;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-messages {
        padding: 14px;
    }

    .chat-msg {
        max-width: 92%;
    }
}
