/* Life Shapers Chatbot Widget Styles */

.ls-chatbot-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Position variants */
.ls-chatbot-widget.position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.ls-chatbot-widget.position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.ls-chatbot-widget.position-top-right {
    top: 20px;
    right: 20px;
}

.ls-chatbot-widget.position-top-left {
    top: 20px;
    left: 20px;
}

/* Chat button (closed state) */
.ls-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(49, 214, 203, 0.7);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: visible;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(49, 214, 203, 0.7);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(49, 214, 203, 0);
    }
}

.ls-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(49, 214, 203, 0.5);
    animation: none;
}

.ls-chatbot-button svg {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 2;
}

/* Shine effect on button */
.ls-chatbot-button-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    border-radius: 50%;
    animation: shine 3s infinite;
    z-index: 1;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* Pulse ring animation */
.ls-chatbot-button-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(49, 214, 203, 0.6);
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: 0;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Notification badge */
.ls-chatbot-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: badge-pulse 1.5s ease-in-out infinite;
    z-index: 3;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Chat window (open state) */
.ls-chatbot-window {
    width: 420px;
    height: 700px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.ls-chatbot-window.open {
    transform: scale(1);
    opacity: 1;
}

/* Chat header */
.ls-chatbot-header {
    background: #000;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.ls-chatbot-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    font-size: 16px;
}

.ls-chatbot-title {
    font-weight: 600;
    font-size: 16px;
}

.ls-chatbot-minimize {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    width: 32px;
    height: 32px;
}

.ls-chatbot-minimize:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ls-chatbot-minimize svg {
    width: 20px;
    height: 20px;
}

/* Chat messages area */
.ls-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
    scroll-behavior: smooth;
}

.ls-chatbot-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    word-wrap: break-word;
    animation: fadeIn 0.3s;
    line-height: 1.6;
    font-size: 15px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ls-chatbot-message.assistant {
    background: #ffffff;
    color: #212529;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

/* Markdown formatting in messages */
.ls-chatbot-message.assistant strong,
.ls-chatbot-message.assistant b {
    font-weight: 700;
    color: #000;
}

.ls-chatbot-message.assistant em,
.ls-chatbot-message.assistant i {
    font-style: italic;
}

.ls-chatbot-message.assistant p {
    margin: 0 0 12px 0;
}

.ls-chatbot-message.assistant p:last-child {
    margin-bottom: 0;
}

.ls-chatbot-message.assistant ul,
.ls-chatbot-message.assistant ol {
    margin: 8px 0;
    padding-left: 24px;
}

.ls-chatbot-message.assistant li {
    margin: 6px 0;
}

.ls-chatbot-message.assistant h1,
.ls-chatbot-message.assistant h2,
.ls-chatbot-message.assistant h3 {
    margin: 12px 0 8px 0;
    font-weight: 700;
}

.ls-chatbot-message.assistant h1 {
    font-size: 1.3em;
}

.ls-chatbot-message.assistant h2 {
    font-size: 1.2em;
}

.ls-chatbot-message.assistant h3 {
    font-size: 1.1em;
}

.ls-chatbot-message.assistant code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.ls-chatbot-message.assistant pre {
    background: #f1f3f5;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.ls-chatbot-message.assistant blockquote {
    border-left: 3px solid #dee2e6;
    padding-left: 12px;
    margin: 8px 0;
    color: #6c757d;
}

.ls-chatbot-message.user {
    background: #000;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ls-chatbot-message.loading {
    background: #e9ecef;
    padding: 16px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.ls-chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    animation: typing 1.4s infinite;
}

.ls-chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ls-chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Suggested questions */
.ls-chatbot-suggestions {
    padding: 0 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ls-chatbot-suggestion {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    text-align: left;
}

.ls-chatbot-suggestion:hover {
    background: #f8f9fa;
    border-color: #000;
}

/* Privacy notice */
.ls-chatbot-privacy {
    padding: 8px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 11px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ls-chatbot-privacy-text {
    flex: 1;
}

.ls-chatbot-privacy-link {
    color: #000;
    text-decoration: underline;
}

.ls-chatbot-privacy-close {
    background: transparent;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
    font-size: 16px;
    line-height: 1;
}

/* Input area */
.ls-chatbot-input-area {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ls-chatbot-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    border-radius: 24px;
    background: #f8f9fa;
    font-size: 14px;
    font-family: inherit;
}

.ls-chatbot-input:focus {
    background: #e9ecef;
}

.ls-chatbot-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.ls-chatbot-send-button:hover:not(:disabled) {
    transform: scale(1.1);
}

.ls-chatbot-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ls-chatbot-send-button svg {
    width: 18px;
    height: 18px;
}

/* Powered by */
.ls-chatbot-powered {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
}

.ls-chatbot-powered-logo {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    font-weight: bold;
    margin-right: 4px;
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 480px) {
    .ls-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        max-height: 90vh;
    }
    
    .ls-chatbot-call-widget {
        padding: 14px;
    }
    
    .ls-chatbot-call-number {
        font-size: 16px;
    }
    
    .ls-chatbot-widget.position-bottom-right,
    .ls-chatbot-widget.position-bottom-left {
        bottom: 10px;
    }
    
    .ls-chatbot-widget.position-bottom-right {
        right: 10px;
    }
    
    .ls-chatbot-widget.position-bottom-left {
        left: 10px;
    }
}

/* Hide when closed */
.ls-chatbot-widget.closed .ls-chatbot-window {
    display: none;
}

.ls-chatbot-widget.open .ls-chatbot-button {
    display: none;
}

/* Hide notification badge when widget is open */
.ls-chatbot-widget.open .ls-chatbot-notification-badge {
    display: none;
}

/* Call Widget CTA */
.ls-chatbot-call-widget {
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #31d6cb 0%, #2bc4b8 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(49, 214, 203, 0.3);
    animation: callPulse 2s ease-in-out infinite;
}

@keyframes callPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(49, 214, 203, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(49, 214, 203, 0.5);
    }
}

.ls-chatbot-call-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 214, 203, 0.5);
    animation: none;
}

.ls-chatbot-call-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.ls-chatbot-call-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
    stroke-width: 2.5;
}

.ls-chatbot-call-content {
    flex: 1;
    color: #fff;
}

.ls-chatbot-call-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ls-chatbot-call-number {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ls-chatbot-call-arrow {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.ls-chatbot-call-arrow svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

/* Phone number highlighting in messages */
.ls-chatbot-message.assistant .phone-number {
    color: #31d6cb;
    font-weight: 600;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(49, 214, 203, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.ls-chatbot-message.assistant .phone-number:hover {
    background: rgba(49, 214, 203, 0.2);
    text-decoration: underline;
}

/* YouTube Video Greeting */
.ls-chatbot-video-greeting {
    margin-bottom: 16px;
    animation: fadeIn 0.5s;
}

.ls-chatbot-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ls-chatbot-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

