/**
 * lisa-chat-widget.css - MahaloPower "Ask Lisa" FAQ Chat Widget Styles
 *
 * All selectors prefixed with .lc- (lisa-chat) to avoid conflicts
 * with existing mahalopower.com styles.
 *
 * Location: /var/www/mahalopower_com/public/assets/chat/lisa-chat-widget.css
 * Created: 2026-03-10
 */

/* ── Variables (scoped to container) ── */
#lisa-chat-container {
    --lc-green: #1a5c2e;
    --lc-green-light: #2d8a4e;
    --lc-green-pale: #e8f5ec;
    --lc-orange: #e8863a;
    --lc-cream: #fafaf7;
    --lc-white: #ffffff;
    --lc-text: #2c2c2c;
    --lc-text-light: #6b7c6f;
    --lc-border: #e0e0e0;
    --lc-shadow: 0 4px 16px rgba(26, 92, 46, 0.3);
    --lc-shadow-heavy: 0 12px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    --lc-radius: 20px;
    --lc-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

    font-family: var(--lc-font);
    line-height: 1.5;
    box-sizing: border-box;
}

#lisa-chat-container *, #lisa-chat-container *::before, #lisa-chat-container *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Chat Bubble ── */
.lc-bubble {
    position: fixed;
    bottom: 82px;
    right: 24px;
    z-index: 100000;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lc-bubble:hover {
    transform: scale(1.08);
}

.lc-bubble:active {
    transform: scale(0.95);
}

.lc-bubble-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--lc-shadow);
    background: linear-gradient(135deg, var(--lc-green) 0%, var(--lc-green-light) 100%);
    transition: box-shadow 0.3s ease;
    font-family: var(--lc-font);
}

.lc-bubble:hover .lc-bubble-btn {
    box-shadow: 0 6px 24px rgba(26, 92, 46, 0.45), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lc-bubble-btn svg {
    width: 22px;
    height: 22px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.lc-bubble-btn .lc-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.lc-bubble.lc-open .lc-bubble-btn .lc-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.lc-bubble.lc-open .lc-bubble-btn .lc-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Pulse ring */
.lc-bubble-btn::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(26, 92, 46, 0.2);
    animation: lc-pulse 2.5s ease-out infinite;
    pointer-events: none;
}

.lc-bubble.lc-open .lc-bubble-btn::before {
    animation: none;
    opacity: 0;
}

@keyframes lc-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    70% { transform: scale(1.7); opacity: 0; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* Notification dot */
.lc-bubble-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 15px;
    height: 15px;
    background: var(--lc-orange);
    border: 2.5px solid var(--lc-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--lc-white);
    z-index: 1;
    transition: opacity 0.2s;
    font-family: var(--lc-font);
}

.lc-bubble.lc-open .lc-bubble-dot {
    opacity: 0;
}

/* ── Chat Panel ── */
.lc-panel {
    position: fixed;
    bottom: 156px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    z-index: 99998;
    border-radius: var(--lc-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--lc-shadow-heavy);
    background: var(--lc-white);
    transform: translateY(20px) scale(0.92);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.25s ease;
    transform-origin: bottom right;
}

.lc-panel.lc-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* ── Header ── */
.lc-header {
    background: linear-gradient(135deg, var(--lc-green) 0%, var(--lc-green-light) 50%, var(--lc-green) 100%);
    padding: 16px 16px 14px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.lc-header::after {
    content: '';
    position: absolute;
    top: -40%;
    left: -10%;
    width: 120%;
    height: 180%;
    background: radial-gradient(ellipse at 30% 50%, rgba(255, 255, 255, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.lc-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.lc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lc-header-info {
    flex: 1;
}

.lc-header-info h4 {
    color: var(--lc-white);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
}

.lc-status {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.75rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lc-status-dot {
    width: 7px;
    height: 7px;
    background: #6fdf8f;
    border-radius: 50%;
    display: inline-block;
    animation: lc-status-pulse 2s ease-in-out infinite;
}

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

.lc-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.lc-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lc-header-sub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.72rem;
    position: relative;
    z-index: 1;
    margin-top: 4px;
}

/* ── Messages ── */
.lc-messages {
    flex: 1;
    padding: 16px 22px 16px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--lc-cream);
    min-height: 240px;
    max-height: 340px;
}

.lc-messages::-webkit-scrollbar { width: 5px; }
.lc-messages::-webkit-scrollbar-track { background: transparent; }
.lc-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* Messages */
.lc-msg {
    max-width: 78%;
    animation: lc-msg-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes lc-msg-in {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.lc-msg-lisa {
    margin-left: 14px;
    align-self: flex-start;
}

.lc-msg-visitor {
    margin-right: 14px;
    align-self: flex-end;
}

.lc-msg-name {
    margin-left: 8px !important;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--lc-green);
    margin-bottom: 3px;
    padding-left: 4px !important;
}

.lc-msg-text {
    padding: 14px 14px !important;
    border-radius: 16px;
    font-size: 0.86rem;
    line-height: 1.55;
}

.lc-msg-lisa .lc-msg-text {
    background: var(--lc-white);
    color: var(--lc-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.lc-msg-visitor .lc-msg-text {
    background: linear-gradient(135deg, var(--lc-green), var(--lc-green-light));
    color: var(--lc-white);
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.lc-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    max-width: 68px;
    background: var(--lc-white);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    animation: lc-msg-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.lc-typing span {
    width: 7px;
    height: 7px;
    background: var(--lc-green);
    border-radius: 50%;
    opacity: 0.35;
    animation: lc-typing-bounce 1.4s ease-in-out infinite;
}

.lc-typing span:nth-child(2) { animation-delay: 0.15s; }
.lc-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes lc-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Progress status during loading */
.lc-progress-status {
    align-self: flex-start;
    font-size: 0.74rem;
    color: var(--lc-text-light);
    padding: 2px 4px;
    font-style: italic;
    animation: lc-progress-fade 0.4s ease both;
}

@keyframes lc-progress-fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Quick Suggestions ── */
.lc-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 18px 10px;
    background: var(--lc-cream);
}

.lc-quick-btn {
    padding: 6px 12px;
    border-radius: 100px;
    border: 1.5px solid #d4ddd6;
    background: var(--lc-white);
    color: var(--lc-green);
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--lc-font);
    line-height: 1.3;
}

.lc-quick-btn:hover {
    background: var(--lc-green);
    color: var(--lc-white);
    border-color: var(--lc-green);
    transform: translateY(-1px);
}

/* ── Input Area ── */
.lc-input-area {
    padding: 10px 16px 12px 18px;
    background: var(--lc-white);
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lc-input {
    flex: 1;
    border: 1.5px solid var(--lc-border);
    border-radius: 100px;
    padding: 9px 16px !important; margin-left: 8px !important;
    font-size: 0.86rem;
    font-family: var(--lc-font);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    color: var(--lc-text);
    background: var(--lc-cream);
    line-height: 1.4;
}

.lc-input::placeholder {
    color: #aaa;
}

.lc-input:focus {
    border-color: var(--lc-green);
    background: var(--lc-white);
}

.lc-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.lc-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--lc-green), var(--lc-green-light));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
    font-family: var(--lc-font);
}

.lc-send:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(26, 92, 46, 0.3);
}

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

.lc-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ── Email Collector (inline in chat) ── */
.lc-email-collect {
    padding: 4px 8px 2px 8px !important;
}

.lc-email-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.lc-email-input {
    flex: 1;
    border: 1.5px solid var(--lc-border);
    border-radius: 8px;
    padding: 10px 14px !important; margin-left: 8px !important;
    font-size: 0.84rem;
    font-family: var(--lc-font);
    outline: none;
    color: var(--lc-text);
    background: var(--lc-cream);
    transition: border-color 0.2s;
    min-width: 0;
}

.lc-email-input:focus {
    border-color: var(--lc-green);
    background: var(--lc-white);
}

.lc-email-input::placeholder {
    color: #aaa;
}

.lc-email-submit {
    padding: 10px 24px !important;
    border-radius: 8px;
    border: none;
    background: var(--lc-green);
    color: var(--lc-white);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--lc-font);
    transition: background 0.2s;
    white-space: nowrap;
}

.lc-email-submit:hover {
    background: var(--lc-green-light);
}

.lc-email-skip {
    background: none;
    border: none;
    color: var(--lc-text-light);
    font-size: 0.74rem;
    cursor: pointer;
    font-family: var(--lc-font);
    padding: 2px 0;
    transition: color 0.2s;
}

.lc-email-skip:hover {
    color: var(--lc-text);
}

/* ── Footer ── */
.lc-footer {
    text-align: center;
    padding: 5px;
    font-size: 0.62rem;
    color: #bbb;
    background: var(--lc-white);
    flex-shrink: 0;
}

/* ── Mobile Responsive ── */
@media (max-width: 500px) {
    .lc-panel {
        right: 6px;
        left: 6px;
        bottom: 140px;
        width: auto;
        max-height: calc(100vh - 140px);
        max-height: calc(100dvh - 140px);
        border-radius: 16px;
    }

    .lc-messages {
        max-height: none;
        flex: 1;
        padding: 16px 22px 16px 24px;
    }

    .lc-bubble {
        bottom: 76px;
        right: 16px;
    }

    .lc-bubble-btn {
        width: 46px;
        height: 46px;
    }
}

@media (max-width: 500px) and (max-height: 700px) {
    .lc-messages {
        min-height: 160px;
    }
}

/* ── Accessibility ── */
.lc-bubble-btn:focus-visible,
.lc-send:focus-visible,
.lc-close-btn:focus-visible,
.lc-quick-btn:focus-visible {
    outline: 3px solid var(--lc-orange);
    outline-offset: 2px;
}

.lc-input:focus-visible {
    outline: none;
    border-color: var(--lc-green);
    box-shadow: 0 0 0 3px rgba(26, 92, 46, 0.15);
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .lc-bubble-btn::before { animation: none; }
    .lc-status-dot { animation: none; opacity: 1; }
    .lc-typing span { animation: none; opacity: 0.6; }
    .lc-msg { animation: none; }
    .lc-typing { animation: none; }
    .lc-panel { transition: opacity 0.15s ease; }
    .lc-bubble { transition: none; }
}
