/* Lya Chatbot — Widget */

/* Empêche le bouton scroll-to-top du thème d'être masqué par la bulle Lya */
.scroll-to-top {
    bottom: 96px !important;
}

#lya-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    background: #1a1a2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

#lya-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,0.35);
}

#lya-bubble-icon {
    color: #c9b8ff;
    font-size: 22px;
    line-height: 1;
    transition: transform 0.3s ease;
}

#lya-bubble.open #lya-bubble-icon {
    transform: rotate(45deg);
}

/* Panel */

#lya-panel {
    position: fixed;
    bottom: 96px;
    right: 28px;
    width: 360px;
    max-height: 540px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99998;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

#lya-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */

#lya-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #1a1a2e;
    color: #fff;
}

#lya-avatar {
    width: 36px;
    height: 36px;
    background: #c9b8ff22;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #c9b8ff;
    flex-shrink: 0;
}

#lya-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

#lya-header-info strong {
    font-size: 15px;
    font-weight: 600;
}

#lya-header-info span {
    font-size: 12px;
    opacity: 0.65;
}

#lya-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px;
    line-height: 1;
    transition: opacity 0.15s;
}

#lya-close:hover {
    opacity: 1;
}

/* Messages */

#lya-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.lya-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.lya-msg.lya-user {
    align-self: flex-end;
    background: #1a1a2e;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.lya-msg.lya-assistant {
    align-self: flex-start;
    background: #f3f0ff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
}

.lya-msg.lya-typing {
    align-self: flex-start;
    background: #f3f0ff;
    color: #888;
    font-style: italic;
    font-size: 13px;
}

/* Input */

#lya-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

#lya-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 100px;
    overflow-y: hidden;
    transition: border-color 0.15s;
    background: #fff;
}

#lya-input:focus {
    border-color: #9b7bff;
}

#lya-send {
    width: 38px;
    height: 38px;
    background: #1a1a2e;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #fff;
    transition: background 0.15s, transform 0.15s;
}

#lya-send:hover {
    background: #2d2d5e;
    transform: scale(1.05);
}

#lya-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}



/* Markdown dans les messages */

.lya-msg .lya-list {
    margin: 6px 0 2px;
    padding-left: 18px;
}

.lya-msg .lya-list li {
    margin-bottom: 4px;
    line-height: 1.45;
}

.lya-msg strong {
    font-weight: 600;
}

/* Carte commande */

.lya-card {
    align-self: flex-start;
    width: 100%;
    border: 1px solid #e8e0ff;
    border-radius: 12px;
    overflow: hidden;
    font-size: 13px;
}

.lya-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: #f3f0ff;
    border-bottom: 1px solid #e8e0ff;
}

.lya-card-number {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a2e;
}

.lya-badge {
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.lya-badge-success    { background: #d1fae5; color: #065f46; }
.lya-badge-processing { background: #fef3c7; color: #92400e; }
.lya-badge-pending    { background: #e0f2fe; color: #0c4a6e; }
.lya-badge-cancelled  { background: #fee2e2; color: #991b1b; }
.lya-badge-default    { background: #f3f4f6; color: #374151; }

.lya-card-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
}

.lya-card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.lya-card-row span:first-child {
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
}

.lya-card-row span:last-child {
    color: #1a1a2e;
    font-weight: 500;
    text-align: right;
}

.lya-card-ticket .lya-card-header {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
}

.lya-card-ticket {
    border-color: #bbf7d0;
}

.lya-tracking {
    font-family: monospace;
    font-size: 11px;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Animation 3 points */

.lya-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 2px 0;
}

.lya-dots span {
    width: 6px;
    height: 6px;
    background: #bbb;
    border-radius: 50%;
    animation: lya-bounce 1.2s infinite ease-in-out;
}

.lya-dots span:nth-child(2) { animation-delay: 0.2s; }
.lya-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes lya-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40%           { transform: scale(1);   opacity: 1;   }
}

/* Carte navigation */

.lya-card-navigate {
    border: none;
    background: transparent;
    box-shadow: none;
}

.lya-nav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: #f3f0ff;
    border: 1px solid #d4c8ff;
    border-radius: 12px;
    text-decoration: none;
    color: #5a3faa;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.lya-nav-btn:hover {
    background: #e8e0ff;
    border-color: #9b7bff;
    color: #4a2f9a;
    transform: translateX(3px);
}

.lya-nav-arrow {
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.lya-nav-btn:hover .lya-nav-arrow {
    transform: translateX(2px);
}

/* Responsive mobile */

@media (max-width: 480px) {
    #lya-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
    }

    #lya-bubble {
        bottom: 20px;
        right: 20px;
    }
}
