﻿/* =========================
   CHAT WIDGET - LANCASTER
   ========================= */

#ldChatWidget.ld-chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: auto;
    top: auto;
    z-index: 9999;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
}

#ldChatWidget .ld-chat-toggle {
    position: relative;
    z-index: 2;
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

    #ldChatWidget .ld-chat-toggle:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 22px 50px rgba(15, 23, 42, 0.33);
    }

    #ldChatWidget .ld-chat-toggle svg {
        width: 28px;
        height: 28px;
    }

#ldChatWidget .ld-chat-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 380px;
    max-width: calc(100vw - 24px);
    display: block;
    margin: 0;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

#ldChatWidget.is-open .ld-chat-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#ldChatWidget.is-open .ld-chat-toggle {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

#ldChatWidget .ld-chat-header {
    position: relative;
    padding: 20px 20px 18px;
    margin: 0;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 38%), linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
}

#ldChatWidget .ld-chat-header__info h3 {
    margin: 10px 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
}

#ldChatWidget .ld-chat-header__info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.93rem;
    line-height: 1.45;
}

#ldChatWidget .ld-chat-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

#ldChatWidget .ld-chat-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

    #ldChatWidget .ld-chat-close:hover {
        background: rgba(255, 255, 255, 0.22);
        transform: scale(1.04);
    }

#ldChatWidget .ld-chat-body {
    padding: 18px;
    margin: 0;
    max-height: min(72vh, 680px);
    overflow-y: auto;
}

#ldChatWidget .ld-chat-message {
    display: flex;
    margin: 0 0 16px 0;
}

#ldChatWidget .ld-chat-message__bubble {
    max-width: 92%;
    padding: 14px 16px;
    border-radius: 18px 18px 18px 6px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
}

#ldChatWidget .ld-chat-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 18px 0;
}

#ldChatWidget .ld-chat-option {
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #fff;
    color: #0f172a;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

    #ldChatWidget .ld-chat-option:hover {
        transform: translateY(-1px);
        border-color: rgba(15, 23, 42, 0.3);
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    }

    #ldChatWidget .ld-chat-option.is-selected {
        border-color: #0f172a;
        background: #f8fafc;
        box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    }

#ldChatWidget .ld-chat-form-wrap {
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    padding-top: 16px;
}

#ldChatWidget .ld-chat-form-intro {
    margin-bottom: 14px;
    font-size: 0.92rem;
    color: #475569;
}

#ldChatWidget .ld-chat-form {
    display: grid;
    gap: 12px;
}

#ldChatWidget .ld-chat-field {
    display: grid;
    gap: 6px;
}

    #ldChatWidget .ld-chat-field label {
        font-size: 0.84rem;
        font-weight: 700;
        color: #334155;
    }

    #ldChatWidget .ld-chat-field input,
    #ldChatWidget .ld-chat-field textarea {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid rgba(148, 163, 184, 0.3);
        border-radius: 14px;
        padding: 12px 14px;
        font-size: 0.95rem;
        color: #0f172a;
        background: #fff;
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        #ldChatWidget .ld-chat-field input:focus,
        #ldChatWidget .ld-chat-field textarea:focus {
            border-color: rgba(15, 23, 42, 0.55);
            box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.08);
        }

    #ldChatWidget .ld-chat-field textarea {
        resize: vertical;
        min-height: 100px;
    }

#ldChatWidget .ld-chat-actions {
    padding-top: 4px;
}

#ldChatWidget .ld-chat-submit {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

    #ldChatWidget .ld-chat-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
    }

    #ldChatWidget .ld-chat-submit:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        transform: none;
    }

#ldChatWidget .ld-chat-status {
    min-height: 22px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

    #ldChatWidget .ld-chat-status.is-success {
        color: #166534;
    }

    #ldChatWidget .ld-chat-status.is-error {
        color: #b91c1c;
    }

@media (max-width: 640px) {
    #ldChatWidget.ld-chat-widget {
        right: 14px;
        bottom: 14px;
    }

    #ldChatWidget .ld-chat-toggle {
        width: 58px;
        height: 58px;
    }

    #ldChatWidget .ld-chat-panel {
        right: 0;
        bottom: 72px;
        width: min(360px, calc(100vw - 20px));
        max-width: calc(100vw - 20px);
        border-radius: 20px;
    }

    #ldChatWidget .ld-chat-options {
        grid-template-columns: 1fr;
    }

    #ldChatWidget .ld-chat-body {
        max-height: 68vh;
    }
}
