/* Live Sales Chatbot Styles */

:root {
    --primary-color: #007bff;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --text-dark: #212529;
    --text-light: #6c757d;
}

/* Container */
#lsc-chatbot-container {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#lsc-chatbot-container.lsc-bottom-right {
    right: 20px;
}

#lsc-chatbot-container.lsc-bottom-left {
    left: 20px;
}

/* Chatbot Widget */
.lsc-chatbot-widget {
    --primary-color: #007bff;
}

/* Chat Button */
.lsc-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

.lsc-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.lsc-chat-button:active {
    transform: scale(0.95);
}

.lsc-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.lsc-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 420px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

#lsc-chatbot-container.lsc-bottom-left .lsc-chat-window {
    right: auto;
    left: 0;
}

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

/* Chat Header */
.lsc-chat-header {
    background: linear-gradient(135deg, var(--primary-color), rgba(0, 123, 255, 0.8));
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.lsc-header-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lsc-header-title strong {
    font-size: 16px;
    font-weight: 600;
}

.lsc-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lsc-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 49%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.lsc-close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.lsc-close-button:hover {
    transform: rotate(90deg);
}

/* Messages Container */
.lsc-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
}

.lsc-messages-container::-webkit-scrollbar {
    width: 6px;
}

.lsc-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.lsc-messages-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.lsc-messages-container::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Messages */
.lsc-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: messageAppear 0.3s ease;
}

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

.lsc-message.lsc-user {
    align-items: flex-end;
}

.lsc-message.lsc-bot {
    align-items: flex-start;
}

.lsc-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.lsc-user .lsc-message-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.lsc-bot .lsc-message-content {
    background: var(--bg-light);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Formatted content inside bot messages (headings, bold, bullet lines) */
.lsc-bot .lsc-message-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

.lsc-bot .lsc-message-content strong.lsc-heading {
    display: block;
    font-size: 15px;
    margin: 4px 0 6px;
}

.lsc-bot .lsc-message-content .lsc-line {
    display: block;
    margin: 2px 0;
}

.lsc-bot .lsc-message-content .lsc-line-bullet .lsc-bullet {
    display: inline-block;
    width: 18px;
    color: #2ecc71;
    font-weight: 700;
}

.lsc-message-time {
    font-size: 12px;
    color: var(--text-light);
    padding: 0 4px;
}

/* Typing Indicator */
.lsc-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.lsc-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.lsc-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.lsc-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* FAQ Section */
.lsc-faq-section {
    padding: 12px 16px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    max-height: 200px;
    overflow-y: auto;
}

.lsc-faq-title {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 600;
}

.lsc-faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lsc-faq-btn {
    text-align: left;
    padding: 8px 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
    font-family: inherit;
}

.lsc-faq-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Lead Form */
.lsc-lead-form {
    padding: 16px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
}

.lsc-lead-form h4 {
    margin: 0;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
}

.lsc-form-subtitle {
    margin: 0 0 8px 0;
    color: var(--text-light);
    font-size: 12px;
}

.lsc-form-input {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.lsc-form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.lsc-btn-submit {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.lsc-btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.lsc-btn-submit:active {
    transform: translateY(0);
}

/* Input Area */
.lsc-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    align-items: flex-end;
}

.lsc-input-field {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    resize: vertical;
    max-height: 100px;
    min-height: 40px;
}

.lsc-input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.lsc-send-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lsc-send-button:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.lsc-send-button:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 480px) {
    .lsc-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        max-width: 100%;
    }

    #lsc-chatbot-container.lsc-bottom-right {
        right: 10px;
    }

    #lsc-chatbot-container.lsc-bottom-left {
        left: 10px;
    }

    .lsc-message-content {
        max-width: 90%;
    }

    .lsc-chat-button {
        width: 56px;
        height: 56px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .lsc-chat-window {
        background: #2a2a2a;
    }

    .lsc-messages-container {
        background: #2a2a2a;
    }

    .lsc-message-content {
        color: inherit;
    }

    .lsc-bot .lsc-message-content {
        background: #3a3a3a;
        color: #e0e0e0;
        border-color: #4a4a4a;
    }

    .lsc-input-field {
        background: #3a3a3a;
        color: #e0e0e0;
        border-color: #4a4a4a;
    }

    .lsc-lead-form {
        background: #3a3a3a;
        border-color: #4a4a4a;
    }

    .lsc-form-input {
        background: #2a2a2a;
        color: #e0e0e0;
        border-color: #4a4a4a;
    }

    .lsc-form-input:focus {
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    }

    .lsc-input-area {
        background: #2a2a2a;
        border-color: #4a4a4a;
    }
}
