@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   Variables & Reset
   ========================================================================== */
:root {
    --ledlam-primary: #D4A24C;
    --ledlam-primary-dark: #B8883A;
    --ledlam-secondary: #3D3D3D;
    --ledlam-success: #4CAF50;
    --ledlam-text-dark: #2C2C2C;
    --ledlam-text-light: #6C757D;
    --ledlam-bg-light: #FFFFFF;
    --ledlam-bg-gray: #F8F9FA;
    --ledlam-border: #E9ECEF;
    --ledlam-shadow: rgba(0, 0, 0, 0.1);
    --ledlam-shadow-lg: rgba(0, 0, 0, 0.15);
    --ledlam-gradient: linear-gradient(135deg, #C28D38 0%, #E6B85D 100%);
    --ledlam-chat-width: 380px;
    --ledlam-chat-height: 600px;
    --ledlam-font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Chat Button (Floating)
   ========================================================================== */
#ledlam-chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: var(--ledlam-font-main);
}

.ledlam-chat-btn {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ledlam-gradient);
    border: none;
    box-shadow: 0 8px 24px var(--ledlam-shadow-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ledlam-chat-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 32px var(--ledlam-shadow-lg);
}

.ledlam-chat-btn:active {
    transform: translateY(0) scale(0.98);
}

.ledlam-chat-icon,
.ledlam-close-icon {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.ledlam-close-icon {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.8);
}

.ledlam-chat-btn.active .ledlam-chat-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.8);
}

.ledlam-chat-btn.active .ledlam-close-icon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Notification Badge */
.ledlam-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--ledlam-success);
    border-radius: 50%;
    border: 3px solid white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.ledlam-notification-badge.show {
    opacity: 1;
    transform: scale(1);
    animation: ledlam-pulse 2s infinite;
}

@keyframes ledlam-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ==========================================================================
   Chat Window
   ========================================================================== */
.ledlam-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: var(--ledlam-chat-width);
    height: var(--ledlam-chat-height);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.ledlam-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ==========================================================================
   Chat Header
   ========================================================================== */
.ledlam-chat-header {
    background: var(--ledlam-gradient);
    color: white;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.ledlam-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ledlam-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ledlam-avatar svg {
    width: 26px;
    height: 26px;
    color: white;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.ledlam-chat-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.ledlam-chat-status {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
}

.ledlam-status-dot {
    width: 10px;
    height: 10px;
    background: #00E676;
    /* Vivid green */
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: ledlam-pulse 2s infinite;
}

.ledlam-minimize-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ledlam-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ledlam-minimize-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* ==========================================================================
   Messages Area
   ========================================================================== */
.ledlam-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--ledlam-bg-gray);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ledlam-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ledlam-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ledlam-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.ledlam-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Message Bubbles
   ========================================================================== */
.ledlam-message {
    display: flex;
    gap: 10px;
    animation: ledlam-slideIn 0.3s ease;
}

@keyframes ledlam-slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ledlam-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ledlam-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ledlam-message-avatar svg {
    width: 16px;
    height: 16px;
    color: white;
}

.ledlam-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ledlam-message-bubble {
    background: white;
    padding: 12px 18px;
    border-radius: 20px 20px 20px 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--ledlam-text-dark);
    max-width: 85%;
    letter-spacing: 0.01em;
    border: 1px solid rgba(0, 0, 0, 0.02);
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.ledlam-message-time {
    font-size: 10px;
    font-weight: 500;
    color: var(--ledlam-text-light);
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* User Messages */
.ledlam-message-user {
    flex-direction: row-reverse;
}

.ledlam-message-user .ledlam-message-content {
    align-items: flex-end;
}

.ledlam-message-user .ledlam-message-bubble {
    background: var(--ledlam-gradient);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.ledlam-message-user .ledlam-message-avatar {
    background: var(--ledlam-secondary);
}

/* ==========================================================================
   Product Cards
   ========================================================================== */
.ledlam-product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 16px;
    margin-top: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ledlam-product-card:hover {
    box-shadow: 0 8px 25px rgba(212, 162, 76, 0.15);
    transform: translateY(-4px);
    border-color: var(--ledlam-primary);
}

.ledlam-product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--ledlam-bg-gray);
    flex-shrink: 0;
}

.ledlam-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ledlam-product-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ledlam-text-dark);
    line-height: 1.4;
    margin: 0;
    letter-spacing: -0.01em;
}

.ledlam-product-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--ledlam-primary);
    margin: 6px 0;
    letter-spacing: -0.02em;
}

.ledlam-product-details {
    font-size: 12px;
    font-weight: 500;
    color: var(--ledlam-text-light);
    line-height: 1.5;
}

.ledlam-product-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ledlam-success);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ledlam-product-stock::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ledlam-success);
}

.ledlam-product-link {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background: var(--ledlam-gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(212, 162, 76, 0.2);
}

.ledlam-product-link:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(212, 162, 76, 0.3);
    color: white;
}

.ledlam-inline-link {
    color: var(--ledlam-primary);
    text-decoration: underline;
    font-weight: 700;
    transition: all 0.2s ease;
}

.ledlam-inline-link:hover {
    color: var(--ledlam-text-dark);
}

/* ==========================================================================
   Quick Replies
   ========================================================================== */
.ledlam-quick-replies {
    padding: 0 20px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--ledlam-bg-gray);
}

.ledlam-quick-reply-btn {
    background: var(--ledlam-bg-gray);
    border: 1px solid var(--ledlam-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--ledlam-text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ledlam-quick-reply-btn:hover {
    background: var(--ledlam-primary);
    color: white;
    border-color: var(--ledlam-primary);
    transform: translateY(-1px);
}

/* ==========================================================================
   Input Area
   ========================================================================== */
.ledlam-chat-input-container {
    background: white;
    border-top: 1px solid var(--ledlam-border);
    padding: 16px 20px;
}

.ledlam-typing-indicator {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    align-items: center;
    background: linear-gradient(135deg, rgba(212, 162, 76, 0.05) 0%, rgba(212, 162, 76, 0.1) 100%);
    border-radius: 16px;
    margin: 8px 0;
    animation: ledlam-pulse-glow 2s ease-in-out infinite;
}

@keyframes ledlam-pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(212, 162, 76, 0);
    }

    50% {
        box-shadow: 0 0 20px 0 rgba(212, 162, 76, 0.15);
    }
}

.ledlam-typing-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--ledlam-primary);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ledlam-typing-text::before {
    content: '✨';
    font-size: 16px;
    animation: ledlam-sparkle 1.5s ease-in-out infinite;
}

@keyframes ledlam-sparkle {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.ledlam-typing-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--ledlam-primary) 0%, var(--ledlam-primary-dark) 100%);
    border-radius: 50%;
    animation: ledlam-typing 1.4s infinite ease-in-out;
    box-shadow: 0 2px 4px rgba(212, 162, 76, 0.3);
}

.ledlam-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ledlam-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.ledlam-typing-dot:nth-child(4) {
    animation-delay: 0.6s;
}

@keyframes ledlam-typing {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-10px) scale(1.2);
        opacity: 1;
        background: var(--ledlam-primary);
    }
}

/* Skeleton Loader */
.ledlam-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: ledlam-skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes ledlam-skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.ledlam-skeleton-text {
    height: 12px;
    width: 100%;
    margin-bottom: 8px;
}

.ledlam-skeleton-price {
    height: 16px;
    width: 60px;
}

.ledlam-chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ledlam-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--ledlam-border);
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    overflow-y: auto;
}

.ledlam-chat-input:focus {
    border-color: var(--ledlam-primary);
    box-shadow: 0 0 0 3px rgba(212, 162, 76, 0.1);
}

.ledlam-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ledlam-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ledlam-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.ledlam-send-btn:active {
    transform: scale(0.95);
}

.ledlam-send-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

.ledlam-send-btn:disabled,
.ledlam-btn-locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc !important;
    box-shadow: none !important;
}

.ledlam-input-locked {
    background: rgba(212, 162, 76, 0.05);
    border-color: rgba(212, 162, 76, 0.2) !important;
    cursor: not-allowed;
}

.ledlam-input-locked::placeholder {
    color: var(--ledlam-primary);
    font-weight: 600;
    opacity: 0.7;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */
@media (max-width: 480px) {
    :root {
        --ledlam-chat-width: calc(100vw - 32px);
        --ledlam-chat-height: calc(100vh - 120px);
    }

    #ledlam-chatbot-container {
        bottom: 16px;
        right: 16px;
    }

    .ledlam-chat-window {
        bottom: 72px;
        right: 0;
        left: 16px;
        max-height: calc(100vh - 120px);
    }
}

@media (max-width: 360px) {
    .ledlam-chat-btn {
        width: 56px;
        height: 56px;
    }

    .ledlam-chat-icon {
        width: 24px;
        height: 24px;
    }
}

/* ==========================================================================
   Lead Generation Screen
   ========================================================================== */
.ledlam-lead-screen {
    background: white;
    z-index: 100;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    border-radius: 0 0 16px 16px;
}

.ledlam-lead-content {
    width: 100%;
}

.ledlam-lead-content h4 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--ledlam-text-dark);
}

.ledlam-lead-content p {
    font-size: 14px;
    color: var(--ledlam-text-light);
    margin-bottom: 25px;
}

.ledlam-form-group {
    margin-bottom: 15px;
}

.ledlam-form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.ledlam-form-group input:focus {
    border-color: var(--ledlam-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 162, 76, 0.1);
}

.ledlam-lead-submit {
    width: 100%;
    padding: 14px;
    background: var(--ledlam-gradient);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.ledlam-lead-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 162, 76, 0.3);
}

/* Hide input container when lead screen is active */
.ledlam-chat-window.lead-active .ledlam-chat-input-container {
    display: none;
}

/* Product Link Button Styling */
.ledlam-product-button {
    display: block;
    width: fit-content;
    padding: 10px 22px;
    background: var(--ledlam-gradient);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    margin: 12px 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(212, 162, 76, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modern Expert Link */
.ledlam-cta-row {
    margin: 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ledlam-modern-expert-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #fdfaf6;
    border: 1px solid var(--ledlam-primary);
    color: var(--ledlam-primary) !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.ledlam-modern-expert-btn:hover {
    background: var(--ledlam-primary);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 162, 76, 0.2);
}

/* Chat Chips (Buttons) */
.ledlam-chat-chip {
    padding: 6px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 18px;
    color: #444;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 4px;
    display: inline-block;
}

.ledlam-chat-chip:hover {
    border-color: var(--ledlam-primary);
    color: var(--ledlam-primary);
    background: #fdfaf6;
    transform: translateY(-1px);
}

.ledlam-chat-chip:active {
    transform: scale(0.96);
}