/**
 * ExtrumWeb Live Chat Widget CSS for PrestaShop
 */
#ew-livechat-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#ew-chat-launcher {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    position: relative;
}

#ew-chat-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
}

.ew-chat-launcher-icon svg {
    width: 28px;
    height: 28px;
}

.ew-chat-launcher-close {
    display: none;
    font-size: 32px;
    line-height: 1;
}

#ew-livechat-root.ew-chat-open .ew-chat-launcher-icon {
    display: none;
}

#ew-livechat-root.ew-chat-open .ew-chat-launcher-close {
    display: block;
}

.ew-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Fenêtre de Chat */
.ew-chat-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 370px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ewChatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.ew-chat-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    shrink: 0;
}

.ew-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ew-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    position: relative;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.ew-chat-status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid #0f172a;
    border-radius: 50%;
}

.ew-chat-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.ew-chat-status-label {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    margin-top: 2px;
}

.ew-chat-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s;
}

.ew-chat-close-btn:hover {
    color: #ffffff;
}

/* Bannière Produit Consulté */
.ew-chat-product-banner {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ew-chat-prod-img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.ew-chat-prod-details {
    flex: 1;
    min-width: 0;
}

.ew-chat-prod-tag {
    font-size: 10px;
    color: #64748b;
    display: block;
}

.ew-chat-prod-name {
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ew-chat-prod-price {
    font-size: 11px;
    font-weight: 800;
    color: #2563eb;
}

/* Zone des messages */
.ew-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ew-chat-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}

.ew-chat-msg-visitor {
    align-self: flex-end;
    background: #2563eb;
    color: #ffffff;
    border-bottom-right-radius: 3px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.ew-chat-msg-agent {
    align-self: flex-start;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ew-chat-msg-bot {
    align-self: center;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    padding: 6px 14px;
    text-align: center;
}

.ew-chat-msg-time {
    display: block;
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: right;
}

/* Demande d'email */
.ew-chat-identity-box {
    background: #eff6ff;
    border-top: 1px solid #dbeafe;
    padding: 10px 14px;
    font-size: 11px;
    color: #1e40af;
}

.ew-chat-identity-box p {
    margin: 0 0 6px 0;
    font-weight: 600;
}

.ew-chat-identity-fields {
    display: flex;
    gap: 6px;
}

.ew-chat-identity-fields input {
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    font-size: 12px;
    outline: none;
}

.ew-chat-identity-fields button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

/* Saisie du message */
.ew-chat-input-area {
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ew-chat-input-area textarea {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    resize: none;
    max-height: 80px;
    font-family: inherit;
    line-height: 1.35;
}

.ew-chat-input-area textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.ew-chat-input-area button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    shrink: 0;
}

.ew-chat-input-area button:hover {
    background: #1d4ed8;
}

.ew-chat-input-area button svg {
    width: 18px;
    height: 18px;
}

.ew-chat-footer-brand {
    padding: 4px 14px 6px;
    background: #ffffff;
    text-align: center;
    font-size: 9px;
    color: #94a3b8;
    letter-spacing: 0.02em;
}
