/* LUC AI Assistant Widget — LucrativeIT */

.luc-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100001;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transition: bottom 0.35s cubic-bezier(0.22, 1, 0.36, 1), right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Stack above floating cart / estimate widgets */
.luc-widget--stacked {
    bottom: 96px;
}

/* Hide LUC launcher while cart / estimate panel is open (LUC chat stays if already open) */
.luc-widget--suppressed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.92);
}

.luc-widget.is-open {
    bottom: 24px;
    right: 24px;
}

@media (max-width: 640px) {
    .has-luc-float-stack .luc-widget:not(.is-open) {
        bottom: 88px;
        right: 16px;
    }

    .has-luc-float-stack .luc-widget:not(.is-open) .luc-widget__trigger-label {
        display: none;
    }

    .has-luc-float-stack .luc-widget:not(.is-open) .luc-widget__trigger {
        padding: 10px 12px;
    }
}

/* Floating Launcher Button */
.luc-widget__trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #050c1c 0%, #0b1a3d 100%);
    border: 1px solid rgba(63, 232, 240, 0.4);
    box-shadow: 0 8px 24px rgba(0, 156, 255, 0.35), 0 0 16px rgba(63, 232, 240, 0.2);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.luc-widget__trigger:hover {
    transform: translateY(-2px);
    border-color: #3fe8f0;
    box-shadow: 0 12px 32px rgba(0, 156, 255, 0.5), 0 0 24px rgba(63, 232, 240, 0.4);
}

.luc-widget__trigger-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #071530 0%, #0c204a 100%);
    border: 1.5px solid #3fe8f0;
    box-shadow: 0 0 12px rgba(63, 232, 240, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3fe8f0;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.luc-widget__trigger:hover .luc-widget__trigger-badge {
    box-shadow: 0 0 18px rgba(63, 232, 240, 0.7);
    transform: scale(1.05);
}

.luc-bot-icon {
    display: block;
    animation: luc-eve-float 3s ease-in-out infinite;
}

.luc-avatar-svg {
    display: block;
    animation: luc-eve-float 3.5s ease-in-out infinite;
}

@keyframes luc-eve-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2.5px);
    }
}

.luc-eye-left,
.luc-eye-right {
    animation: luc-optic-pulse 4s ease-in-out infinite;
    transform-origin: center;
}

.luc-eye-right {
    animation-delay: 0.2s;
}

@keyframes luc-optic-pulse {
    0%, 90%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 2px #3fe8f0);
    }
    93% {
        opacity: 0.15;
    }
    96% {
        opacity: 1;
        filter: drop-shadow(0 0 4px #3fe8f0);
    }
}

.luc-widget__icon-close {
    display: none;
}

.luc-widget.is-open .luc-widget__icon-chat {
    display: none;
}

.luc-widget.is-open .luc-widget__icon-close {
    display: block;
}

.luc-widget__trigger-label {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.luc-widget__trigger-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.luc-widget__trigger-status {
    font-size: 0.72rem;
    color: #3fe8f0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.luc-widget__pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 8px;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: luc-pulse 2s infinite;
}

@keyframes luc-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Chat Panel */
.luc-widget__panel {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 570px;
    max-height: calc(100vh - 110px);
    background: rgba(5, 12, 28, 0.97);
    border: 1px solid rgba(0, 156, 255, 0.35);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 156, 255, 0.2);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: luc-slide-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.luc-widget__panel[hidden],
.luc-widget:not(.is-open) .luc-widget__panel {
    display: none !important;
}

.luc-gate[hidden],
.luc-chat-view[hidden],
.luc-typing[hidden],
.luc-gate__error[hidden] {
    display: none !important;
}

@keyframes luc-slide-up {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.luc-widget__header {
    padding: 14px 18px;
    background: linear-gradient(135deg, #071126 0%, #0d1e42 100%);
    border-bottom: 1px solid rgba(0, 156, 255, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.luc-widget__header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.luc-widget__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #071530 0%, #0c204a 100%);
    border: 1.5px solid #3fe8f0;
    box-shadow: 0 0 14px rgba(63, 232, 240, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.luc-widget__avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #071126;
    border-radius: 50%;
}

.luc-widget__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.luc-widget__badge {
    font-size: 0.68rem;
    background: rgba(63, 232, 240, 0.2);
    border: 1px solid #3fe8f0;
    color: #3fe8f0;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.luc-widget__subtitle {
    margin: 2px 0 0;
    font-size: 0.76rem;
    color: #94a3b8;
}

.luc-widget__btn-auth {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.luc-widget__btn-auth--text {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0 10px;
    color: #3fe8f0;
    border-color: rgba(63, 232, 240, 0.35);
}

.luc-widget__btn-auth:hover {
    color: #ffffff;
    background: rgba(0, 156, 255, 0.25);
    border-color: #3fe8f0;
}

.luc-widget__btn-icon {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.luc-widget__btn-icon:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

/* POPIA Strip */
.luc-widget__popia-strip {
    background: rgba(0, 156, 255, 0.08);
    border-bottom: 1px solid rgba(0, 156, 255, 0.15);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.3;
    flex-shrink: 0;
}

.luc-widget__popia-strip svg {
    flex-shrink: 0;
}

/* Sign-Up Access Gate View */
.luc-gate {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
}

.luc-gate__inner {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.luc-gate__icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(0, 156, 255, 0.12);
    border: 1px solid rgba(63, 232, 240, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.luc-gate__title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
}

.luc-gate__desc {
    margin: 0 0 16px;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.45;
}

.luc-gate__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.luc-gate__field label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.luc-gate__field input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    background: rgba(4, 9, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.luc-gate__field input:focus {
    outline: none;
    border-color: #3fe8f0;
    box-shadow: 0 0 0 2px rgba(63, 232, 240, 0.25);
}

.luc-gate__checkbox-label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.35;
    cursor: pointer;
    margin-top: 4px;
}

.luc-gate__checkbox-label input {
    margin-top: 2px;
    accent-color: #3fe8f0;
}

.luc-gate__btn {
    margin-top: 8px;
    width: 100%;
    padding: 11px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    background: linear-gradient(135deg, #009cff 0%, #0077cc 100%);
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 156, 255, 0.35);
    transition: all 0.2s;
}

.luc-gate__btn:hover {
    background: #3fe8f0;
    color: #041018;
}

.luc-gate__error {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ef4444;
}

.luc-gate__foot {
    margin-top: 16px;
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.luc-gate__foot a {
    color: #3fe8f0;
    text-decoration: none;
    font-weight: 600;
}

.luc-gate__tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(63, 232, 240, 0.25);
}

.luc-gate__tab {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(8, 14, 36, 0.6);
    color: #94a3b8;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.luc-gate__tab--active {
    background: rgba(0, 156, 255, 0.25);
    color: #3fe8f0;
}

.luc-gate__social {
    margin-top: 12px;
}

.luc-gate__social .lit-auth-social {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.luc-gate__social .lit-auth-social__buttons {
    flex-direction: column;
}

.luc-gate__social .lit-auth-social__btn {
    width: 100%;
    justify-content: center;
}

/* Chat View */
.luc-chat-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.luc-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 156, 255, 0.3) transparent;
}

.luc-msg {
    display: flex;
    flex-direction: column;
    max-width: 88%;
}

.luc-msg--user {
    align-self: flex-end;
}

.luc-msg--bot {
    align-self: flex-start;
}

.luc-msg__bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.luc-msg--user .luc-msg__bubble {
    background: linear-gradient(135deg, #009cff 0%, #0070ba 100%);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.luc-msg--bot .luc-msg__bubble {
    background: rgba(14, 25, 54, 0.85);
    border: 1px solid rgba(0, 156, 255, 0.2);
    color: #e2e8f0;
    border-bottom-left-radius: 2px;
}

.luc-msg__bubble p {
    margin: 0 0 6px;
}

.luc-msg__bubble p:last-child {
    margin-bottom: 0;
}

.luc-msg__bubble ul {
    margin: 4px 0;
    padding-left: 18px;
}

.luc-msg__bubble li {
    margin: 2px 0;
}

.luc-msg__bubble strong {
    color: #3fe8f0;
}

.luc-msg--user .luc-msg__bubble strong {
    color: #ffffff;
}

.luc-msg__bubble a {
    color: #3fe8f0;
    text-decoration: underline;
}

.luc-msg__bubble code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.8em;
    color: #3fe8f0;
}

/* Quick Prompts */
.luc-widget__quick-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.luc-quick-btn {
    background: rgba(0, 156, 255, 0.1);
    border: 1px solid rgba(0, 156, 255, 0.25);
    border-radius: 999px;
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 5px 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.luc-quick-btn:hover {
    background: rgba(63, 232, 240, 0.15);
    border-color: #3fe8f0;
    color: #ffffff;
}

/* Product Cards */
.luc-products-grid {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.luc-product-card {
    background: rgba(7, 15, 34, 0.9);
    border: 1px solid rgba(0, 156, 255, 0.25);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.luc-product-card--selectable:has(.luc-product-card__check:checked) {
    border-color: #3fe8f0;
    background: rgba(0, 156, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(63, 232, 240, 0.3);
}

.luc-product-card__check {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #3fe8f0;
    cursor: pointer;
}

.luc-product-card__body {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.luc-product-card__img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #040916;
}

.luc-product-card__info {
    flex: 1;
    min-width: 0;
}

.luc-product-card__title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.luc-product-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.luc-product-card__sku {
    font-size: 0.7rem;
    color: #64748b;
    font-family: monospace;
}

.luc-product-card__stock {
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.luc-stock-tag--in {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.luc-stock-tag--lead {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.luc-product-card__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.luc-product-card__price {
    font-size: 0.82rem;
    color: #3fe8f0;
    font-weight: 700;
}

.luc-product-card__link {
    font-size: 0.75rem;
    color: #009cff;
    font-weight: 600;
    text-decoration: none;
}

/* Actions */
.luc-msg__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.luc-action-btn {
    display: inline-block;
    background: rgba(63, 232, 240, 0.12);
    border: 1px solid #3fe8f0;
    color: #3fe8f0;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.luc-action-btn:hover {
    background: #3fe8f0;
    color: #041018;
}

.luc-action-btn--primary {
    background: linear-gradient(135deg, #009cff 0%, #0077cc 100%);
    border-color: #00d2ff;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 156, 255, 0.4);
}

.luc-action-btn--primary:hover {
    background: linear-gradient(135deg, #00d2ff 0%, #009cff 100%);
    color: #041018;
}

/* Typing Indicator */
.luc-typing {
    padding: 8px 16px;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.luc-typing span {
    width: 6px;
    height: 6px;
    background: #3fe8f0;
    border-radius: 50%;
    animation: luc-bounce 1.4s infinite ease-in-out both;
}

.luc-typing span:nth-child(1) { animation-delay: -0.32s; }
.luc-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes luc-bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

/* Form Input */
.luc-widget__form {
    padding: 12px 14px;
    background: #071126;
    border-top: 1px solid rgba(0, 156, 255, 0.2);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.luc-widget__input {
    flex: 1;
    background: rgba(4, 9, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 0.86rem;
    transition: all 0.2s;
}

.luc-widget__input:focus {
    outline: none;
    border-color: #009cff;
    box-shadow: 0 0 0 2px rgba(0, 156, 255, 0.25);
}

.luc-widget__send {
    background: #009cff;
    border: 0;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.luc-widget__send:hover {
    background: #3fe8f0;
    color: #041018;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .luc-widget {
        bottom: 16px;
        right: 16px;
    }
    .luc-widget__panel {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: 0;
    }
}
