/* ==========================================================================
   HOLO BOOKKEEPER LIVE CHAT WIDGET
   Brand colors: #17141F (dark charcoal) + #22C55E (green) + #15803d (dark green)
   ========================================================================== */

#holo-chat-root,
#holo-chat-root * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

#holo-chat-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
}

/* ===== Floating Launcher PILL Button (GREEN) ===== */
#holo-chat-launcher {
    position: relative;
    min-width: 150px;
    height: 56px;
    padding: 0 22px 0 18px;
    border-radius: 999px;
    background: #569F50;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(86, 159, 80, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

#holo-chat-launcher:hover {
    transform: translateY(-2px);
    background: #4a8c45;
    box-shadow: 0 14px 32px rgba(86, 159, 80, 0.5), 0 6px 14px rgba(0, 0, 0, 0.2);
}

#holo-chat-launcher svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

#holo-chat-launcher-text {
    line-height: 1;
}

.holo-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    border: 2px solid #569F50;
    border-radius: 999px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Chat Window ===== */
#holo-chat-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 620px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(23, 20, 31, 0.25), 0 8px 16px rgba(23, 20, 31, 0.15);
    overflow: hidden;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#holo-chat-window.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ===== Header (with HOLO logo) ===== */
.holo-chat-header {
    background: linear-gradient(135deg, #17141F, #2a2435);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.holo-chat-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #17141F;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 4px;
    overflow: hidden;
}

.holo-chat-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.holo-chat-header-info {
    line-height: 1.3;
}

.holo-chat-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.holo-chat-status {
    font-size: 12px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.holo-chat-dot {
    width: 8px;
    height: 8px;
    background: #22C55E;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: holo-dot-pulse 2s infinite;
}

@keyframes holo-dot-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.holo-chat-minimize {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.holo-chat-minimize:hover {
    background: rgba(255, 255, 255, 0.18);
}

.holo-chat-minimize svg {
    width: 16px;
    height: 16px;
}

/* ===== Welcome Form ===== */
.holo-chat-form-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    background: #fafafa;
}

.holo-chat-welcome h3 {
    margin: 0 0 6px;
    font-size: 19px;
    color: #17141F;
    font-weight: 700;
}

.holo-chat-welcome p {
    margin: 0 0 16px;
    font-size: 13.5px;
    color: #4b5563;
    line-height: 1.5;
}

/* ===== Suggestions block — between Phone and Message ===== */
.holo-chat-welcome-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 16px;
    padding: 14px 12px 12px;
    background: rgba(34, 197, 94, 0.06);
    border: 1px dashed rgba(34, 197, 94, 0.35);
    border-radius: 12px;
}

.holo-chat-welcome-label {
    width: 100%;
    font-size: 11.5px;
    font-weight: 700;
    color: #15803d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.holo-chat-field {
    margin-bottom: 12px;
}

.holo-chat-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.holo-chat-optional {
    color: #9ca3af;
    font-weight: 400;
}

.holo-chat-field input,
.holo-chat-field textarea {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 14px;
    background: #fff;
    color: #17141F;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.holo-chat-field input:focus,
.holo-chat-field textarea:focus {
    border-color: #22C55E;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.holo-chat-field textarea {
    resize: vertical;
    min-height: 70px;
}

/* === FADED PLACEHOLDER TEXT === */
.holo-chat-field input::placeholder,
.holo-chat-field textarea::placeholder,
#holo-chat-reply-input::placeholder {
    color: #9ca3af;
    opacity: 1;
    font-weight: 400;
}

.holo-chat-field input::-webkit-input-placeholder,
.holo-chat-field textarea::-webkit-input-placeholder,
#holo-chat-reply-input::-webkit-input-placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.holo-chat-field input::-moz-placeholder,
.holo-chat-field textarea::-moz-placeholder,
#holo-chat-reply-input::-moz-placeholder {
    color: #9ca3af;
    opacity: 1;
    font-weight: 400;
}

.holo-chat-field input:-ms-input-placeholder,
.holo-chat-field textarea:-ms-input-placeholder,
#holo-chat-reply-input:-ms-input-placeholder {
    color: #9ca3af;
    font-weight: 400;
}

#holo-chat-submit {
    width: 100%;
    background: linear-gradient(135deg, #22C55E, #15803d);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: opacity 0.15s, transform 0.1s;
}

#holo-chat-submit:hover {
    opacity: 0.92;
}

#holo-chat-submit:active {
    transform: scale(0.98);
}

#holo-chat-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Conversation Area ===== */
.holo-chat-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafafa;
}

.holo-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.holo-chat-msg {
    max-width: 80%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.holo-chat-msg.customer {
    align-self: flex-end;
    background: linear-gradient(135deg, #22C55E, #15803d);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.holo-chat-msg.agent {
    align-self: flex-start;
    background: #fff;
    color: #17141F;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 6px;
}

.holo-chat-msg-time {
    font-size: 10.5px;
    opacity: 0.7;
    margin-top: 5px;
    display: block;
}

/* ===== Quick Reply Suggestion BUTTONS ===== */
/* Default (compact, inside chat) — kept light/outlined for less visual weight */
.holo-chat-suggestion {
    background: #fff;
    border: 1.5px solid #d1fae5;
    color: #15803d;
    padding: 7px 11px;
    border-radius: 18px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-weight: 500;
    font-family: inherit;
}

.holo-chat-suggestion:hover {
    background: #f0fdf4;
    border-color: #22C55E;
    transform: translateY(-1px);
}

/* WELCOME-FORM variant — OUTLINED (white bg, green border/text) */
.holo-welcome-suggestion {
    background: #fff;
    border: 1.5px solid #d1fae5;
    color: #15803d;
    padding: 7px 11px;
    border-radius: 18px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-weight: 500;
    font-family: inherit;
}

.holo-welcome-suggestion:hover {
    background: #f0fdf4;
    border-color: #22C55E;
    transform: translateY(-1px);
    color: #15803d;
}

.holo-welcome-suggestion:active {
    transform: translateY(0);
}

/* ===== Quick Reply Suggestions container in conversation ===== */
.holo-chat-suggestions {
    padding: 10px 14px 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
    max-height: 140px;
    overflow-y: auto;
}

/* ===== Reply Input ===== */
.holo-chat-reply {
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

#holo-chat-reply-input {
    flex: 1;
    border: 1.5px solid #e5e7eb;
    border-radius: 22px;
    padding: 10px 14px;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 80px;
    font-family: inherit;
    color: #17141F;
    transition: border-color 0.15s;
}

#holo-chat-reply-input:focus {
    border-color: #22C55E;
}

#holo-chat-send {
    background: linear-gradient(135deg, #22C55E, #15803d);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s, transform 0.1s;
}

#holo-chat-send:hover {
    opacity: 0.9;
}

#holo-chat-send:active {
    transform: scale(0.95);
}

#holo-chat-send svg {
    width: 18px;
    height: 18px;
    margin-left: -2px;
    margin-top: 1px;
}

#holo-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Footer ===== */
.holo-chat-footer {
    padding: 8px 14px;
    background: #f9fafb;
    border-top: 1px solid #f0f0f0;
    font-size: 11px;
    text-align: center;
    color: #9ca3af;
    flex-shrink: 0;
}

.holo-chat-footer strong {
    color: #17141F;
}

/* ===== Typing indicator ===== */
.holo-chat-typing {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    padding: 12px 16px;
    display: inline-flex;
    gap: 4px;
}

.holo-chat-typing span {
    width: 7px;
    height: 7px;
    background: #22C55E;
    border-radius: 50%;
    animation: holo-typing 1.4s infinite;
}

.holo-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.holo-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes holo-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ===== Scrollbars ===== */
.holo-chat-messages::-webkit-scrollbar,
.holo-chat-form-wrap::-webkit-scrollbar,
.holo-chat-suggestions::-webkit-scrollbar {
    width: 6px;
}

.holo-chat-messages::-webkit-scrollbar-track,
.holo-chat-form-wrap::-webkit-scrollbar-track,
.holo-chat-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.holo-chat-messages::-webkit-scrollbar-thumb,
.holo-chat-form-wrap::-webkit-scrollbar-thumb,
.holo-chat-suggestions::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.holo-chat-messages::-webkit-scrollbar-thumb:hover,
.holo-chat-form-wrap::-webkit-scrollbar-thumb:hover,
.holo-chat-suggestions::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
    #holo-chat-root {
        bottom: 16px;
        right: 16px;
    }

    #holo-chat-launcher {
        min-width: 140px;
        height: 52px;
        font-size: 14px;
    }

    #holo-chat-window {
        width: calc(100vw - 24px);
        right: -8px;
        bottom: 72px;
        height: calc(100vh - 110px);
    }
}
