/* Business Plan Chat Input Widget (namespaced) */

.bp-root {
    position: relative;
    width:100%;
    --bp-brand: rgb(234, 78, 48);
    --bp-brand-ring: rgba(234, 78, 48, 0.12);
    --bp-badge-bg: rgba(234, 78, 48, 0.15);
    --bp-badge-border: rgba(234, 78, 48, 0.4);
    --bp-brand-hover: rgb(210, 70, 43);
}

.bp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: none;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}

.bp-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.bp-container {
    height: 56px;
    background-color: #f7f7f8;
    border: 2px solid #dddddd;
    border-bottom: 2px solid var(--bp-brand);
    border-radius: 16px;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
    z-index: 1000;
    overflow: visible;
}

.bp-container::after {
    content: "";
    position: absolute;
    left: -10px;
    top: -10px;
    right: -10px;
    bottom: -10px;
    background: #f7f7f8;
    border: 2px solid var(--bp-brand);
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.18s ease, border-radius 0.18s ease;
}

.bp-container.is-focused {
    box-shadow: 0 24px 70px rgba(0,0,0,0.18), 0 0 0 4px var(--bp-brand-ring);
    border-color: var(--bp-brand);
    border-radius: 20px;
}

.bp-container.is-focused::after {
    opacity: 1;
    border-radius: 30px;
}

.bp-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.bp-face {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    color: var(--bp-brand);
    pointer-events: none;
}

.bp-face .mouth-smile {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.bp-face .mouth-flat {
    opacity: 1;
    transition: opacity 0.15s ease;
}

.bp-face.is-smile .mouth-smile {
    opacity: 1;
}

.bp-face.is-smile .mouth-flat {
    opacity: 0;
}

.bp-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 12pt;
    line-height: 1.6;
    color: #353740;
    padding-left: 62px;
    padding-right: 50px;
    resize: none;
    font-family: inherit;
}

.bp-input::placeholder {
    color: var(--bp-brand);
    opacity: 0.8;
}

.bp-send {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--bp-brand);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    opacity: 1;
    pointer-events: all;
}

.bp-send:hover { background: var(--bp-brand-hover); transform: scale(1.05); }
.bp-send:active { transform: scale(0.95); }

.bp-guidance {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 14px;
    background: #ffffff;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transition: opacity 0.18s ease;
    white-space: normal;
    max-width: 90vw;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    z-index: 1002;
}

.bp-container.is-focused .bp-guidance { opacity: 1; }

.bp-guidance::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #e5e7eb transparent transparent transparent;
}

.bp-guidance::after {
    content: "";
    position: absolute;
    top: calc(100% - 1px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
}

.bp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 8px;
    margin-right: 8px;
    background: var(--bp-badge-bg);
    color: var(--bp-brand);
    border: 1px solid var(--bp-badge-border);
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Below placement for guidance */
.bp-guidance.is-below {
    top: 100%;
    bottom: auto;
    margin-top: 14px;
    margin-bottom: 0;
}

.bp-guidance.is-below::before {
    top: auto;
    bottom: 100%;
    border-color: transparent transparent #e5e7eb transparent;
}

.bp-guidance.is-below::after {
    top: auto;
    bottom: calc(100% - 1px);
    border-color: transparent transparent #ffffff transparent;
}

.bp-portal {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    pointer-events: none;
}

@media (max-width: 768px) {
    .bp-container.is-focused { height: 82px; }
}
